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

Allow separate cache in / out directories #97

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

multimac
Copy link
Contributor

Hey!

We use the oci-build-task quite heavily, but have noticed that over time the cache folder grows as our Dockerfiles are changed, and older layers are not removed when they are no longer relevant to the built image. This can cause the moving of the cache between workers to take more time than is saved by using the cache, which somewhat defeats the purpose.

We could use the caches directive to only keep the cache on the worker the task is run on, but this leads to rebuilding the image entirely whenever the task lands on a different worker. Without sharing the cache between workers, image layers would be re-built and duplicated in our container image repository too (even when the underlying files have not changed).


This PR adds cache-in and cache-out folders to the task. If a cache folder is not included in the task configuration, then these folders will be checked to see if they exist and, if so, used instead of the cache folder.

As the name implies, cache-in is where the cache will be imported from, and cache-out is where it will be exported to. Exporting the cache will (should?) only include the relevant layers, keeping the cache from including unnecessary layers and growing over time.

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.

1 participant