feat: add arm container image in the lifecycle manager pipeline#61
feat: add arm container image in the lifecycle manager pipeline#61
Conversation
Updated the GitHub Actions workflow to support multi-architecture builds for the extension, modifying the image name and registry details.
Refactor Docker manifest creation to include amendments and annotations for multi-architecture support.
|
|
||
| - name: Create multi-arch manifest | ||
| run: | | ||
| VERSION=$(echo "${GITHUB_REF_NAME}" | sed 's/^.*-//') |
There was a problem hiding this comment.
Is there a reason VERSION is extracted from git ref here whereas VERSION is extracted from package.json at other places in the workflow?
There was a problem hiding this comment.
Actually, I see that there are places where the version is coming from the git tag and another is coming from package.json, so I will change the pipeline to follow a common place
| build-extension: | ||
| name: Build Container Image and Helm Chart | ||
| runs-on: ubuntu-latest | ||
| build-amd64: |
There was a problem hiding this comment.
Instead of having build-amd64, build-arm64 can we do something like this?
https://github.com/rancher-sandbox/rancher-desktop-rdx-open-webui/blob/main/.github/workflows/build.yaml#L26
There was a problem hiding this comment.
Unfortunately, this is not supported.
Since the Rancher packaging script (yarn publish-pkgs) does not support specifying a target platform (e.g. --platform linux/amd64,linux/arm64), it is not possible to build a multi-arch image in a single step using docker buildx.
There was a problem hiding this comment.
But I made some changes to remove code duplication and use matrix job
Add a step to calculate tags for Docker image versioning.
fix: standardize version reference for the docker images
Refactor build process to use a matrix strategy for multiple architectures and consolidate steps for building container images.
chore: refactor duplication in lifecycle manager pipeline
What changed
This PR adds multi-architecture container support (amd64 + arm64) to the SUSE AI Lifecycle Manager extension pipeline.
Since the Rancher packaging script (
yarn publish-pkgs) does not support specifying a target platform (e.g.--platform linux/amd64,linux/arm64), it is not possible to build a multi-arch image in a single step using docker buildx.To work around this limitation, the pipeline was redesigned to:
Resulting Image Tags
When the pipeline runs for a release (e.g.
1.0.0), it now produces:1.0.0-amd64→ architecture-specific image1.0.0-arm64→ architecture-specific image1.0.0→ multi-arch manifest referencing bothThe
1.0.0tag is the canonical tag and should be used by consumers.Kubernetes will automatically pull the correct image variant based on node architecture.
Future Improvement
Added this comment in the Tech Debt: Make extension script allow for multiarch builds (airgapped arm image) - GitHub Issue to suggest supporting
--platformin the shell/scripts/extension/publish, so the pipeline could be simplified to a single job building and pushing the multi-arch image directly.