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

dancing with pip cache on a python image #9

Open
mgaitan opened this issue Oct 5, 2023 · 1 comment
Open

dancing with pip cache on a python image #9

mgaitan opened this issue Oct 5, 2023 · 1 comment
Labels
question Further information is requested

Comments

@mgaitan
Copy link

mgaitan commented Oct 5, 2023

I am attempting to use buildkit-cache-dance to cache pip dependencies in a GitHub Actions workflow but am encountering issues where the cache is not being used.

My example repo: mgaitan/pip-docker-cache-dance

Consider this commit where I removed a dependency, while supposely the rest are available in the cache.

However the logs indicates that despite the cache directive, pip dependencies are being downloaded again.

I'd appreciate any insights or assistance to resolve this issue.

@AkihiroSuda AkihiroSuda added the question Further information is requested label Oct 8, 2023
@henryjw
Copy link
Contributor

henryjw commented Dec 31, 2023

TLDR; the files are cached but it's possible that the package manage isn't accessing them

@mgaitan I used your repo to explore how buildkit-cache-dance works. After troubleshooting and adding some logs I've concluded that buildkit-cache-dance is working as expected. So my guess is that it's something about how you're installing the modules. Here's the run with all my troubleshooting logs: https://github.com/henryjw/pip-docker-cache-dance/actions/runs/7371832005/job/20059582773

screenshot of cached files

I'm not experienced enough with Python to know why it's not working for you, but for nodejs using the pnpm package manager, there are flags that must be set to tell it to give higher priority to the cached files before attempting to download them.
My install script is pnpm install --prefer-offline --frozen-lockfile, where --prefer-offline tells the package manager to give priority to the existing files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants