Skip to content

Commit

Permalink
Merge pull request #1697 from atsign-foundation/cpswan-armv7-openssh-…
Browse files Browse the repository at this point in the history
…on-arm64

ci: Workaround for armv7 on arm64 runners
  • Loading branch information
cpswan authored Jan 27, 2025
2 parents 8c3617d + 2d48a6a commit 553ab32
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 18 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/dockerhub_sshnpd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ permissions: # added using https://github.com/step-security/secure-workflows
contents: read

jobs:
docker_amd64:
docker_arm64:
strategy:
matrix:
include:
Expand All @@ -20,7 +20,7 @@ jobs:
dockerfile: ./packages/dart/sshnoports/tools/Dockerfile.activate
- name: sshnpd-slim
dockerfile: ./packages/dart/sshnoports/tools/Dockerfile.sshnpd-slim
runs-on: ubuntu-latest
runs-on: ubuntu-24.04-arm
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down Expand Up @@ -49,14 +49,14 @@ jobs:
with:
context: .
file: ${{ matrix.dockerfile }}
platforms: linux/amd64,linux/arm/v7
platforms: linux/arm64,linux/arm/v7
push: true
provenance: false
tags: |
atsigncompany/${{ matrix.name }}:${{ env.VERSION }}
atsigncompany/${{ matrix.name }}:release-${{ env.VERSION }}
docker_arm64:
docker_amd64:
strategy:
matrix:
include:
Expand All @@ -66,7 +66,7 @@ jobs:
dockerfile: ./packages/dart/sshnoports/tools/Dockerfile.activate
- name: sshnpd-slim
dockerfile: ./packages/dart/sshnoports/tools/Dockerfile.sshnpd-slim
runs-on: ubuntu-24.04-arm
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down Expand Up @@ -95,12 +95,12 @@ jobs:
with:
context: .
file: ${{ matrix.dockerfile }}
platforms: linux/arm64
platforms: linux/amd64
push: true
provenance: false
tags: |
atsigncompany/${{ matrix.name }}:arm64-${{ env.VERSION }}
atsigncompany/${{ matrix.name }}:arm64-release-${{ env.VERSION }}
atsigncompany/${{ matrix.name }}:amd64-${{ env.VERSION }}
atsigncompany/${{ matrix.name }}:amd64-release-${{ env.VERSION }}
docker_combine:
needs: [docker_amd64, docker_arm64]
Expand All @@ -127,10 +127,10 @@ jobs:
run: |
docker buildx imagetools create \
-t atsigncompany/${{ matrix.name }}:${{ env.VERSION }} \
--append atsigncompany/${{ matrix.name }}:arm64-${{ env.VERSION }}
--append atsigncompany/${{ matrix.name }}:amd64-${{ env.VERSION }}
docker buildx imagetools create \
-t atsigncompany/${{ matrix.name }}:release-${{ env.VERSION }} \
--append atsigncompany/${{ matrix.name }}:arm64-release-${{ env.VERSION }}
--append atsigncompany/${{ matrix.name }}:amd64-release-${{ env.VERSION }}
# Promote to latest so long as this isn't a pre-release
- name: Update latest tag
run: |
Expand Down
3 changes: 2 additions & 1 deletion packages/dart/sshnoports/tools/Dockerfile.sshnpd-slim
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#FROM dart:beta-sdk AS buildimage

FROM dart:3.6.1@sha256:a071f0322c7c80469842f7c8258de51d1946ba9b79d09bb8fc4dc969487a68ca AS buildimage
ARG TARGETARCH
ENV PACKAGEDIR=packages/dart/sshnoports
ENV OPENSSH=tools/static-openssh
ENV BINARYDIR=/usr/local/at
Expand Down Expand Up @@ -39,7 +40,7 @@ RUN \
# build static openssh binaries
apt update && apt install -y curl gcc make autoconf ; \
cd ${WORKDIR}/${OPENSSH} ; \
./static-openssh.sh ; \
ARCH=${TARGETARCH} ./static-openssh.sh ; \
cp build/openssh-portable*/ssh-keygen ${BINARYDIR}/ ; \
cp build/openssh-portable*/ssh ${BINARYDIR}/ ; \
chmod 755 ${BINARYDIR}/ssh-keygen ; \
Expand Down
17 changes: 10 additions & 7 deletions tools/static-openssh/static-openssh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,16 @@ gzip -dc $dist/openssl-*.tar.gz |(cd "$build" && tar xf -)
fi
cd "$build"/openssl-*
# Debian 12 / Ubuntu 20.x.x break the autoconf in ./config on armv7 devices
CPU=$(uname -m)
if [[ $CPU == "armv7l" ]]
then
./Configure linux-armv4 --prefix="$root" no-shared no-tests
else
./config --prefix="$root" no-shared no-tests
fi
# $ARCH passed in from Dockerfile
# Don't use `uname -m` as we get the wrong answer on arm64 runners
if [[ $ARCH == "arm" ]]
then
echo "Found arm architecture, configuring explicitly"
./Configure linux-armv4 --prefix="$root" no-shared no-tests
else
echo "Found ${ARCH} architecture, using default config script"
./config --prefix="$root" no-shared no-tests
fi
make
make install
cd "$top"
Expand Down

0 comments on commit 553ab32

Please sign in to comment.