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 build cache to pip installs #31

Merged
merged 1 commit into from
Apr 24, 2024
Merged

Adds build cache to pip installs #31

merged 1 commit into from
Apr 24, 2024

Conversation

falquaddoomi
Copy link
Collaborator

Docker somewhat recently introduced the ability to cache folders during image creation time, documented here: Build cache, and more on it here: Mounts guide.

Basically, rather than having to refetch all the packages each time the Python requirements change, it only needs to fetch the new ones, since it retains pip's cache between image builds. This should speed up run_local.sh when the requirements change. You'll only see this speedup once per requirements change, since after that all the layers will be cached and it should "build" nearly instantly, but if you're making frequent changes to the requirements it helps.

Copy link

netlify bot commented Apr 24, 2024

Deploy Preview for gene-plexus canceled.

Name Link
🔨 Latest commit 3c78417
🔍 Latest deploy log https://app.netlify.com/sites/gene-plexus/deploys/662937366fb28e000863ec78

Copy link
Collaborator

@vincerubinetti vincerubinetti left a comment

Choose a reason for hiding this comment

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

Tried this locally. Added a random package to one of the requirements.txts. Couldn't quite tell if it only was installing the new package, largely because Docker limits the output to a few lines. But you're doing exactly what the docs say to do, so lgtm.

@falquaddoomi falquaddoomi merged commit 810bf47 into main Apr 24, 2024
3 checks passed
@falquaddoomi falquaddoomi deleted the docker-pip-cache branch April 24, 2024 17:36
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