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

Cache never used #23

Open
thedarkside opened this issue Oct 2, 2023 · 3 comments
Open

Cache never used #23

thedarkside opened this issue Oct 2, 2023 · 3 comments

Comments

@thedarkside
Copy link

thedarkside commented Oct 2, 2023

Hey @fagiani

ive started using packs image cache and for some reason this buildpack always prints -----> Detected Aptfile changes, flushing cache.
Iam building inside our gitlab pipeline with gitlabs auto devops pipeline template and the paketo builder.

Even a second job run on the same commit detects a "change".

Looking into the code i suspect the comparision of the Aptfile via cmp -s as the issue. Maybe because paketo resets the timestamps of all files and thus only those differ? Im not sure how cmp behaves.

For this use here it should be save to just compare the contents and ignore any difference in file metadata.

@knsita
Copy link

knsita commented Jan 18, 2024

Hi,

I'm encountering the same problem in our Gitlab Pipeline.

When rebuilding on a local machine, I don't get the ---->Detected Aptfile changes, flushing cache and the cache get's reused. After some experimenting I found out, that the buildpack cache is stored in an image, see https://buildpacks.io/docs/app-developer-guide/using-cache-image/
If I remove that image, I get the same behavior as in our Gitlab CI pipeline, where containers and images are ephemeral and get thrown away after a job.

I think you have to provide that image to the Docker deamon that is used by the build container in your pipeline.

I'll do further testing and report when I found a working solution.

@knsita
Copy link

knsita commented Jan 18, 2024

Okay, I still get the --->Detected Aptfile changes, flushing cache message even when the image was found.

It would be great to know which dirs/files/images/volumes one has to back up in order to not redownload and reinstall all dependencies in the build job of the gitlab pipeline.

@thedarkside
Copy link
Author

@knsita meanwhile I created a solution. The default gitlab chart is not capable of utilizing cache images for buildpack builds.

Once it's enabled it works as expected. So this is definitely not an issue of this project here!

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

No branches or pull requests

2 participants