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

[manylinux2014] Rework scripts to be more docker cache friendly #879

Merged
merged 1 commit into from
Feb 6, 2021

Conversation

mayeut
Copy link
Member

@mayeut mayeut commented Dec 12, 2020

This won't change travis-ci build time (at least for now) but allows maintainers/contributors to benefit from docker caching for local developments (faster builds at the expense of higher disk usage)

Round 1

Use docker multi-stage build to build the manylinux image in 3 steps:

  1. runtime_base: this image has all the necessary bits that are common to the build_base image and the manylinux image. This includes system packages required for runtime, the gcc toolchain & some basic tools.

  2. build_base: this image builds all the remaining tools required for the manylinux image. Any tool requiring specific system development package not required in the manylinux image shall be built from this image. For tools that used to be installed in /usr/local, they are staged in /manylinux-rootfs for an easy copy in the third stage.

  3. manylinux: This image uses the runtime_base image as a base image. Tools built in the 2nd step are copied directly in the final filesystem. A finalization script is then run to install the remaining python tools/dependencies and run checks.

This PR builds on top of #876

@mayeut mayeut force-pushed the manylinux2014-multistage-build branch 7 times, most recently from 4d5f75b to fe9ccda Compare December 19, 2020 19:47
@mayeut mayeut force-pushed the manylinux2014-multistage-build branch from fe9ccda to 33f1acf Compare December 24, 2020 12:45
@mayeut mayeut force-pushed the manylinux2014-multistage-build branch from 33f1acf to 6c321b6 Compare December 31, 2020 20:41
@mayeut mayeut mentioned this pull request Jan 6, 2021
@mayeut mayeut force-pushed the manylinux2014-multistage-build branch from 6c321b6 to 9c2a018 Compare January 23, 2021 17:26
@mayeut mayeut marked this pull request as ready for review January 23, 2021 17:57
This won't change travis-ci build time (at least for now) but allows maintainers/contributors to benefit from docker caching for local developments (faster builds at the expense of higher disk usage)

Round 1

Use docker multi-stage build to build the manylinux image in 3 steps:

1. runtime_base: this image has all the necessary bits that are common to the build_base image and the manylinux image. This includes system packages required for runtime, the gcc toolchain & some basic tools.

2. build_base: this image builds all the remaining tools required for the manylinux image. Any tool requiring specific system development package not required in the manylinux image shall be built from this image. For tools that used to be installed in /usr/local, they are staged in /manylinux-rootfs for an easy copy in the third stage.

3. manylinux: This image uses the runtime_base image as a base image. Tools built in the 2nd step are copied directly in the final filesystem. A finalization script is then run to install the remaining python tools/dependencies and run checks.
@mayeut mayeut force-pushed the manylinux2014-multistage-build branch from 9c2a018 to c38b3bc Compare January 24, 2021 14:48
@mattip
Copy link
Contributor

mattip commented Jan 28, 2021

Is this ready for final review?

@mayeut
Copy link
Member Author

mayeut commented Jan 30, 2021

This one is ready for review. I merged the previous PR without any reviews in order to get things going forward even though I don't like to do this without reviews...
It's only a part of multiple PR that are yet to come to get in a state I find acceptable for a single branch, docker cache friendly state.
I won't wait for more than a week for further reviews. If there are none, I will assume this is acceptable.

@mattip
Copy link
Contributor

mattip commented Feb 6, 2021

#965 is next?

@mayeut
Copy link
Member Author

mayeut commented Feb 6, 2021

@mattip, yes, I'll merge everything up to building on GHA which will take some time for aarch64/s390x/ppc64le

@mayeut mayeut deleted the manylinux2014-multistage-build branch February 6, 2021 19:43
@mattip
Copy link
Contributor

mattip commented Feb 6, 2021

thanks!

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.

2 participants