Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add multiarch image build support using github actions. #267

Merged

Conversation

ashokpariya0
Copy link
Contributor

These changes enable the building of the Multus Dynamic CNI image for multiple platforms (amd64, arm64, s390x) using github actions.

What this PR does / why we need it:
The upstream image of the Multus Dynamic Networks Controller CNI (link) currently supports only the amd64 architecture. These changes extend multi-platform support to include arm64 and s390x architectures, enhancing the compatibility of the Multus Dynamic Networks Controller image across a broader range of systems.

Cross-compilation is performed in the builder image using the TARGETOS and TARGETARCH build arguments, which specify the target OS and architecture. These arguments are automatically configured by the multi-architecture build process using docker buildx

More information: [Docker Buildx Documentation](https://docs.docker.com/build/building/multi-platform/)

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #264

Special notes for your reviewer (optional):

@maiqueb
Copy link
Collaborator

maiqueb commented Nov 29, 2024

@ashokpariya0 would you please rebase ?

@ashokpariya0 ashokpariya0 force-pushed the add-multiarch-build-support branch from 4080153 to 883a54a Compare November 29, 2024 13:25
@ashokpariya0
Copy link
Contributor Author

@ashokpariya0 would you please rebase ?

Done.

Copy link
Collaborator

@maiqueb maiqueb left a comment

Choose a reason for hiding this comment

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

Thank you.

From my limited perspective, this looks correct.


FROM registry.access.redhat.com/ubi8/ubi-minimal
FROM --platform=linux/${TARGETARCH} registry.access.redhat.com/ubi8/ubi-minimal AS final
Copy link
Member

Choose a reason for hiding this comment

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

nit: AS final isn't used as ref, imho better to drop it, in case someone theoretically adds another layer

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nit: AS final isn't used as ref, imho better to drop it, in case someone theoretically adds another layer

Done.

These changes enable the building of the Multus Dynamic CNI image
for multiple platforms (amd64, arm64, s390x) from a single Dockerfile

Signed-off-by: Ashok Pariya <[email protected]>
@ashokpariya0 ashokpariya0 force-pushed the add-multiarch-build-support branch from 883a54a to a8e9324 Compare December 2, 2024 03:22
Copy link
Member

@oshoval oshoval left a comment

Choose a reason for hiding this comment

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

Thanks

@maiqueb maiqueb merged commit d765a56 into k8snetworkplumbingwg:main Dec 2, 2024
2 checks passed
@oshoval
Copy link
Member

oshoval commented Dec 3, 2024

Thanks
can you please issue a release so it will build multi arch images?

@maiqueb
Copy link
Collaborator

maiqueb commented Dec 3, 2024

Thanks can you please issue a release so it will build multi arch images?

here you go, freshly baked: https://github.com/k8snetworkplumbingwg/multus-dynamic-networks-controller/releases/tag/v0.3.5

@ashokpariya0
Copy link
Contributor Author

https://github.com/k8snetworkplumbingwg/multus-dynamic-networks-controller/releases/tag/v0.3.5

Thanks can you please issue a release so it will build multi arch images?

here you go, freshly baked: https://github.com/k8snetworkplumbingwg/multus-dynamic-networks-controller/releases/tag/v0.3.5

Awesome! I verified the latest release image on s390x, and it worked perfectly! :)

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.

[RFE] Enable multi-platform support for Multus Dynamic Networks Controller CNI image.
3 participants