Skip to content

Commit

Permalink
Add musl arm64 binary (#595)
Browse files Browse the repository at this point in the history
  • Loading branch information
TingDaoK authored Jan 7, 2025
1 parent aa5caa9 commit b9f731d
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 11 deletions.
14 changes: 4 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,30 +65,24 @@ jobs:
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ matrix.image }} build -p ${{ env.PACKAGE_NAME }}
linux-musl-armv7:
runs-on: ubuntu-24.04 # latest
linux-musl-armv8:
runs-on: codebuild-aws-crt-nodejs-arm64-${{ github.run_id }}-${{ github.run_attempt }}-arm-3.0-large
strategy:
fail-fast: false
matrix:
image:
- alpine-3.16-x64
steps:
- uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.CRT_CI_ROLE }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
- name: Install qemu/docker
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- name: Checkout Sources
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: true
# We can't use the `uses: docker://image` version yet, GitHub lacks authentication for actions -> packages
- name: Build ${{ env.PACKAGE_NAME }}
run: |
export AWS_CRT_ARCH=armv7
aws s3 cp s3://aws-crt-test-stuff/ci/${{ env.BUILDER_VERSION }}/linux-container-ci.sh ./linux-container-ci.sh && chmod a+x ./linux-container-ci.sh
./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-alpine-3.16-armv7 build -p ${{ env.PACKAGE_NAME }}
./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-alpine-3.16-arm64 build -p ${{ env.PACKAGE_NAME }}
linux-compiler-compat:
runs-on: ubuntu-24.04 # latest
Expand Down
17 changes: 17 additions & 0 deletions continuous-delivery/build-binaries-linux-musl-arm64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: 0.2
phases:
install:
commands:
build:
commands:
- mkdir linux-arm64-musl
- cd aws-crt-nodejs
- ./continuous-delivery/generic-linux-build.sh aws-crt-alpine-3.16-arm64
- cp -r dist/bin/linux-arm64-musl/* ../linux-arm64-musl/

post_build:
commands:

artifacts:
files:
- 'linux-arm64-musl/**/*'
17 changes: 17 additions & 0 deletions continuous-delivery/generic-linux-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

set -ex

IMAGE_NAME=$1
shift

# Pry the builder version this CRT is using out of ci.yml
BUILDER_VERSION=$(cat .github/workflows/ci.yml | grep 'BUILDER_VERSION:' | sed 's/\s*BUILDER_VERSION:\s*\(.*\)/\1/')
echo "Using builder version ${BUILDER_VERSION}"

aws ecr get-login-password | docker login 123124136734.dkr.ecr.us-east-1.amazonaws.com -u AWS --password-stdin
export DOCKER_IMAGE=123124136734.dkr.ecr.us-east-1.amazonaws.com/${IMAGE_NAME}:${BUILDER_VERSION}

export BRANCH_TAG=$(git describe --tags)
docker run --mount type=bind,src=$(pwd),dst=/root/aws-crt-nodejs --env CXXFLAGS $DOCKER_IMAGE --version=${BUILDER_VERSION} build -p aws-crt-nodejs --branch ${BRANCH_TAG} run_tests=false
docker container prune -f
2 changes: 1 addition & 1 deletion continuous-delivery/pack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ mkdir $UNZIP
tar -xf aws-crt-$CURRENT_TAG.tgz -C $UNZIP
PACK_FILE_SIZE_KB=$(du -sk $UNZIP | awk '{print $1}')
echo "Current package size: ${PACK_FILE_SIZE_KB}"
if expr $PACK_FILE_SIZE_KB \> "$((27000))" ; then
if expr $PACK_FILE_SIZE_KB \> "$((33000))" ; then
# the package size is too large, return -1
echo "Package size is too large!"
exit -1
Expand Down

0 comments on commit b9f731d

Please sign in to comment.