Skip to content

ci(docker): build :jupyter per-arch on native runners in parallel (no QEMU) - #392

Merged
JanLahmann merged 2 commits into
mainfrom
ci/docker-native-arch-matrix
Jul 13, 2026
Merged

ci(docker): build :jupyter per-arch on native runners in parallel (no QEMU)#392
JanLahmann merged 2 commits into
mainfrom
ci/docker-native-arch-matrix

Conversation

@JanLahmann

Copy link
Copy Markdown
Owner

Replaces the emulated multi-arch :jupyter build with a native per-arch matrix. Follow-up to the arm64 npm ci timeout that flaked the build earlier.

Design

  • build matrix — amd64 on ubuntu-24.04, arm64 on GitHub's native ubuntu-24.04-arm runner, in parallel. Each pushes its single-arch image by digest (push-by-digest, no tag) and uploads the digest as an artifact. Per-arch gha cache scopes.
  • merge — downloads the digests and stitches them into the multi-arch tags via docker buildx imagetools create (no rebuild).

Measured (validated on branch, run 29236350266, cold cache)

Job Duration
build amd64 (native) 17.2 min
build arm64 (native) 12.8 min
merge 0.3 min
Wall (parallel) ~17.6 min

Previous emulated build: ~23 min. So ~24% faster cold — the honest, modest part. The bigger wins:

  • No QEMU → eliminates the arm64 emulation flakiness (the npm ci timeout that caused the original failure).
  • arm64 is now native (12.8 min, reliable) vs 20+ min emulated.
  • Per-arch caches are now seeded, so warm-cache runs should be faster (not yet measured — not claiming a number).
  • The ~3 GB Qiskit pip install dominates and is inherently slow cold; native/parallel only helps so much.

Triggers, path filter, concurrency, and the published tags (:jupyter + <sha>-jupyter) are unchanged. Includes a lowercase-ref fix (github.repository is mixed-case; the raw ref in outputs/imagetools must be lowercased, unlike metadata-action's auto-lowercased tags).

🤖 Generated with Claude Code

JanLahmann and others added 2 commits July 13, 2026 10:26
… QEMU)

The multi-arch :jupyter build ran amd64 natively but arm64 under QEMU emulation
— every RUN in the arm64 image (npm, the ~3 GB Qiskit/pip stack) ran ~5-15x
slower, pushing the build to ~23 min and causing the earlier flaky arm64 npm ci
timeout.

Convert to the canonical multi-runner pattern:
- A `build` matrix runs each arch on its OWN native runner IN PARALLEL —
  amd64 on ubuntu-24.04, arm64 on GitHub's native ubuntu-24.04-arm (no
  emulation). Each pushes its single-arch image BY DIGEST (push-by-digest, no
  tag) and uploads the digest as an artifact. Per-arch gha cache scopes.
- A `merge` job (needs: build) downloads the digests and stitches them into the
  multi-arch tags via `docker buildx imagetools create` — no rebuild, ~1 min.

Wall-clock drops from ~23 min (sequential-ish, emulated) to ~the slower native
single-arch build (~5-8 min) + a short merge, and removes the emulation
fragility. Triggers, path filter, concurrency, and tags (:jupyter + <sha>-jupyter)
are unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EiX6E2FzqdLnr8NdysKHP5
The matrix build failed: `invalid reference format: repository name
(JanLahmann/doQumentation) must be lowercase`. github.repository is mixed-case,
and unlike metadata-action's tag output (auto-lowercased), the raw ref used in
the build `outputs` and the merge `imagetools` commands is not. Add a per-job
step that lowercases it (${IMAGE_NAME,,}) and reference that everywhere a raw
docker ref is needed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EiX6E2FzqdLnr8NdysKHP5
@JanLahmann
JanLahmann merged commit 5eab6ca into main Jul 13, 2026
4 checks passed
@JanLahmann
JanLahmann deleted the ci/docker-native-arch-matrix branch July 13, 2026 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant