Skip to content

Build multi-arch xpkg packages (amd64 + arm64) - #78

Open
amitgupta7 wants to merge 2 commits into
vshn:masterfrom
amitgupta7:multiarch-pr
Open

Build multi-arch xpkg packages (amd64 + arm64)#78
amitgupta7 wants to merge 2 commits into
vshn:masterfrom
amitgupta7:multiarch-pr

Conversation

@amitgupta7

Copy link
Copy Markdown

Problem

The published provider package embeds an amd64-only runtime image. On arm64 clusters (e.g. Apple Silicon dev machines running kind, or AWS Graviton nodes) the provider pod crashes immediately because the embedded binary is the wrong architecture.

Solution

Build one runtime image per architecture and push the .xpkg files together as a multi-arch OCI index using crank's multi-file -f flag. Crossplane will then pull the correct image for each node's architecture.

Changes

ci.mk

  • DOCKER_IMAGE_GOARCH becomes a space-separated list (amd64 arm64 by default, overridable)
  • docker-build loops over each arch, producing ${IMG}-amd64 / ${IMG}-arm64 images; keeps an un-suffixed ${IMG} alias pointing at the first arch for local consumers (kind-load-image, etc.)
  • package-build loops over each arch, producing package/package-amd64.xpkg and package/package-arm64.xpkg
  • package-push passes all .xpkg files as a comma-joined -f list so crank pushes a single multi-arch manifest
  • docker-push now uses $(DOCKER_CMD) for consistency with docker-build
  • Pass ORG=${{ github.repository_owner }} in the release workflow so the image registry path resolves correctly when run from any fork

.github/workflows/release.yml

  • Lowercase PUSH_UPBOUND/PUSH_PACKAGE/PUSH_IMAGE env values — GitHub Actions comparisons are case-sensitive, so "True" != 'true' was silently skipping the package-push step on every release
  • Add explicit permissions: contents: write, packages: write to the dist job so GITHUB_TOKEN can publish GitHub releases and push to GHCR

Testing

Verified locally: make package-build produces both package/package-amd64.xpkg and package/package-arm64.xpkg, and make package-push combines them into a single multi-arch OCI index.

🤖 Generated with Claude Code

The published provider package embeds an amd64-only runtime image, which
crashes on arm64 clusters (e.g. Apple Silicon dev machines). Build the
runtime image per architecture and push the xpkgs as one multi-arch index
via crank's multi-file push.

Also pass ORG=github.repository_owner in the release workflow so package
pushes work from forks.
GitHub Actions expression comparisons are case-sensitive; PUSH_PACKAGE:
"True" with `== 'true'` never matched, so package pushes were silently
skipped on every release.

Also add explicit `permissions: contents/packages: write` to the dist
job so GITHUB_TOKEN can publish GitHub releases (goreleaser) and push
images/packages to GHCR (crank xpkg push, docker login).

Also use $(DOCKER_CMD) in docker-push for consistency with docker-build.
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