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

Refactor image builds to use buildx for multi arch image building #2754

Merged
merged 6 commits into from
Aug 4, 2020

Conversation

RobReus
Copy link
Contributor

@RobReus RobReus commented Jul 23, 2020

Fixes #2466 , Fixes #2486 , Closes #2566

This change introduces buildx to build multi arch container images.

Only the container image building is affected by this change, all other functionality (including locally building) remains the same.

Would love to get some feedback on this. We would probably improve it further to reduce build times. Right now the GitHub workflow takes about the same amount of time as before, even though images are now built in parallel. I noticed that cross compiling within the new way of doing it went from 90 seconds to around 300 seconds. I feel like we can win plenty of time by making the cross compile of the velero binary more efficient.

Succesful workflow on my fork: https://github.com/RobReus/velero/actions/runs/180022436 (most recent ones failed due to my credentials now having access to the velero registry).

Dockerfile Outdated Show resolved Hide resolved
@nrb
Copy link
Contributor

nrb commented Jul 23, 2020

Thanks for this @RobReus! I'll look at it in more detail later today. For now, can you double check to make sure that all changed files have their copyright year set to 2020?

@nrb nrb requested review from ashish-amarnath and carlisia July 23, 2020 16:50
@RobReus
Copy link
Contributor Author

RobReus commented Jul 23, 2020

@nrb I have updated the copyright of the files I touched with this PR.

Copy link
Member

@ashish-amarnath ashish-amarnath left a comment

Choose a reason for hiding this comment

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

@RobReus Thank you for picking this up!
The changes makes sense to me. But I've not been able to build a container from this PR.
Can you please clarify the buildx installation and also the platforms you've been able to build this in?

Makefile Show resolved Hide resolved
hack/download-restic.sh Show resolved Hide resolved
hack/download-restic.sh Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
RobReus added 2 commits July 24, 2020 19:37
Signed-off-by: Rob Reus <rob@devrobs.nl>
Signed-off-by: Rob Reus <rob@devrobs.nl>
Makefile Outdated Show resolved Hide resolved
Copy link
Member

@ashish-amarnath ashish-amarnath left a comment

Choose a reason for hiding this comment

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

RobReus added 2 commits August 3, 2020 16:04
Signed-off-by: Rob Reus <rob@devrobs.nl>
Signed-off-by: Rob Reus <rob@devrobs.nl>
@RobReus
Copy link
Contributor Author

RobReus commented Aug 3, 2020

@ashish-amarnath I have updated the contribution docs on building the container images. I have also implemented the feedback given.

Let me know if there's anything else you want to discuss or see changed.

@RobReus RobReus requested a review from ashish-amarnath August 3, 2020 14:31
Copy link
Contributor

@nrb nrb left a comment

Choose a reason for hiding this comment

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

Overall this looks good, thanks a ton @RobReus!

I have one more big thing to address, and I think this would be ready for merge.

Dockerfile Outdated Show resolved Hide resolved
Signed-off-by: Rob Reus <rob@devrobs.nl>
@RobReus RobReus requested a review from nrb August 4, 2020 18:25
Copy link
Contributor

@nrb nrb left a comment

Choose a reason for hiding this comment

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

Awesome! Thank you so much for this change and your patience!

Copy link
Member

@ashish-amarnath ashish-amarnath left a comment

Choose a reason for hiding this comment

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

@RobReus Thank you for the PR! 🎉

@ashish-amarnath ashish-amarnath merged commit db139cf into vmware-tanzu:main Aug 4, 2020
georgettica pushed a commit to georgettica/velero that referenced this pull request Dec 23, 2020
…ware-tanzu#2754)

* Refactor image builds to use buildx for multi arch image building

Signed-off-by: Rob Reus <rob@devrobs.nl>

* Adding image build sanity checks to Makefile

Signed-off-by: Rob Reus <rob@devrobs.nl>

* Making locally building of docker images possible

Signed-off-by: Rob Reus <rob@devrobs.nl>

* Adding docs on building container images using buildx

Signed-off-by: Rob Reus <rob@devrobs.nl>

* Adding changelog and implementing feedback from PR

Signed-off-by: Rob Reus <rob@devrobs.nl>

* Making GOPROXY used in the build containers configurable

Signed-off-by: Rob Reus <rob@devrobs.nl>
georgettica pushed a commit to georgettica/velero that referenced this pull request Jan 26, 2021
…ware-tanzu#2754)

* Refactor image builds to use buildx for multi arch image building

Signed-off-by: Rob Reus <rob@devrobs.nl>

* Adding image build sanity checks to Makefile

Signed-off-by: Rob Reus <rob@devrobs.nl>

* Making locally building of docker images possible

Signed-off-by: Rob Reus <rob@devrobs.nl>

* Adding docs on building container images using buildx

Signed-off-by: Rob Reus <rob@devrobs.nl>

* Adding changelog and implementing feedback from PR

Signed-off-by: Rob Reus <rob@devrobs.nl>

* Making GOPROXY used in the build containers configurable

Signed-off-by: Rob Reus <rob@devrobs.nl>
vadasambar pushed a commit to vadasambar/velero that referenced this pull request Feb 3, 2021
…ware-tanzu#2754)

* Refactor image builds to use buildx for multi arch image building

Signed-off-by: Rob Reus <rob@devrobs.nl>

* Adding image build sanity checks to Makefile

Signed-off-by: Rob Reus <rob@devrobs.nl>

* Making locally building of docker images possible

Signed-off-by: Rob Reus <rob@devrobs.nl>

* Adding docs on building container images using buildx

Signed-off-by: Rob Reus <rob@devrobs.nl>

* Adding changelog and implementing feedback from PR

Signed-off-by: Rob Reus <rob@devrobs.nl>

* Making GOPROXY used in the build containers configurable

Signed-off-by: Rob Reus <rob@devrobs.nl>
dharmab pushed a commit to dharmab/velero that referenced this pull request May 25, 2021
…ware-tanzu#2754)

* Refactor image builds to use buildx for multi arch image building

Signed-off-by: Rob Reus <rob@devrobs.nl>

* Adding image build sanity checks to Makefile

Signed-off-by: Rob Reus <rob@devrobs.nl>

* Making locally building of docker images possible

Signed-off-by: Rob Reus <rob@devrobs.nl>

* Adding docs on building container images using buildx

Signed-off-by: Rob Reus <rob@devrobs.nl>

* Adding changelog and implementing feedback from PR

Signed-off-by: Rob Reus <rob@devrobs.nl>

* Making GOPROXY used in the build containers configurable

Signed-off-by: Rob Reus <rob@devrobs.nl>
ywk253100 pushed a commit to ywk253100/velero that referenced this pull request Jun 29, 2021
…ware-tanzu#2754)

* Refactor image builds to use buildx for multi arch image building

Signed-off-by: Rob Reus <rob@devrobs.nl>

* Adding image build sanity checks to Makefile

Signed-off-by: Rob Reus <rob@devrobs.nl>

* Making locally building of docker images possible

Signed-off-by: Rob Reus <rob@devrobs.nl>

* Adding docs on building container images using buildx

Signed-off-by: Rob Reus <rob@devrobs.nl>

* Adding changelog and implementing feedback from PR

Signed-off-by: Rob Reus <rob@devrobs.nl>

* Making GOPROXY used in the build containers configurable

Signed-off-by: Rob Reus <rob@devrobs.nl>
gyaozhou pushed a commit to gyaozhou/velero-read that referenced this pull request May 14, 2022
…ware-tanzu#2754)

* Refactor image builds to use buildx for multi arch image building

Signed-off-by: Rob Reus <rob@devrobs.nl>

* Adding image build sanity checks to Makefile

Signed-off-by: Rob Reus <rob@devrobs.nl>

* Making locally building of docker images possible

Signed-off-by: Rob Reus <rob@devrobs.nl>

* Adding docs on building container images using buildx

Signed-off-by: Rob Reus <rob@devrobs.nl>

* Adding changelog and implementing feedback from PR

Signed-off-by: Rob Reus <rob@devrobs.nl>

* Making GOPROXY used in the build containers configurable

Signed-off-by: Rob Reus <rob@devrobs.nl>
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.

Unable to install ca-certificate package on arm builds
3 participants