Hi,
we're trying to integrate self-hosted runners in our pipeline. We want to have a pipeline, where some steps are running in the cloud and some others are running on the self-hosted runners.
Now we're getting a problem with the caches. The self-hosted runners are sometimes not recognizing the present caches.
After some investigation, i figured out, that they're using different cache keys, for the same cache,
We have a pipeline with two steps, which are using the same cache and where both steps are working on the same code base.
The cache definition is like the following:
nodemodules:
key:
files:
- package.json
- package-lock.json
path: ./node_modules
Now in the first step (which is running on self-hosted) the log looks like this:
Cache "nodemodules: ./node_modules": Downloading
Cache "nodemodules: ./node_modules": Cache key 4f895c8d9628eef36867e7a299148ebeca2a53daa0a6f15355712ba0943d3b30
Cache "nodemodules: ./node_modules": Not found
And in the second step (which is running in the cloud) it looks like this:
Cache "nodemodules: ./node_modules": Cache key 2cb96d3f4711e32b5e18aa68998f0d648d6992a89c6ac4f968870e7916f985f8
Cache "nodemodules: ./node_modules": Downloading
Cache "nodemodules: ./node_modules": Downloaded 261.8 MiB in 7 seconds
...
Can you explain this? Am I doing something wrong?