-
Notifications
You must be signed in to change notification settings - Fork 249
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
Adds multi-architecture support to the Makefile using docker buildx (amd64, arm64, arm/v7) #327
Conversation
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Welcome @MatthewShotton! |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: MatthewShotton The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
I've just signed the "Individual Contributor" CLA. |
Thank you for the patch @MatthewShotton ! I'm currently on child care leave so I apologies for the unresponsiveness (past and the near future). I'll take a closer look as soon as I can. Maybe @pmundt could take a look, too, as he has lately been doing multiarch builds |
Thanks @MatthewShotton, it's nice to see that others are interested in this direction. The method proposed here is basically the same method I have been using for multiarch builds in my local testing, so I don't have an issue with buildx per se, but it's experimental nature means that there is very poor integration with the rest of the workflow. For example, the image building and pushing is done via Travis, which has its own method for doing multi-arch builds, but does not have a method for generating and pushing manifest files to an image registry. This means that if we want to support multiarch in the CI/CD pipeline, which I think we certainly do, we will still need to implement manual manifest wrangling in the The addition of a buildx rule in the top-level Makefile, while providing a convenience wrapper for people wanting to do this themselves, unfortunately brings us no closer to multiarch image generation in the existing CI/CD pipeline. It may still be worthwhile having a Makefile target just for testing locally, but I would not expect most users to care about this once real multiarch images are regularly pushed out to the public image registry. I would suggest that we try to solve this in the CI/CD pipeline first, and then see if there are specific Makefile helpers that could be added to tie things together more coherently. Having two different build/push mechanisms where only one is tied into the CI/CD pipeline is something I think we should try to avoid. |
Ok cool! Thanks for the detailed reply. That makes a lot of sense. I unfortunately don't have a whole lot of experience with Travis otherwise I'd try to help getting multi-arch working in there. I'm excited for when it lands though! I'll close this PR for the time-being. |
This adds an additional
push-multiarch
command to theMakefile
which builds and pushes multi-architecture images (architectures are listed in the$MULTIARCH_IMAGE_ARCHITECTURES
variable).I tried initially to do this as two separate steps, one build step and one push step as for single architecture builds. Alas it seems like for multi-arch builds with buildx you need to push as part of the build if you want to generate a suitable multi-architecture manifest file for a registry.
(There is the "hard way" as outlined here: https://www.docker.com/blog/multi-arch-build-and-images-the-simple-way/ which might make it possible to run as two steps, but buildx seems to be the future for multi-architecture builds)
Note: buildx is still an experimental feature, and needs to be enabled in docker as outlined here: https://docs.docker.com/buildx/working-with-buildx.
Context I'm been wanting to experiment with
node-feature-discovery
on a mixed-architecture k3s home-lab cluster. It seems like a really cool solution for scheduling nodes based on the devices plugged into the USB ports of the cluster nodes. I noticed you didn't have any arm images built.Thank you for this cool project!