Build multi-arch xpkg packages (amd64 + arm64) - #78
Open
amitgupta7 wants to merge 2 commits into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
.xpkgfiles together as a multi-arch OCI index using crank's multi-file-fflag. Crossplane will then pull the correct image for each node's architecture.Changes
ci.mkDOCKER_IMAGE_GOARCHbecomes a space-separated list (amd64 arm64by default, overridable)docker-buildloops over each arch, producing${IMG}-amd64/${IMG}-arm64images; keeps an un-suffixed${IMG}alias pointing at the first arch for local consumers (kind-load-image, etc.)package-buildloops over each arch, producingpackage/package-amd64.xpkgandpackage/package-arm64.xpkgpackage-pushpasses all.xpkgfiles as a comma-joined-flist so crank pushes a single multi-arch manifestdocker-pushnow uses$(DOCKER_CMD)for consistency withdocker-buildORG=${{ github.repository_owner }}in the release workflow so the image registry path resolves correctly when run from any fork.github/workflows/release.ymlPUSH_UPBOUND/PUSH_PACKAGE/PUSH_IMAGEenv values — GitHub Actions comparisons are case-sensitive, so"True" != 'true'was silently skipping the package-push step on every releasepermissions: contents: write, packages: writeto the dist job soGITHUB_TOKENcan publish GitHub releases and push to GHCRTesting
Verified locally:
make package-buildproduces bothpackage/package-amd64.xpkgandpackage/package-arm64.xpkg, andmake package-pushcombines them into a single multi-arch OCI index.🤖 Generated with Claude Code