Skip to content

ci(release): build each image arch on a native runner - #309

Merged
Andrei Kvapil (kvaps) merged 1 commit into
mainfrom
ci/native-arm64-runners
Nov 23, 2026
Merged

Andrei Kvapil (kvaps) merged 1 commit into
mainfrom
ci/native-arm64-runners

Conversation

@kvaps

@kvaps Andrei Kvapil (kvaps) commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

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 install from 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 on ubuntu-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 create with the same metadata-action rules as before, so the tags don't change: 0.4.0-alpha.N and v0.4.0-alpha.N for a pre-release, plus X.Y and latest for 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 latest handling is unchanged.

Workflow-level permissions are now empty. Build and merge jobs get contents: read and packages: write, and the release job keeps contents: write.

Dry run

workflow_dispatch on 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

  • actionlint is clean on the changed workflow.
  • Dry run on this branch: https://github.com/cozystack/blockstor/actions/runs/45011858935. All six builds passed, every merge job reported 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 inspect on 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

  • Release Process
    • Release images are now built separately for Linux AMD64 and ARM64, then combined into multi-architecture images.
    • Branch runs build and upload image artifacts without publishing indexes; GitHub Releases run only for tagged releases.
    • Published image indexes are verified to contain both supported architectures.

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>
@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The release workflow now builds each image target separately for linux/amd64 and linux/arm64, then merges the resulting digests into multi-architecture indexes. Non-tag runs use dry-run index creation. GitHub Releases run only for tags after the merge jobs complete.

Changes: Release workflow

Layer / File(s) Summary
Native per-platform builds
.github/workflows/release.yml
The build matrix covers three image targets and two platforms, using a native runner for each platform. Each build pushes by digest and uploads a target-and-platform artifact.
Index merging and release gating
.github/workflows/release.yml
Per-target merge jobs apply tags and annotations, create or dry-run indexes, and verify that each index contains exactly linux/amd64,linux/arm64. GitHub Releases depend on the merge jobs and run only for tags.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Other

Sequence Diagram(s)

sequenceDiagram
  participant BuildMatrix
  participant DigestArtifacts
  participant MergeJobs
  participant GitHubRelease
  BuildMatrix->>DigestArtifacts: Upload target-and-platform digest artifacts
  DigestArtifacts->>MergeJobs: Supply digests for each target
  MergeJobs->>MergeJobs: Create or dry-run indexes and verify platforms
  MergeJobs->>GitHubRelease: Complete dependencies for tag releases
Loading

Possibly related PRs

Merge Risk: Minimal · up to f0d39

The release workflow now builds each architecture natively and merges the results into multi-architecture images. No concrete merge-blocking issue was found. The tag-publication path will first run on the next tag release.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "ci(release): build each image arch on a native runner" matches the main change. The release workflow now builds each linux/amd64 and linux/arm64 image on a native runner instead of using a …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "ci(release): build each image arch on a native runner" matches the main change. The release workflow now builds each linux/amd64 and linux/arm64 image on a native runner instead of using a single runner with QEMU emulation. The title is short, specific, and uses a conventional commit scope. It does not mention the digest merge or the multi-architecture index step, but those are secondary to the core change.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 03591400-23b3-4db9-88a2-124ced895b60
Commits

Reviewing files that changed from the base of the PR and between 216e577 and f0d39a2.

Files selected for processing: 1

  • .github/workflows/release.yml

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@kvaps
Andrei Kvapil (kvaps) merged commit 1e095f3 into main Nov 23, 2026
26 checks passed
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.

2 participants