Investigate the ideal way to cache
There's a number of caching issues lately, and I would like to figure out an ideal way and unify our caching strategy. I'll fill the references and context over time.
Background and context
[To be filled...]
Proposed solutions
- We update the cache (pull-push) only on master pipeline. We can do this via the scheduled master pipeline, so we can dodge #209864 (closed)
- In merge requests, we only pull the cache (pull).
- The cache can be using a fixed key, so merge requests will all pull cache from master.
- We need to find a way to expire older packages cached in the cache. For
gems
we may be usingbundle install --clean
so it'll remove packages we're not using. However, we cannot do this if we're mergingvendor/ruby
andvendor/gitaly-ruby
, because otherwise it'll remove packages from the otherGemfile.lock
. Or we may runbundle install --clean
forvendor/ruby
first, and thenbundle install
forvendor/gitaly-ruby
next without--clean
, so it'll not remove packages needed for GitLab Rails but not for Gitaly-ruby. - We need to find the same solution for
yarn install
andnode_modules
. - We need to find the same solution for
.go/pkg/mod
aw well
References
Edited by Lin Jen-Shin