Does there exist a way to use remote cache with DirectoryBuildCache? I tried to use it and encouraged the following problems, DirectoryBuildCache implementation requires cache directory to be writable and puts lock on it for non CI build (with isPush disabled).
I am not sure what you want to achieve. What does your configuration look like for configuring the remote cache?
The DirectoryBuildCache is meant as a local cache which is shared between build outputs on the same machine (or in the same container). If you want to share build outputs between different machines (or containers) please use an actual remote cache like the (free) build cache node.
Hi Stefan,
I wanted to try DirectoryBuildCache as remote cache, I wasn’t able to find any information that restricts such use case, so I tried it.
Configuration was:
val isCiServer = System.getenv().containsKey(“CI”)
so what you want is a read-only, shareable version of the DirectoryBuildCache? We don’t support this, yet, since we also track access of the entries in the cache, so it can be cleaned up. What happens if you make the file system readable? Are the locks too exclusive to allow parallel usage of the cache?
We currently don’t support your use-case with the directory build cache.
It would also great to detail your use-case better, so maybe the Gradle team can provide something out of the box for you. IIUC, you want to share a pre-populated version of a build cache between different Gradle processes on the same machine.
how do you populate the build cache?
what are the different Gradle processes doing on the machine?
The use-case is sharing pre-populated cache between different machines using shared nfs folder.
Which is updated only by CI.
The initial idea was to try the cache without using the server (it should be simpler at least for evaluation), because it does not work out of the box we moved to cache node.
thank you for the insights. I think we won’t be supporting sharing the cache via NFS in the mid-term. The solution to use the cache node is the best right now.