Repository navigation
ci(release): build each image arch on a native runner - #309
Conversation
The arm64 leg of every image was built under QEMU on an amd64 runner, so the satellite's debian apt install ran emulated and each release job spent most of its 7 to 11 minutes on the slow arch. Build every (image, arch) pair on a runner of that arch instead, push it by digest, and let a per-image merge job tag the multi-arch index with the same tags and metadata as before. The merge refuses to finish unless both linux/amd64 and linux/arm64 are in the index, so a missing arch fails the release rather than shipping silently. A run on a branch is a dry run: it builds and pushes by digest but writes no tag and cuts no GitHub Release, so the pipeline can be exercised before the next tag. Assisted-by: LLM Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Aleksei Sviridkin (lexfrei)
left a comment
There was a problem hiding this comment.
Checked the pins and permissions: every action SHA matches its tagged release, the workflow default is now empty and each job asks only for what it uses. Script inputs go through env, the tag rules are unchanged, and the platform check on the index closes the one-arch release gap. LGTM.
What and why
The Release Images workflow built each image for both architectures in one job on an amd64 runner, with the arm64 half running under QEMU. The satellite stage runs
apt-get installfrom Debian, so its arm64 half was fully emulated, and a release took 7 to 11 minutes end to end.Now each (image, architecture) pair builds on a runner of that architecture: linux/amd64 on
ubuntu-latest, linux/arm64 onubuntu-24.04-arm. GitHub provides arm64 hosted runners free for public repositories, so no self-hosted runner is involved. QEMU setup is gone.How the merge works
Each of the six build jobs pushes its image by digest only, with no tag, and uploads the digest as an artifact. A merge job per image then downloads both digests and runs
docker buildx imagetools createwith the same metadata-action rules as before, so the tags don't change:0.4.0-alpha.Nandv0.4.0-alpha.Nfor a pre-release, plusX.Yandlatestfor a stable tag. Labels stay on the per-arch images, and the OCI metadata also goes onto the index as annotations.After creating the index, the merge job inspects it and fails unless both linux/amd64 and linux/arm64 are there. A release can no longer ship with one architecture missing.
The GitHub Release job now waits for all three merge jobs. Pre-release and
latesthandling is unchanged.Workflow-level permissions are now empty. Build and merge jobs get
contents: readandpackages: write, and the release job keepscontents: write.Dry run
workflow_dispatchon a branch, not a tag, is now a dry run. The per-arch images are built and pushed by digest, so the full pipeline runs, but the merge job only prints the index it would create and checks its platforms, no tag is written, and no GitHub Release is cut. Dispatching on a tag still republishes as before.Testing
actionlintis clean on the changed workflow.index platforms: linux/amd64,linux/arm64, and the release job was skipped. It took 4m22s, against 7 to 11 minutes for the last five tag releases.Not tested
The real publish path (tagging the index,
imagetools inspecton the pushed tag, cutting the GitHub Release) only runs on a tag, so it gets its first run on the next tag. The dry run did push untagged per-arch manifests to the three ghcr.io packages. They're harmless, but they show up as untagged versions.Summary by CodeRabbit