Skip to content

Commit d32c1b9

Browse files
committed
ci(docker): extend apptainer/nginx/traefik tests to cover arm64
Previously the apptainer/nginx/traefik integration tests only ran against the amd64 artifact, so the arm64 image was validated solely by its build succeeding plus a post-push /_stcore/health probe. Now all three integration matrices fan out over arch=[amd64, arm64] with a matrix-driven runs-on, exercising the read-only-root apptainer contract and both kind-based ingress paths on a native ARM runner too. Changes: - `build-amd64` artifact renamed from `openms-streamlit-<variant>-image` to `openms-streamlit-<variant>-amd64-image` for symmetry. - `build-arm64` now also `load: true`'s the built image, retags to the kind-friendly `openms-streamlit:test`, saves it as a tar, and uploads it as `openms-streamlit-<variant>-arm64-image`. The post-push pull-back smoke test is removed — the new apptainer/ nginx/traefik runs subsume it and avoid the slow GHCR pull. - `test-apptainer`, `test-nginx`, `test-traefik` matrices switched from `variant: [full, simple]` to an `include:` list with {variant, arch, runner} tuples; `runs-on: ${{ matrix.runner }}` selects `ubuntu-latest` for amd64 and `ubuntu-24.04-arm` for arm64. Artifact download names get `${{ matrix.arch }}` interpolated. - SIF upload at the tail of `test-apptainer` gated on `matrix.arch == 'amd64'`: arm64 still runs the full apptainer contract end-to-end, but only amd64 produces the SIF that `publish-apptainer` ships to GHCR (HPC SIF consumers are amd64). Note on `publish-apptainer`: it stays on `needs: test-apptainer`, which now waits for the arm64 matrix entries too — meaning an arm64 apptainer regression will block amd64 SIF publishing. Conservative on purpose; happy to decouple via separate jobs if that turns out to be too strict in practice.
1 parent b0e682e commit d32c1b9

1 file changed

Lines changed: 74 additions & 41 deletions

File tree

.github/workflows/build-and-test.yml

Lines changed: 74 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ jobs:
111111
- name: Upload image artifact
112112
uses: actions/upload-artifact@v4
113113
with:
114-
name: openms-streamlit-${{ matrix.variant }}-image
114+
name: openms-streamlit-${{ matrix.variant }}-amd64-image
115115
path: /tmp/image.tar
116116
retention-days: 1
117117

@@ -121,9 +121,9 @@ jobs:
121121
# under `<ref>-<variant>` by the `create-manifest` job below. The build
122122
# uses a separate `Dockerfile.arm` / `Dockerfile_simple.arm` that swaps
123123
# the miniforge installer to aarch64 and (for the full variant) guards
124-
# the THIRDPARTY/Linux/aarch64 copy. Apptainer/nginx/traefik integration
125-
# tests still run only on the amd64 artifact — those gates do not need
126-
# arch duplication right now (HPC consumers of the SIF are amd64).
124+
# the THIRDPARTY/Linux/aarch64 copy. The built image is also uploaded as
125+
# an artifact so the apptainer / nginx / traefik integration jobs can
126+
# exercise the ARM image on a native ARM runner (matrix arch=arm64).
127127
needs: lint-manifests
128128
runs-on: ubuntu-24.04-arm
129129
permissions:
@@ -180,6 +180,7 @@ jobs:
180180
context: .
181181
file: ${{ matrix.dockerfile }}
182182
platforms: linux/arm64
183+
load: true
183184
push: ${{ github.event_name != 'pull_request' }}
184185
tags: ${{ steps.meta.outputs.tags }}
185186
labels: ${{ steps.meta.outputs.labels }}
@@ -189,30 +190,22 @@ jobs:
189190
build-args: |
190191
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
191192
192-
- name: Smoke test the just-pushed arm64 image
193-
# PRs build (validates Dockerfile.arm parses + compiles) but don't
194-
# push, so there's nothing to pull back on PR events. On push/tag,
195-
# pull the just-published image and verify /_stcore/health to catch
196-
# entrypoint regressions that wouldn't surface in the build itself.
197-
if: github.event_name != 'pull_request'
193+
- name: Retag for kind (stable local tag)
198194
run: |
199-
set -euo pipefail
200-
IMAGE_REF="${{ env.REGISTRY }}/${{ env.IMAGE_NAME_LC }}:${{ github.sha }}-${{ matrix.variant }}-arm64"
201-
echo "Smoke-testing $IMAGE_REF"
202-
docker pull "$IMAGE_REF"
203-
docker run -d --rm --name smoketest -p 8501:8501 "$IMAGE_REF"
204-
for i in $(seq 1 90); do
205-
if curl -fsSo /dev/null --max-time 2 http://127.0.0.1:8501/_stcore/health; then
206-
echo "Streamlit healthy after ${i} attempts"
207-
docker stop smoketest
208-
exit 0
209-
fi
210-
sleep 2
211-
done
212-
echo "ERROR: /_stcore/health never returned 200"
213-
docker logs smoketest || true
214-
docker stop smoketest || true
215-
exit 1
195+
# load:true above loaded all meta-action tags into local docker.
196+
# Retag the first one to the stable name the kustomize overlay expects.
197+
FIRST_TAG=$(printf '%s\n' "${{ steps.meta.outputs.tags }}" | head -n 1)
198+
docker tag "$FIRST_TAG" openms-streamlit:test
199+
200+
- name: Save image as tar
201+
run: docker save openms-streamlit:test -o /tmp/image.tar
202+
203+
- name: Upload image artifact
204+
uses: actions/upload-artifact@v4
205+
with:
206+
name: openms-streamlit-${{ matrix.variant }}-arm64-image
207+
path: /tmp/image.tar
208+
retention-days: 1
216209

