Skip to content

chore(multi-arch-build): modify build process to enable ARM Support#2439

Open
KaiyiLiu1234 wants to merge 1 commit intosustainable-computing-io:mainfrom
KaiyiLiu1234:multi-arch-builds
Open

chore(multi-arch-build): modify build process to enable ARM Support#2439
KaiyiLiu1234 wants to merge 1 commit intosustainable-computing-io:mainfrom
KaiyiLiu1234:multi-arch-builds

Conversation

@KaiyiLiu1234
Copy link
Collaborator

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.

@KaiyiLiu1234 KaiyiLiu1234 requested a review from vimalk78 March 13, 2026 04:29
@github-actions github-actions bot added the feat A new feature or enhancement label Mar 13, 2026
@@ -1,16 +1,29 @@
# Build the binary
FROM golang:1.24 AS builder
FROM --platform=$BUILDPLATFORM golang:1.24 AS builder

Check warning

Code scanning / Scorecard

Pinned-Dependencies Medium

score is 0: containerImage not pinned by hash
Remediation tip: pin your Docker image by updating golang:1.24 to golang:1.24@sha256:d2d2bc1c84f7e60d7d2438a3836ae7d0c847f4888464e7ec9ba3a1339a1ee804
Click Remediation section below for further remediation help
@codecov
Copy link

codecov bot commented Mar 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.83%. Comparing base (be70b52) to head (9e72dd7).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@KaiyiLiu1234 KaiyiLiu1234 force-pushed the multi-arch-builds branch 2 times, most recently from 45b2867 to e11cef5 Compare March 13, 2026 05:04
check-latest: true

- name: Set up QEMU
uses: docker/setup-qemu-action@v3.7.0

Check warning

Code scanning / Scorecard

Pinned-Dependencies Medium

score is 0: third-party GitHubAction not pinned by hash
Click Remediation section below to solve this issue
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

score is 0: third-party GitHubAction not pinned by hash
Click Remediation section below to solve this issue
@KaiyiLiu1234
Copy link
Collaborator Author

@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?

@vprashar2929
Copy link
Collaborator

@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

@vprashar2929
Copy link
Collaborator

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

@KaiyiLiu1234 KaiyiLiu1234 changed the title feat(multi-arch-build): modify build process to enable ARM Support chore(multi-arch-build): modify build process to enable ARM Support Mar 13, 2026
…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>
@github-actions github-actions bot added chore Routine tasks or maintenance and removed feat A new feature or enhancement labels Mar 13, 2026
@KaiyiLiu1234
Copy link
Collaborator Author

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
Screenshot From 2026-03-13 12-59-32

Copy link
Collaborator

@vprashar2929 vprashar2929 left a comment

Choose a reason for hiding this comment

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

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:

  1. make build and add CC=$(CC) GOOS=linux GOARCH=$(GOARCH) to the go build
  2. Dockerfile change to simplify to COPY-only (remove the builder stage, since the binary is already built by make build)
  3. make image adds build as a dependency
  4. make push would remain unchanged
  5. 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
Copy link
Collaborator

Choose a reason for hiding this comment

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

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))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Isn't this wrong?

shell: bash
run: |
make image
make image-local
Copy link
Collaborator

Choose a reason for hiding this comment

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

This also affects the release workflow as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Routine tasks or maintenance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants