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

Adds multi-architecture support to the Makefile using docker buildx (amd64, arm64, arm/v7) #327

Closed
wants to merge 1 commit into from

Conversation

emshotton
Copy link

This adds an additional push-multiarch command to the Makefile 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!

@k8s-ci-robot
Copy link
Contributor

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.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please sign in with your organization's credentials at https://identity.linuxfoundation.org/projects/cncf to be authorized.
  • If you have done the above and are still having issues with the CLA being reported as unsigned, please log a ticket with the Linux Foundation Helpdesk: https://support.linuxfoundation.org/
  • Should you encounter any issues with the Linux Foundation Helpdesk, send a message to the backup e-mail support address at: [email protected]

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.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Jun 12, 2020
@k8s-ci-robot
Copy link
Contributor

Welcome @MatthewShotton!

It looks like this is your first PR to kubernetes-sigs/node-feature-discovery 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/node-feature-discovery has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot requested review from kad and zvonkok June 12, 2020 22:21
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: MatthewShotton
To complete the pull request process, please assign balajismaniam
You can assign the PR to them by writing /assign @balajismaniam in a comment when ready.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jun 12, 2020
@emshotton
Copy link
Author

I've just signed the "Individual Contributor" CLA.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Jun 12, 2020
@marquiz
Copy link
Contributor

marquiz commented Jun 29, 2020

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

@pmundt
Copy link
Contributor

pmundt commented Jul 1, 2020

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 .travis-ci.yml for the time being.

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.

@emshotton
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants