Cache pull location

Where does the https://github.com/bitrise-steplib/steps-cache-pull step save the downloaded cache? Is this directory captured in an env var? I want to inspect cache in a next step.

Hi @jason.atwood!

Cache is uploaded to an S3 bucket, which you cannot inspect directly in a workflow, but you should be able to download it by going to your app’s Settings tab and scrolling down to Manage Build Caches (BETA) :slight_smile:

So does the cache stay on that S3 bucket for the next time a workflow is run? Or does the cache-pull step download the whole cache into the new container?

I see that /bitrise/cache seems to be empty after the cache-pull step

Hey,

The cache will stay on the S3 until either 7 days, or until you override it with a new branches cache :slightly_smiling_face:

Sorry I should have clarified. When Gradle needs to pull individual files from the cache, does it pull files directly from S3, or are all the cached files already downloaded to the local BR instance?

Hi @jason.atwood,

If I understand you correctly, you are asking whether or not Bitrise stores the cache on the build worker or if it is only stored on S3. If that is the case, the answer is only S3. All information on the build workers are destroyed after the build has completed one way or another.

If you are asking when the cache is pulled from S3, it happens during the cache-pull step and will pull the entire cache from S3 to the build worker so it is ready for use by your project/the tools.

Please don’t hesitate to follow-up if you have any other questions or if I didn’t answer your question entirely.

Cheers,
Luna

If you are asking when the cache is pulled from S3, it happens during the cache-pull step and will pull the entire cache from S3 to the build worker so it is ready for use by your project/the tools.

Yep that’s what I mean. What directory is this cache pulled into on the build worker? I want to print its contents after the cache-pull step.

Hi @jason.atwood,

According to https://github.com/bitrise-steplib/steps-cache-pull/blob/master/main.go#L53, the cache is downloaded to /tmp/cache-archive.tar.

Please don’t hesitate to follow-up if you have any other questions.

Ok. If I understand the -P option on the tar command, it will extract the archive files back to their absolute path. So in my case

/root/.gradle/caches/... files go right back to where they were generated in the previous run.

I was expecting everything to be put into a relative path directory something like /cache. I guess /bitrise/cache is used for a different purpose.

Thanks for your help.

Hi @jason.atwood,

That’s correct.

Please don’t hesitate to follow-up if you have any other questions.

Kind regards,
Luna

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.