Skip to content

CI: native arm64 runners, registry buildx cache, drop arm/v7#45

Merged
rick-lam merged 3 commits into
masterfrom
ci-speedup-native-arm64
May 28, 2026
Merged

CI: native arm64 runners, registry buildx cache, drop arm/v7#45
rick-lam merged 3 commits into
masterfrom
ci-speedup-native-arm64

Conversation

@rick-lam
Copy link
Copy Markdown
Contributor

@rick-lam rick-lam commented May 28, 2026

Summary

Three CI-speed-up changes bundled together, motivated by the post-merge build of #44 spending 30–60 min per PHP 8.3+ job under QEMU emulation:

  • Native arm64 runners. Build phase is split per (version, platform). The linux/arm64 slices now run on ubuntu-24.04-arm (free for public repos) instead of going through QEMU on an amd64 runner. amd64 stays on ubuntu-latest. No platform requires QEMU anymore.
  • Registry-backed buildx cache. Each per-arch build reads and writes a per-(version, platform) cache tag (graze/php-alpine:buildcache-VER-SLUG) so subsequent runs reuse layers.
  • Drop linux/arm/v7 everywhere. 32-bit ARM has no common modern PHP deployment target and was the worst case under QEMU. Removing it from all versions (not just 8.3+) eliminates QEMU from the workflow entirely and shrinks the build matrix from a hypothetical 31 to 20 jobs.

Note on tag continuity: Existing published tags (e.g. graze/php-alpine:7.4) already include an arm/v7 manifest entry. After this PR merges, the next push to master republishes those tags as multi-arch manifests without arm/v7. Consumers pulling on a linux/arm/v7 host will get no matching manifest until they pin to an earlier digest.

How the workflow is restructured

  • matrix job emits an expanded build matrix: each versions.json entry's platforms field is split into per-arch tuples with the right runner attached.
  • test job is unchanged — single-arch amd64 build + bats, runs on PRs and pushes.
  • build job runs per (version, platform), pushes by digest (no tag), uploads digest artifact. No QEMU step.
  • New manifest job runs per version on master push only, downloads digests, and uses docker buildx imagetools create to publish multi-arch tags including the 5/7/8/latest/test aliases.

Notes

  • Cache tags (buildcache-*) appear in Docker Hub alongside real tags; can be moved to a separate cache repo later if too noisy.
  • First push after merge rebuilds without cache; speedup compounds from the second push onward.

Test plan

  • PR build runs test for all 12 versions; deploy jobs are skipped on PR.
  • After merge, build matrix produces 20 jobs; arm64 jobs land on ubuntu-24.04-arm.
  • manifest job assembles correct tags incl. :5/:7/:8/:latest/:test aliases.
  • docker manifest inspect graze/php-alpine:8.5 shows amd64 + arm64 only.
  • docker manifest inspect graze/php-alpine:7.4 shows amd64 + arm64 only (no arm/v7).
  • Wall-clock for 8.3/8.4/8.5 drops materially vs the pre-change run.

🤖 Generated with Claude Code

- arm64 jobs run on ubuntu-24.04-arm natively; arm/v7 keeps QEMU but
  only the older versions (7.3-8.2) still target it.
- 8.3-8.5 drop arm/v7 entirely (32-bit ARM has no common modern
  PHP deployment target and is the slowest QEMU build).
- Build phase is now per-(version, platform); a manifest job per
  version assembles the multi-arch tags from per-arch digests via
  `docker buildx imagetools create`.
- Per-(version, platform) registry cache (`buildcache-VER-SLUG`)
  speeds up reruns of the compile-heavy 8.3+ images.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 28, 2026 16:34
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Speeds up the GitHub Actions build by (a) splitting the build job per (version, platform) so arm64 slices can run on native ubuntu-24.04-arm runners instead of QEMU, (b) adding a registry-backed buildx cache keyed per (version, platform), and (c) dropping linux/arm/v7 from PHP 8.3+. The original single multi-arch build step is replaced by a digest-only per-arch build followed by a new manifest job that assembles the final tags with docker buildx imagetools create.

Changes:

  • Restructured build.yml into matrixtestbuild (per arch, digest push) → manifest (per version, tag assembly), with arm64 on native runners and QEMU only for arm/v7.
  • Added per-(version, platform) registry cache tags buildcache-VER-SLUG for both main and test images.
  • Removed linux/arm/v7 from the versions.json entries for 8.3, 8.4, and 8.5.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
versions.json Drops linux/arm/v7 from the 8.3, 8.4, 8.5 platform lists.
.github/workflows/build.yml Splits build per arch onto native runners, adds registry cache, and adds a manifest job that publishes tags via imagetools create from uploaded digest artifacts.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/build.yml
No remaining versions target arm/v7, so QEMU is no longer needed in
the build job — every platform now has a native GitHub-hosted runner
(amd64 → ubuntu-latest, arm64 → ubuntu-24.04-arm).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@rick-lam rick-lam changed the title CI: native arm64 runners, registry buildx cache, drop arm/v7 on 8.3+ CI: native arm64 runners, registry buildx cache, drop arm/v7 May 28, 2026
Copilot review caught that the debug build's `FROM graze/php-alpine:${V}`
would resolve to whatever `:${V}` was currently published (the previous
master build, or nothing for a first-time version deploy) because the
main image is now pushed by digest only. Override the FROM lookup with
the digest we just built so the debug image is always derived from the
matching commit's main image for the same arch.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@rick-lam rick-lam merged commit 7eef2c2 into master May 28, 2026
15 checks passed
@rick-lam rick-lam deleted the ci-speedup-native-arm64 branch May 28, 2026 16:46
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