Skip to content

Commit

Permalink
Running tests for arm CI (#792)
Browse files Browse the repository at this point in the history
Co-authored-by: Waqar Ahmed Khan <[email protected]>
  • Loading branch information
TingDaoK and waahm7 authored Jun 13, 2024
1 parent daaea57 commit 262e10f
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 47 deletions.
7 changes: 0 additions & 7 deletions .builder/actions/aws_crt_java_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,3 @@ def run(self, env):
else:
env.shell.exec("mvn", "-P", "continuous-integration",
"-B", "compile", check=True)

parser = argparse.ArgumentParser()
parser.add_argument('--classifier')
args = parser.parse_known_args(env.args.args)[0]
if args.classifier:
env.shell.exec("mvn", "-B", "install", "-DskipTests", "-Dshared-lib.skip=true",
f"-Dcrt.classifier={args.classifier}", check=True)
66 changes: 28 additions & 38 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,25 +81,6 @@ jobs:
chmod a+x builder
./builder build -p ${{ env.PACKAGE_NAME }} --target=linux-${{ matrix.arch }} --spec=downstream
linux-musl:
runs-on: ubuntu-22.04 # latest
strategy:
matrix:
image:
- alpine-3.16-x64
- alpine-3.16-arm64
- openwrt-x64-openjdk8
steps:
- name: Install qemu/docker
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- name: Checkout Sources
uses: actions/checkout@v2
with:
submodules: true
- name: Build ${{ env.PACKAGE_NAME }}
run: |
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-${{ matrix.image }} build -p ${{ env.PACKAGE_NAME }}
linux-fips-x64:
Expand Down Expand Up @@ -137,24 +118,34 @@ jobs:
./builder build -p ${{ env.PACKAGE_NAME }} --target=linux-arm64 --spec=downstream --cmake-extra=-DCRT_FIPS=ON
# armv7 needs its own action due to inability to differentiate at runtime armv6 vs armv7 in the jvm:
#
# At build time we can properly figure out that we're targeting armv7.
# At run time we have to force armv7 (via environment variable) in order to achieve proper resource path
# resolution.
linux-musl-armv7:
runs-on: ubuntu-20.04 # latest
linux-musl-x64:
runs-on: ubuntu-24.04 # latest
strategy:
matrix:
image:
- alpine-3.16-x64
- openwrt-x64-openjdk8
steps:
- name: Build ${{ env.PACKAGE_NAME }}
run: |
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-${{ matrix.image }} build -p ${{ env.PACKAGE_NAME }}
linux-musl-arm:
runs-on: ubuntu-24.04 # latest
strategy:
matrix:
image:
- alpine-3.16-armv7
- alpine-3.16-arm64
steps:
- name: Install qemu/docker
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- name: Checkout Sources
uses: actions/checkout@v2
with:
submodules: true
- name: Build ${{ env.PACKAGE_NAME }}
run: |
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 }} --classifier "armv7"
./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ matrix.image }} build -p ${{ env.PACKAGE_NAME }}
raspberry:
runs-on: ubuntu-22.04 # latest
Expand All @@ -164,13 +155,12 @@ jobs:
image:
- raspbian-bullseye
steps:
# set arm arch
- name: Install qemu/docker
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- name: Build ${{ env.PACKAGE_NAME }}
run: |
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-${{ matrix.image }} build -p ${{ env.PACKAGE_NAME }}
- name: Install qemu/docker
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- name: Build ${{ env.PACKAGE_NAME }}
run: |
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-${{ matrix.image }} build -p ${{ env.PACKAGE_NAME }}
windows:
Expand Down
18 changes: 17 additions & 1 deletion builder.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,23 @@
],
"!test_steps": [
"aws-crt-java-test"
]
],
"!run_tests": true,
"architectures": {
"armv7": {
"_comment": [
"Due to inability to differentiate at runtime armv6 vs armv7 in the jvm",
"At build time we can properly figure out that we're targeting armv7.",
"At run time we have to force armv7 (via environment variable) in order to achieve proper resource path resolution."
],
"+build_env": {
"AWS_CRT_ARCH": "armv7"
},
"+test_env": {
"AWS_CRT_ARCH": "armv7"
}
}
}
},
"openwrt": {
"!packages": []
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/software/amazon/awssdk/crt/CRT.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public static String getArchIdentifier() throws UnknownPlatformException {
return systemPropertyOverride;
}

String environmentOverride = System.getProperty(CRT_ARCH_OVERRIDE_ENVIRONMENT_VARIABLE);
String environmentOverride = System.getenv(CRT_ARCH_OVERRIDE_ENVIRONMENT_VARIABLE);
if (environmentOverride != null && environmentOverride.length() > 0) {
return environmentOverride;
}
Expand Down

0 comments on commit 262e10f

Please sign in to comment.