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

WIP: Smarter cache management for CI. #1652

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

m-lindgren
Copy link
Member

This is a work in progress trying to make the cache management a bit smarter.

Currently a PR can easily consume all 10 GB available because on each run the cache is duplicated instead of updated. This in and of it self is not a critical problem: GitHub will just evict the oldest cache files until we are below the quota again. It is however a nuisance since it will cause unnecessary rebuilds when a PR is merged, or when another PR is opened.

This does two things so far:

  • When a PR is closed (or merged into master) all cache files owned by it are removed.
  • When a job is rerun for a PR the cache is updated with the new contents, instead of duplicated. Precisely: the old cache file is deleted and the new is saved with the same name.

This adds a job that runs when a PR is closed (either by being closed or merged
into master). This job removes any cache entries owned by the closed PR.
Currently each cache run will create a new copy of the cache files. When a PR is
being worked on with many changes happening this can quickly use up the quota of
cache space available.

With this change old cache files will be removed before the new ones are saved,
essentially making each run update the cache instead of storing an updated copy.
@benediktahrens
Copy link
Member

@m-lindgren : this PR is still marked as a draft - is this correct, or is it ready for review?

@m-lindgren
Copy link
Member Author

@benediktahrens no this is still a WIP, It needs some work and testing. I'm trying to figure out some permission issues currently.

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.

None yet

2 participants