ci: build multi-arch image on native runners instead of QEMU (fixes slow releases) - #7
Merged
Merged
Conversation
The release build spent ~14 min almost entirely in "Build and push" because the linux/arm64 half ran under QEMU emulation on an amd64 runner, where npm ci + next build are several times slower. Rework release.yml into the build-by-digest + merge-manifest pattern: each architecture builds on its own native runner (amd64 on ubuntu-latest, arm64 on ubuntu-24.04-arm — free for public repos) and pushes by digest, then a merge job assembles the multi-arch manifest with the same tag set as before. Both arches build in parallel, so no emulation and a few minutes each instead of ~14. Also add a per-ref concurrency group with cancel-in-progress so a stalled or superseded build (one run sat for 224 min before being cancelled) can't pile up; keyed by ref so a release's :edge (main) and semver (tag) builds don't cancel each other. The published tags (:main, :edge, :X.Y.Z, :X.Y, :X, :latest) and the workflow_dispatch entrypoint used by version-bump.yml are unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ST7p7inT3agkLEp8qbPSC6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Release runs were taking ~14 minutes, almost entirely in the single "Build and push" step. Root cause: the build produced
linux/amd64andlinux/arm64in one job, and the arm64 half ran under QEMU emulation on an amd64 runner — wherenpm ci+next buildare several times slower. Emulation was essentially the whole build time.Fix — build each arch natively, then merge manifests (the standard
docker/build-push-actionmulti-arch pattern):buildjob runs as a matrix:linux/amd64onubuntu-latest,linux/arm64onubuntu-24.04-arm(GitHub-hosted arm64 runners, free for public repos). Each pushes its image by digest (no tag yet).mergejob downloads the per-arch digests and assembles one multi-arch manifest withdocker buildx imagetools create, using the same tag set as before.Also: added a per-ref
concurrencygroup withcancel-in-progress, so a stalled or superseded build can't pile up (the history had a run stuck for 224 minutes before being cancelled). It's keyed bygithub.refso a release's:edgebuild (onmain) and its semver build (on thevX.Y.Ztag) — different refs — never cancel each other.Unchanged (contract preserved)
:main,:edge,:X.Y.Z,:X.Y,:X,:latest.workflow_dispatchentrypoint thatversion-bump.ymlcalls (gh workflow run release.yml --ref vX.Y.Z).linux/amd64andlinux/arm64, sodocs/self-hosting.md's promise holds.Test plan
needs, concurrency, triggers).release.ymlrun: both matrix legs build on their native runners (no QEMU step), themergejob pushes the manifest, anddocker buildx imagetools inspect ghcr.io/veniplex/study-helper:<version>shows bothamd64andarm64. Compare wall-clock against the previous ~14 min.Generated by Claude Code