chore(multi-arch-build): modify build process to enable ARM Support#2439
chore(multi-arch-build): modify build process to enable ARM Support#2439KaiyiLiu1234 wants to merge 1 commit intosustainable-computing-io:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2439 +/- ##
=======================================
Coverage 91.83% 91.83%
=======================================
Files 55 55
Lines 5857 5857
=======================================
Hits 5379 5379
Misses 343 343
Partials 135 135 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
45b2867 to
e11cef5
Compare
| check-latest: true | ||
|
|
||
| - name: Set up QEMU | ||
| uses: docker/setup-qemu-action@v3.7.0 |
Check warning
Code scanning / Scorecard
Pinned-Dependencies Medium
| uses: docker/setup-qemu-action@v3.7.0 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3.9.0 |
Check warning
Code scanning / Scorecard
Pinned-Dependencies Medium
|
@vimalk78 we might have to update the other workflows that do not pin by hash. I am just seeing this warning now. Worth pinning by hash? |
@KaiyiLiu1234 feel free to ignore the CI warnings. I am planning to fix this later |
|
Also @KaiyiLiu1234 can you change it from feat instead of chore as per: https://github.com/sustainable-computing-io/kepler/blob/main/docs/developer/pre-commit.md |
…n Kepler Use docker buildx with multi-platform support to allow the built Kepler image to be deployed on linux/amd64 and linux/arm64. This is required for Hwmon support on ARM Ampere Altra baremetals. Relevant build and test workflows have been updated to properly use docker buildx. Signed-off-by: Kaiyi Liu <kaliu@redhat.com>
e11cef5 to
9e72dd7
Compare
|
something that is a bit strange is that the security scan seems to be perpetually stuck in the queue (only applies to the multi platform image). Ref: https://quay.io/repository/rh_ee_kaliu/kepler?tab=tags |
vprashar2929
left a comment
There was a problem hiding this comment.
With this change we now depend upon buildx, QEMU to be present in order to build image and the CI now depends on setup-qemu-action and setup-buildx-action which aren't available locally. If something breaks in the release image build, you can't reproduce it on your machine.
My thought:
Instead of buildx + QEMU, we can just parameterize the existing make build / make image / make push targets with GOARCH and CC. The changes would be minimal in that case
something like:
- make build and add CC=$(CC) GOOS=linux GOARCH=$(GOARCH) to the go build
- Dockerfile change to simplify to COPY-only (remove the builder stage, since the binary is already built by make build)
- make image adds build as a dependency
- make push would remain unchanged
- Adds a new push-manifest target for creating the multi-arch manifest via docker buildx
With this, cross-arch builds just work with the same targets and no QEMU, no buildx for builds, no special CI actions would be needed
@KaiyiLiu1234 Thoughts? or if you have a better way around this?
| check-latest: true | ||
| cache: true | ||
|
|
||
| - name: Set up QEMU |
There was a problem hiding this comment.
Can't we use the GitHub Actions ARM runners instead of using QEMU+buildx?
| --build-arg GIT_BRANCH=$(GIT_BRANCH) \ | ||
| --platform=$(IMAGE_PLATFORMS) \ | ||
| --push . | ||
| $(call docker_tag,$(KEPLER_IMAGE),$(ADDITIONAL_TAGS)) |
| shell: bash | ||
| run: | | ||
| make image | ||
| make image-local |
There was a problem hiding this comment.
This also affects the release workflow as well

Use docker buildx with multi-platform support to allow the built Kepler image to be deployed on linux/amd64 and linux/arm64. This is required for Hwmon support on ARM Ampere Altra baremetals. Relevant build and test workflows have been updated to properly use docker buildx.