Closed rotated8 closed 4 years ago
Question: Is storing the BUNDLE_CACHE_KEY file as an artifact valuable? An alternative would be to cat
the file so its contents appear in the run's output.
On the plus side, this is producing the intended results: https://app.circleci.com/pipelines/github/samvera/hyrax/3735/workflows/8388e251-e6cd-4eca-84ee-95f793c90de8/jobs/24948/artifacts
Another optimization we could consider is changing the way the cache key is constructed. Right now, they key is v<cache_version>-bundle-<bundle_checksum>-<ruby_version>-<bundler_version>
. Even without the change in this PR, we would get a better cache hit by moving the bundle checksum to the end: v<cache_version>-<ruby_version>-<bundler_version>-bundle-<bundle_checksum>
, since the initial miss would match on v<cache_version>-<ruby_version>-<bundler_version>
.
I've made the changes I speculated about above.
Nice!
In CircleCI, different parallel runs could order the files found for the bundle cache key differently, resulting in cache misses, even though the files found and the MD5s were the same. Now, the checksums are sorted.
The file that becomes part of the cache key is also added to the run's artifacts, so future debugging won't have to do so much guesswork.
Fixes #40