Light, fluffy, and always free - The AWS Local Emulator alternative
perf(build): keep only the snappy JNI libraries the image will use (#2940)
TATSUNO “Taz” Yasuhiro4ce53b51d65c
diff --git a/.github/workflows/compatibility.yml b/.github/workflows/compatibility.ymlindex 5439837293..d1f6e0d3f5 100644--- a/.github/workflows/compatibility.yml+++ b/.github/workflows/compatibility.yml@@ -103,9 +103,20 @@ jobs:run: python3 .github/ci/compat-opentofu-drift-check.pybuild-native:- name: Build native floci image- runs-on: ubuntu-24.04-arm+ name: Build native floci image (${{ matrix.arch }})+ runs-on: ${{ matrix.runner }}timeout-minutes: 30+ # Both published architectures. The native image is the only place an+ # arch-specific resource can go missing (snappy-java's JNI library is+ # registered per platform), and one arch cannot prove the other.+ strategy:+ fail-fast: false+ matrix:+ include:+ - arch: arm64+ runner: ubuntu-24.04-arm+ - arch: amd64+ runner: ubuntu-lateststeps:- uses: actions/[email protected]@@ -125,7 +136,7 @@ jobs:# reads the ~/.m2 that ci.yml's shard 1 saves on every push to main. ci.yml# stays the single owner of the save; a second writer would just race it.# Two known partial-hit caveats, both cheap: `runner.os` is Linux for both- # but ci.yml runs x64 while this runs arm64 (Maven artifacts are+ # but ci.yml runs x64 while the arm64 leg here does not (Maven artifacts are# arch-neutral, so only classifier-based natives re-download), and# `-Dnative` pulls native-image plugins that ci.yml's `mvn test` never# fetches. Expect most of the ~66s of cold resolution back, not all of it.@@ -140,10 +151,10 @@ jobs:- name: Stage native binary for packagingrun: |- mkdir -p native/arm64- cp target/*-runner native/arm64/application+ mkdir -p native/${{ matrix.arch }}+ cp target/*-runner native/${{ matrix.arch }}/application# include any sidecar .so the runtime image may need (matches nightly artifact set)- cp target/*.so native/arm64/ 2>/dev/null || true+ cp target/*.so native/${{ matrix.arch }}/ 2>/dev/null || true- uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4.3.0@@ -169,18 +180,21 @@ jobs:- name: Upload native floci imageuses: actions/upload-artifact@v7with:- name: floci-native-image+ name: floci-native-image-${{ matrix.arch }}path: /tmp/floci-native-image.tar.gzretention-days: 1native-compat-test:- name: native / ${{ matrix.test }}+ name: native ${{ matrix.arch }} / ${{ matrix.test }}needs: build-native- runs-on: ubuntu-24.04-arm+ runs-on: ${{ matrix.runner }}timeout-minutes: 20strategy:fail-fast: falsematrix:+ arch:+ - arm64+ - amd64test:- sdk-test-node- sdk-test-python@@ -190,12 +204,17 @@ jobs:- compat-cdk- compat-terraform- compat-opentofu+ include:+ - arch: arm64+ runner: ubuntu-24.04-arm+ - arch: amd64+ runner: ubuntu-lateststeps:- name: Download native floci imageuses: actions/download-artifact@v8with:- name: floci-native-image+ name: floci-native-image-${{ matrix.arch }}path: /tmp- name: Load native floci imagediff --git a/src/main/resources/application.yml b/src/main/resources/application.ymlindex bcd6070cb4..bd2bd25201 100644--- a/src/main/resources/application.yml+++ b/src/main/resources/application.yml@@ -40,6 +40,27 @@ quarkus:- iam/*.yaml- i18n/*.properties- org/apache/velocity/runtime/defaults/*.properties+ # snappy-java registers 27 JNI libraries, one per platform. Only the one+ # for the running platform loads, so 23 are dropped. Linux x86_64 and+ # aarch64 cover the published images, Mac covers a local native build.+ excludes:+ - org/xerial/snappy/native/AIX/**+ - org/xerial/snappy/native/FreeBSD/**+ - org/xerial/snappy/native/SunOS/**+ - org/xerial/snappy/native/Windows/**+ - org/xerial/snappy/native/Linux/android-aarch64/**+ - org/xerial/snappy/native/Linux/android-arm/**+ - org/xerial/snappy/native/Linux/arm/**+ - org/xerial/snappy/native/Linux/armv6/**+ - org/xerial/snappy/native/Linux/armv7/**+ - org/xerial/snappy/native/Linux/loongarch64/**+ - org/xerial/snappy/native/Linux/ppc/**+ - org/xerial/snappy/native/Linux/ppc64/**+ - org/xerial/snappy/native/Linux/ppc64le/**+ - org/xerial/snappy/native/Linux/riscv64/**+ - org/xerial/snappy/native/Linux/s390x/**+ - org/xerial/snappy/native/Linux/x86/**+ - org/xerial/snappy/native/Linux/x86_64-musl/**additional-build-args:- --report-unsupported-elements-at-runtime- --allow-incomplete-classpath