217210
create-manifest:
218211
# Stitch the per-arch tags into multi-arch manifest lists. The manifest
@@ -282,19 +275,31 @@ jobs:
282275
# (not root inside the image). The entrypoint must tolerate both: this job
283276
# exercises that contract by running the built image under apptainer and
284277
# waiting for the streamlit /_stcore/health endpoint to come up.
285-
needs: build-amd64
286-
runs-on: ubuntu-latest
278+
needs: [build-amd64, build-arm64]
279+
runs-on: ${{ matrix.runner }}
287280
strategy:
288281
fail-fast: false
289282
matrix:
290-
variant: [full, simple]
283+
include:
284+
- variant: full
285+
arch: amd64
286+
runner: ubuntu-latest
287+
- variant: full
288+
arch: arm64
289+
runner: ubuntu-24.04-arm
290+
- variant: simple
291+
arch: amd64
292+
runner: ubuntu-latest
293+
- variant: simple
294+
arch: arm64
295+
runner: ubuntu-24.04-arm
291296
steps:
292297
- uses: actions/checkout@v4
293298

294299
- name: Download image artifact
295300
uses: actions/download-artifact@v4
296301
with:
297-
name: openms-streamlit-${{ matrix.variant }}-image
302+
name: openms-streamlit-${{ matrix.variant }}-${{ matrix.arch }}-image
298303
path: /tmp
299304

300305
- name: Install apptainer
@@ -424,8 +429,12 @@ jobs:
424429
if: always()
425430
run: apptainer instance stop openms-test || true
426431

427-
- name: Upload validated SIF artifact (push events only)
428-
if: success() && github.event_name != 'pull_request'
432+
- name: Upload validated SIF artifact (amd64 push events only)
433+
# SIF publishing stays amd64-only this iteration (HPC consumers of
434+
# the SIF are amd64). The arm64 matrix entry still exercises the
435+
# full apptainer contract end-to-end; it just doesn't upload the
436+
# resulting SIF for downstream publishing.
437+
if: success() && github.event_name != 'pull_request' && matrix.arch == 'amd64'
429438
uses: actions/upload-artifact@v4
430439
with:
431440
name: openms-streamlit-${{ matrix.variant }}-sif
@@ -500,19 +509,31 @@ jobs:
500509
done <<< "${{ steps.meta.outputs.tags }}"
501510
502511
test-nginx:
503-
needs: build-amd64
504-
runs-on: ubuntu-latest
512+
needs: [build-amd64, build-arm64]
513+
runs-on: ${{ matrix.runner }}
505514
strategy:
506515
fail-fast: false
507516
matrix:
508-
variant: [full, simple]
517+
include:
518+
- variant: full
519+
arch: amd64
520+
runner: ubuntu-latest
521+
- variant: full
522+
arch: arm64
523+
runner: ubuntu-24.04-arm
524+
- variant: simple
525+
arch: amd64
526+
runner: ubuntu-latest
527+
- variant: simple
528+
arch: arm64
529+
runner: ubuntu-24.04-arm
509530
steps:
510531
- uses: actions/checkout@v4
511532

512533
- name: Download image artifact
513534
uses: actions/download-artifact@v4
514535
with:
515-
name: openms-streamlit-${{ matrix.variant }}-image
536+
name: openms-streamlit-${{ matrix.variant }}-${{ matrix.arch }}-image
516537
path: /tmp
517538

518539
- name: Load image into local docker
@@ -587,19 +608,31 @@ jobs:
587608
done
588609
589610
test-traefik:
590-
needs: build-amd64
591-
runs-on: ubuntu-latest
611+
needs: [build-amd64, build-arm64]
612+
runs-on: ${{ matrix.runner }}
592613
strategy:
593614
fail-fast: false
594615
matrix:
595-
variant: [full, simple]
616+
include:
617+
- variant: full
618+
arch: amd64
619+
runner: ubuntu-latest
620+
- variant: full
621+
arch: arm64
622+
runner: ubuntu-24.04-arm
623+
- variant: simple
624+
arch: amd64
625+
runner: ubuntu-latest
626+
- variant: simple
627+
arch: arm64
628+
runner: ubuntu-24.04-arm
596629
steps:
597630
- uses: actions/checkout@v4
598631

599632
- name: Download image artifact
600633
uses: actions/download-artifact@v4
601634
with:
602-
name: openms-streamlit-${{ matrix.variant }}-image
635+
name: openms-streamlit-${{ matrix.variant }}-${{ matrix.arch }}-image
603636
path: /tmp
604637

605638
- name: Load image into local docker

0 commit comments

Comments
 (0)