feat: opt-in multi-arch builds in component-build [ENERGY-2009]#317
feat: opt-in multi-arch builds in component-build [ENERGY-2009]#317ckattmann wants to merge 1 commit into
Conversation
After the ARM64-only switch (#313), component-build hardcodes platforms: linux/arm64 and the architecture input is a no-op, so a service can't produce an amd64 image. Add an opt-in `platforms` input (default linux/arm64 — no change for existing callers) to component-build.yml and forward it through deploy-generic.yml. Set it to a comma-separated list to push a multi-arch manifest; a gated QEMU step handles the cross-arch build on the arm64 runner. Both blacksmith and self-hosted paths wired. Enables smart-charge to build a multi-arch image so the arm<->x86 node-pool choice becomes a pure kube-manifests toggle. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EjBGHdgna5BVQVgwFR2inj
There was a problem hiding this comment.
Pull request overview
This PR adds an opt-in platforms input to the reusable Docker build workflow (component-build.yml) and forwards it through deploy-generic.yml, enabling multi-arch image builds (and manifest list pushes) when explicitly requested while keeping the default behavior as arm64-only.
Changes:
- Introduces a
platformsworkflow input (defaultlinux/arm64) to control single-arch vs multi-arch Docker builds. - Adds a pinned, conditional QEMU setup step to support cross-arch builds when
platformsis not the default arm64-only value. - Forwards
platformsfromdeploy-generic.ymlintocomponent-build.yml.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| .github/workflows/deploy-generic.yml | Adds a platforms input (default arm64-only) and forwards it to component-build for opt-in multi-arch builds. |
| .github/workflows/component-build.yml | Adds platforms input, conditionally sets up QEMU for cross-arch builds, and wires platforms into both Blacksmith and self-hosted build actions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Superseded by monta-app/data-smart-charge#190 — smart-charge will build its own multi-arch image in-repo instead of opting into a shared multi-arch capability. Closing to keep the shared workflow arm64-only. Can revive if another service needs the shared opt-in. |
What
Adds an opt-in
platformsinput tocomponent-build.yml(and forwards it throughdeploy-generic.yml), defaulting tolinux/arm64— i.e. zero behaviour change for every existing caller.A service that sets
platforms: "linux/amd64,linux/arm64"gets a multi-arch manifest pushed instead of a single-arch arm64 image. Asetup-qemu-actionstep (pinned, gated onplatforms != 'linux/arm64') handles the cross-arch build on the existing arm64 runner — no new runner pools. Wired in both the blacksmith and self-hosted build paths.Why
After the ARM64-only switch (#313),
component-buildhardcodesplatforms: linux/arm64and thearchitectureinput is a no-op, so a service cannot produce an amd64 image. smart-charge runs a single-threaded MILP solver that is ~2× slower on Graviton than the x86m7ipool it used to run on; we want the ability to fall back to x86. With a multi-arch image, the arm↔x86 node-pool choice becomes a pure, instantly-reversiblekube-manifeststoggle — and the "exec format error" class of incident can't recur.Impact / safety
platforms, so they still do a single native arm64 build. The QEMU step is skipped for them.RUNsteps are light.Follow-up
Consumer change in data-smart-charge
deploy.yaml(setplatforms) lands after this merges, since passing an undefined input to the reusable workflow errors.🤖 Generated with Claude Code
https://claude.ai/code/session_01EjBGHdgna5BVQVgwFR2inj