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

Reduce dockerfile-dev build time in half with uv and pnpm #4904

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

anchapin
Copy link
Contributor

Any background context you want to provide?

I started using uv locally to replace pip and noticed that it reduces the time to install packages by about half. Additionally, I noticed that when the dockerfile is built, that the pip install -r requirements/local.txt step was taking most of the time.

What's this PR do?

I looked up how to switch to uv from pip and implemented those changes. I also looked up if there was an equivalent speed up that can happen for replacing npm install and tried using pnpm. These changes are only included in the dockerfile-dev file since likely needs to be rebuilt the most often compared to dockerfile which is used for deploying seed.

How should this be manually tested?

Switch to the branch and use the following command: docker-compose stop && docker-compose rm -f && docker-compose -f docker-compose.yml -f docker-compose.dev.yml build and see how long the build process takes. For me it was about 150 seconds compared to about 300 seconds on the develop branch.

What are the relevant tickets?

Screenshots (if appropriate)

…sed pnpm instead of npm and update requests version
@anchapin anchapin added the Enhancement Add this label if functionality was generally improved but not a full feature or maintentance. label Dec 13, 2024
@anchapin anchapin requested a review from axelstudios December 13, 2024 05:20
@anchapin
Copy link
Contributor Author

Note that I updated the requests version number because I was getting an error with the old version. I'm not sure if this is really needed though.

@anchapin
Copy link
Contributor Author

I also revised the version of alpine to 3.16 to match what node is based on. I was seeing errors related to this but again not sure if this change is necessary.

@axelstudios
Copy link
Member

I also revised the version of alpine to 3.16 to match what node is based on. I was seeing errors related to this but again not sure if this change is necessary.

The problem with Alpine 3.16 is that it install Python v3.10 instead of v3.9. That problem should be going away soon with the dependency updates

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Add this label if functionality was generally improved but not a full feature or maintentance.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants