Skip to content

Boot-test the arm64 images before they get a tag - #22

Draft
michaelaguiar wants to merge 3 commits into
mainfrom
aliasbot/ali-1113-arm64-smoke-test
Draft

michaelaguiar wants to merge 3 commits into
mainfrom
aliasbot/ali-1113-arm64-smoke-test

Conversation

@michaelaguiar

@michaelaguiar michaelaguiar commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

Fixes ALI-1113.

smoke-test.sh booted only the amd64 image of each variant, so an arm64-only break (a missing arm64 package, a bad binary) could still reach -latest. This boots the arm64 images too, before any tag moves.

Changes

  • .github/scripts/smoke-test.sh takes an optional fourth argument, linux/amd64 or linux/arm64. With it, every docker run gets --platform, the image for that platform is pulled first (a failed pull fails the check, unless the reference is a tag that exists locally), and uname -m in the container must match (x86_64 / aarch64). Without it the script behaves as before.
  • frankenphp (base, dev, wordpress, wordpress-dev): the arm64 build legs already run on native ubuntu-24.04-arm runners. Each now boots its image there right after the build-by-digest step, before the digest is uploaded. A failure means no arm64 digest, so the merge job fails at its download step and the floating tags stay where they were. No QEMU is involved.
  • cli (8.3–8.5): build-base builds both platforms under QEMU on amd64. After the amd64 check, it now runs the cli checks again with linux/arm64 under that same QEMU. These are a few short docker runs (php -r, php -m, id, uname) with no server and no timeouts, much lighter than the emulated extension compile the build has already run, so the risk of a spurious failure blocking the weekly tags is small. The step has a 10-minute timeout.
  • A failure in one arm64 frankenphp leg fails that whole build job, so it holds back every version's merge in that job (and the jobs after it), not just its own. A failed build leg already does the same today; it's the same deliberately conservative gating.
  • The amd64 checks in the merge jobs and in build-base now pass linux/amd64, so they check the architecture too.
  • README: the tag paragraph says both architectures are booted.

CI cost

About one extra smoke-test run per arm64 leg, on runners that are already up: roughly 30–60 s for a frankenphp image (one boot plus the three WORDPRESS_VCS_CHECKOUT boots), a few seconds for a cli image under QEMU. The arm64 frankenphp legs run in parallel with the amd64 ones, so the wall-clock cost is about the same.

Testing

  • Ran locally against the published images with linux/amd64 (8.4-frankenphp, 8.4-frankenphp-dev, 8.4-cli) and without a platform: all pass. An unknown platform exits 2 with a usage message.
  • The arm64 paths were not run locally (this machine has no arm64 emulation). The first push to main that rebuilds an image, or a manual run of the workflow, exercises them.
  • actionlint reports nothing new compared with main.

This workflow runs only on pushes to main, the weekly schedule and manual dispatch, so this PR builds and publishes nothing.

If the QEMU check turns out flaky

Remove the Smoke test … (arm64, QEMU) step in build-base. The frankenphp checks don't depend on it.

The smoke test ran on the amd64 image only, so an arm64-only break
could still reach -latest.

- smoke-test.sh takes an optional platform (linux/amd64 or linux/arm64),
  passes it to every docker run and checks uname -m against it.
- The frankenphp build legs boot the arm64 image on their native arm64
  runner before uploading its digest. A failure leaves no arm64 digest,
  so the merge job fails and the tags stay where they were.
- The cli images boot their arm64 image under the QEMU the build
  already uses.
- The amd64 checks pass linux/amd64, so they check the architecture
  too.

Refs ALI-1113
- A failed --platform pre-pull was silenced, so a registry error showed
  up later as a wrong-architecture failure. It now fails the check,
  unless the image exists locally (a local build that was never pushed).
- The extra docker run arguments were an array, which bash before 4.4
  (macOS) treats as unset under set -u when empty, breaking hand runs
  there. A small drun wrapper replaces it.
- The QEMU arm64 cli step gets a 10-minute timeout, so a hung emulated
  run fails quickly instead of at the 6-hour job limit.

Refs ALI-1113
@michaelaguiar

Copy link
Copy Markdown
Member Author

Review round 1 (fresh-context reviewer, code-review high plus a hand check). No P1 or P2.

  • P3, smoke-test.sh: the --platform pre-pull hid its errors, so a registry failure would surface as a wrong-architecture failure. Fixed in b6d0ffa: a failed pull now fails the check, unless the image exists locally.
  • P3, build-and-push.yml: the QEMU arm64 cli step had no timeout, so a hung emulated run would hold the job until the 6-hour limit. Fixed in b6d0ffa (timeout-minutes: 10).
  • P3, smoke-test.sh: an empty argument array under set -u breaks bash before 4.4 (macOS), so hand runs on a Mac would fail. Fixed in b6d0ffa with a small drun wrapper instead of the array. The pre-existing containers array is always non-empty when cleanup runs after a boot, so it's left as is.
  • P3, workflow: an arm64 boot failure shows up in the merge job as a missing digest-…-arm64 artifact. Declined: the arm64 build leg itself fails with the smoke test's message, and the step comment says why the merge job then fails.

Confirmed: the arm64 steps run exactly when the build ran; a failed arm64 test leaves no digest, so the merge job fails and no tag moves (dependent jobs are held back too); the build runners can pull their own digest; the workflow has no pull_request trigger, so this PR publishes nothing.

Re-run locally after the fix (amd64): cli with and without a platform, a local-only image, a missing image (fails with the pull error), and 8.4-frankenphp-wordpress. actionlint and shellcheck report nothing new compared with main.

A digest always names a registry image, and in CI the local copy under
that name is the other architecture's (the amd64 check pulled it), so a
failed arm64 pull fell back to it and reported a wrong architecture
instead of the pull error.

Refs ALI-1113
@michaelaguiar

Copy link
Copy Markdown
Member Author

Review round 2 (fresh-context reviewer; code-review ran on this PR). No P1 or P2. The three round-1 fixes hold (pull failure is fatal, drun keeps every call's argument order, QEMU step timeout).

  • P3, smoke-test.sh: on a failed pull, the local-image fallback could pick up the other architecture's image for a digest reference (the amd64 check pulled it first), so a registry error would read as a wrong-architecture failure. It still failed closed. Fixed in 5aa4fb0: a digest reference never falls back. Re-ran locally: a real digest passes, a missing digest fails with the pull error, a local-only tag still works.
  • P3, README: "booted" for the cli images, which are run-checked rather than served. Declined: main already uses "booted and checked" for the cli images, and the parenthetical says the serving check is for the frankenphp images only.
  • P3, workflow: one arm64 frankenphp failure fails the whole build job, holding back every version's merge. That's how a failed build leg already behaves (conservative on purpose). Added a sentence to the PR description.

Stopping the loop here: the last commit is a two-line guard, tested locally.

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