Skip to content

feat: opt-in multi-arch builds in component-build [ENERGY-2009]#317

Open
ckattmann wants to merge 1 commit into
mainfrom
feat/ENERGY-2009-optin-multiarch-build
Open

feat: opt-in multi-arch builds in component-build [ENERGY-2009]#317
ckattmann wants to merge 1 commit into
mainfrom
feat/ENERGY-2009-optin-multiarch-build

Conversation

@ckattmann

Copy link
Copy Markdown
Contributor

What

Adds an opt-in platforms input to component-build.yml (and forwards it through deploy-generic.yml), defaulting to linux/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. A setup-qemu-action step (pinned, gated on platforms != '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-build hardcodes platforms: linux/arm64 and the architecture input 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 x86 m7i pool 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-reversible kube-manifests toggle — and the "exec format error" class of incident can't recur.

Impact / safety

  • Default unchanged: existing callers don't pass platforms, so they still do a single native arm64 build. The QEMU step is skipped for them.
  • Opt-in cross-arch builds are slower (QEMU emulation) but smart-charge's image is pure-Python (manylinux wheels, no native compilation), so the emulated RUN steps are light.

Follow-up

Consumer change in data-smart-charge deploy.yaml (set platforms) lands after this merges, since passing an undefined input to the reusable workflow errors.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EjBGHdgna5BVQVgwFR2inj

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
@ckattmann ckattmann requested a review from a team as a code owner June 22, 2026 16:43
@ckattmann ckattmann requested review from BrianEstrada, Copilot and tobias0106 and removed request for a team June 22, 2026 16:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 platforms workflow input (default linux/arm64) to control single-arch vs multi-arch Docker builds.
  • Adds a pinned, conditional QEMU setup step to support cross-arch builds when platforms is not the default arm64-only value.
  • Forwards platforms from deploy-generic.yml into component-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.

@ckattmann

Copy link
Copy Markdown
Contributor Author

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.

@ckattmann ckattmann closed this Jun 22, 2026
@ckattmann ckattmann reopened this Jun 22, 2026
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.

3 participants