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

Make building the default python concurrent rather than sequential #7949

Conversation

jeffwidman
Copy link
Member

Previously we'd build all the non-default pythons concurrently with building the default python, and then sequence installing the apt packages behind building the default Python.

However, these apt packages can take a little while to fetch/install, and they don't require the default Python, so instead parallelize building the default python at the same time as installing the apt packages.

This also makes the flow consistent across all pythons of building in a separate stage and then copying to the final image.

@jeffwidman jeffwidman requested a review from a team as a code owner September 1, 2023 00:05
@jeffwidman
Copy link
Member Author

Thought of this while I was driving down the road running an errand and couldn't resist throwing it up... 😁

@jeffwidman jeffwidman force-pushed the make-installing-apt-packages-concurrent-with-python-3.11 branch from d867aa0 to fe09d18 Compare September 1, 2023 04:06

RUN pyenv global $PY_3_11

FROM python-core
# Install C-libs needed to build users' Python packages. Please document why each package is needed.
USER root
RUN apt-get update \
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the list of package installs that we now do concurrently with the python builds... It shouldn't take that long, but nevertheless it's faster to do this concurrently, plus I expect this list to grow over time as users report C-libs that they need installed to build their deps.

@jeffwidman jeffwidman force-pushed the make-installing-apt-packages-concurrent-with-python-3.11 branch from fe09d18 to c467a6e Compare September 1, 2023 04:08
Previously we'd build all the non-default pythons concurrently with
building the default python, and then sequence installing the `apt`
packages behind building the default Python.

However, these `apt` packages can take a little while to fetch/install,
and they don't require the default Python, so instead parallelize
building the default python at the same time as installing the apt
packages.

This also makes the flow consistent across all pythons of building in a
separate stage and then copying to the final image.
@jeffwidman jeffwidman force-pushed the make-installing-apt-packages-concurrent-with-python-3.11 branch from c467a6e to bdfa604 Compare September 1, 2023 04:30
Copy link
Member

@jakecoffman jakecoffman left a comment

Choose a reason for hiding this comment

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

LGTM

@jakecoffman jakecoffman merged commit 871902b into dependabot:main Sep 1, 2023
@jeffwidman jeffwidman deleted the make-installing-apt-packages-concurrent-with-python-3.11 branch September 1, 2023 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants