Files
floci/.github/workflows/compat-partitions.yml
T
Hector Ventura 3bf5e2a5f9 chore(ci): check the amd64 native image after each Nightly, not on every pull request (#8959)
* chore(ci): check the amd64 native image after each Nightly, not on every pull request

compatibility.yml built the amd64 native image on every pull request (7 to 9 minutes in the last five green runs) to run one 2-minute suite, sdk-test-python, whose Firehose compression delivery test needs the x86_64 snappy JNI library. Pull requests now build and test arm64 only. compat-partitions.yml, which already runs after each Nightly against the published floci/floci:nightly image, gains an amd64 sdk-test-python job in the commercial partition, so the amd64 half of the multi-arch image is still checked once a day, against the image users pull.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

* chore(ci): keep the amd64 job's test results, and skip it on a single-region dispatch

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

---------

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-11-19 17:06:52 -06:00

282 lines
11 KiB
YAML

name: Partition Compatibility
# The Java SDK suite against a Floci deployed in a non-commercial partition, so
# the SDK's own partition logic (arn:aws-cn: ARNs, China signing scopes, the
# LocationConstraint S3 CreateBucket sends) has to round-trip end to end. One leg
# per partition family: China, GovCloud and EUSC. Part of #4272.
#
# Runs after each Nightly against the image it just published, not per PR: it
# is three more ~15 minute native suites, and the per-PR legs already queue for
# the shared runner pools (see compatibility.yml). Known failures live in
# .github/ci/compat-partition-allowlist-<region>.txt (a region without one has
# none); a failure missing from it, or an entry that no longer fails, fails the
# run, so the list only shrinks.
on:
workflow_run:
workflows: [Nightly]
types: [completed]
workflow_dispatch:
inputs:
image:
description: Floci image to test
default: floci/floci:nightly
region:
description: Run this one region only (any region Floci serves); blank runs every nightly leg
default: ''
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
sdk-test-java:
name: sdk-test-java / ${{ matrix.region }}
if: >-
!github.event.repository.fork
&& (github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success')
runs-on: ubuntu-24.04-arm
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
# One region per partition family that takes its own code path: China (IAM signs
# cn-north-1), GovCloud (IAM signs us-gov-west-1, no CloudFront) and EUSC (no global
# endpoints at all). A dispatch that names a region runs that region alone.
region: ${{ fromJSON(inputs.region && format('["{0}"]', inputs.region) || '["cn-north-1", "us-gov-west-1", "eusc-de-east-1"]') }}
env:
IMAGE: ${{ inputs.image || 'floci/floci:nightly' }}
REGION: ${{ matrix.region }}
steps:
# The tag is mutable, so the suite and allowlist are checked out at the commit this exact
# image was built from (its OCI revision label, which Nightly sets), never a guessed one.
- name: Pull the image and read the commit it was built from
id: image
run: |
docker pull "$IMAGE"
revision=$(docker inspect -f '{{ index .Config.Labels "org.opencontainers.image.revision" }}' "$IMAGE")
if [ -z "$revision" ] || [ "$revision" = "<no value>" ]; then
echo "::error::$IMAGE has no org.opencontainers.image.revision label to match the tests to"
exit 1
fi
echo "revision=$revision" >> "$GITHUB_OUTPUT"
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ steps.image.outputs.revision }}
sparse-checkout: |
compatibility-tests
.github/ci
- name: Create Docker network
run: docker network create compat-net
- name: Start floci
run: |
DOCKER_GID=$(stat -c '%g' /var/run/docker.sock)
docker run -d --name floci --network compat-net \
-p 4566:4566 \
-v /var/run/docker.sock:/var/run/docker.sock \
--group-add "$DOCKER_GID" \
-e FLOCI_DEFAULT_REGION="$REGION" \
-e FLOCI_BASE_URL=http://floci:4566 \
-e FLOCI_SERVICES_DOCKER_NETWORK=compat-net \
-e FLOCI_HOSTNAME=floci \
-e FLOCI_SERVICES_IOT_MQTT_ENABLED=true \
-e FLOCI_SERVICES_LAMBDA_HOT_RELOAD_ENABLED=true \
-e FLOCI_TLS_ENABLED=true \
-e FLOCI_SERVICES_STEPFUNCTIONS_ALLOW_PLAINTEXT_HTTP=true \
-e FLOCI_SERVICES_EC2_MOCK=true \
-e FLOCI_SERVICES_REDSHIFT_ENDPOINT_HOST=floci \
-e FLOCI_SERVICES_RDS_ENDPOINT_HOST=floci \
-e FLOCI_SERVICES_SSOOIDC_LOCAL_PRINCIPAL_ID=11111111-2222-3333-4444-555555555555 \
"$IMAGE"
- name: Wait for floci to be healthy
run: |
health=starting
for _ in $(seq 1 60); do
health=$(docker inspect -f '{{.State.Health.Status}}' floci)
if [ "$health" = healthy ]; then
exit 0
fi
if [ "$health" = unhealthy ]; then
break
fi
sleep 1
done
echo "::error::floci did not report healthy (last status: $health)"
docker logs --tail 50 floci
exit 1
- uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
- name: Build test image
uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
with:
context: compatibility-tests/sdk-test-java
load: true
tags: compat-sdk-test-java
cache-from: type=gha,scope=sdk-test-java
# The suite's exit status is not the verdict here: the allowlist check below is.
- name: Run tests
id: tests
continue-on-error: true
run: |
mkdir -p test-results /tmp/floci-hot-reload
FLOCI_IP=$(docker inspect -f '{{(index .NetworkSettings.Networks "compat-net").IPAddress}}' floci)
docker run --rm --network compat-net \
--dns "${FLOCI_IP}" \
-e AWS_REGION="$REGION" \
-e FLOCI_ENDPOINT=http://floci:4566 \
-e FLOCI_S3_VHOST_ENDPOINT=http://floci:4566 \
-e HOT_RELOAD_BASE_DIR=/tmp/floci-hot-reload \
-v /tmp/floci-hot-reload:/tmp/floci-hot-reload \
-v "$(pwd)/test-results:/results" \
compat-sdk-test-java
# Maven exits non-zero for the allowlisted failures too, so its status cannot tell a
# finished run from an aborted one; the checker requires a report for every test class.
- name: Compare failures with the allowlist
run: >-
python3 .github/ci/compat-allowlist-check.py test-results
".github/ci/compat-partition-allowlist-$REGION.txt"
--test-sources compatibility-tests/sdk-test-java/src/test/java
- name: Generate test summary
if: always()
uses: test-summary/action@37b508cfee6d4d080eedd00b5bb240a6a784a6a5 # v2
with:
paths: test-results/*.xml
- name: Upload test results
if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: compat-partition-results-${{ env.REGION }}
path: test-results/
if-no-files-found: warn
- name: Dump floci logs
if: failure() || cancelled()
run: docker logs --tail 300 floci
# The amd64 half of the published image, which compatibility.yml no longer builds per pull request:
# the native image is where an arch-specific resource can go missing (snappy-java's JNI library is
# registered per platform), so the x86_64 nightly image runs sdk-test-python, whose Firehose
# compression delivery test needs that library, in the commercial partition on an amd64 runner.
sdk-test-python-amd64:
name: sdk-test-python / amd64
# A dispatch that names a region is about that partition alone, so it skips this job.
if: >-
!github.event.repository.fork
&& ((github.event_name == 'workflow_dispatch' && !inputs.region)
|| github.event.workflow_run.conclusion == 'success')
runs-on: ubuntu-latest
timeout-minutes: 20
env:
IMAGE: ${{ inputs.image || 'floci/floci:nightly' }}
steps:
- name: Pull the image and read the commit it was built from
id: image
run: |
docker pull --platform linux/amd64 "$IMAGE"
revision=$(docker inspect -f '{{ index .Config.Labels "org.opencontainers.image.revision" }}' "$IMAGE")
if [ -z "$revision" ] || [ "$revision" = "<no value>" ]; then
echo "::error::$IMAGE has no org.opencontainers.image.revision label to match the tests to"
exit 1
fi
echo "revision=$revision" >> "$GITHUB_OUTPUT"
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ steps.image.outputs.revision }}
sparse-checkout: |
compatibility-tests
- name: Create Docker network
run: docker network create compat-net
- name: Start floci
run: |
DOCKER_GID=$(stat -c '%g' /var/run/docker.sock)
docker run -d --name floci --network compat-net \
-p 4566:4566 \
-v /var/run/docker.sock:/var/run/docker.sock \
--group-add "$DOCKER_GID" \
-e FLOCI_BASE_URL=http://floci:4566 \
-e FLOCI_SERVICES_DOCKER_NETWORK=compat-net \
-e FLOCI_HOSTNAME=floci \
-e FLOCI_SERVICES_IOT_MQTT_ENABLED=true \
-e FLOCI_SERVICES_LAMBDA_HOT_RELOAD_ENABLED=true \
-e FLOCI_TLS_ENABLED=true \
-e FLOCI_SERVICES_EC2_MOCK=true \
-e FLOCI_SERVICES_REDSHIFT_ENDPOINT_HOST=floci \
-e FLOCI_SERVICES_RDS_ENDPOINT_HOST=floci \
-e FLOCI_SERVICES_SSOOIDC_LOCAL_PRINCIPAL_ID=11111111-2222-3333-4444-555555555555 \
"$IMAGE"
- name: Wait for floci to be healthy
run: |
health=starting
for _ in $(seq 1 60); do
health=$(docker inspect -f '{{.State.Health.Status}}' floci)
if [ "$health" = healthy ]; then
exit 0
fi
if [ "$health" = unhealthy ]; then
break
fi
sleep 1
done
echo "::error::floci did not report healthy (last status: $health)"
docker logs --tail 50 floci
exit 1
- uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
- name: Build test image
uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
with:
context: compatibility-tests/sdk-test-python
load: true
tags: compat-sdk-test-python
cache-from: type=gha,scope=sdk-test-python
- name: Run tests
run: |
mkdir -p test-results
FLOCI_IP=$(docker inspect -f '{{(index .NetworkSettings.Networks "compat-net").IPAddress}}' floci)
docker run --rm --network compat-net \
--dns "${FLOCI_IP}" \
-e FLOCI_ENDPOINT=http://floci:4566 \
-e FLOCI_S3_VHOST_ENDPOINT=http://floci:4566 \
-v "$(pwd)/test-results:/results" \
compat-sdk-test-python
- name: Generate test summary
if: always()
uses: test-summary/action@37b508cfee6d4d080eedd00b5bb240a6a784a6a5 # v2
with:
paths: test-results/*.xml
- name: Upload test results
if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: compat-amd64-results
path: test-results/
if-no-files-found: warn
- name: Dump floci logs
if: failure() || cancelled()
run: docker logs --tail 300 floci