Self-hosted
This solution allows you to host any remote caching service that is compatible with the Bazel Remote Execution v2 API, such asbazel-remote. When using this solution, the following RE API features must be enabled:
- Action result caching
- Content addressable storage caching
- SHA256 digest hashing
- gRPC requests
Host your service
When you have chosen (or built) a compatible service, host it and make it available through gRPC or HTTPS. For example, if you plan to use If you’ve configured the
bazel-remote, you can do something like the following:remote.cache.compression setting to “zstd”, you’ll need to run the binary with that storage mode as well:View the official bazel-remote documentation for all the available options, like storing artifacts in S3, configuring authentication (TLS/mTLS), proxies, and more.
Configure remote caching
Once your service is running, you can enable remote caching by configuring the
remote settings in .moon/workspace.yml. At minimum, the only setting that is required is host.Cloud-hosted
Depot
If you’d prefer not to host your own solution, you could use Depot Cache, a cloud-based caching solution.Create a Depot account
- Create an account on depot.dev
- Create an organization
- Go to organization settings → API tokens
- Create a new API token
FAQ
What is an artifact?
What is an artifact?
In the context of moon and remote caching, an artifact is the outputs of a task, as well as the stdout and stderr of the task that generated the outputs. Artifacts are uniquely identified by the moon generated hash.
Do I have to use remote caching?
Do I have to use remote caching?
No, remote caching is optional. It’s intended purpose is to store long lived build artifacts to speed up CI pipelines, and optionally local development. For the most part,
moon ci does a great job of only running what’s affected in pull requests, and is a great starting point.Does remote caching store source code?
Does remote caching store source code?
No, remote caching does not store source code. It stores the outputs of a task, which is typically built and compiled code. To verify this, you can inspect the tar archives in
.moon/cache/outputs.Does moon collect any personally identifiable information?
Does moon collect any personally identifiable information?
No, moon does not collect any PII as part of the remote caching process.
Are artifacts encrypted?
Are artifacts encrypted?
We do not encrypt on moon’s side, as encryption is provided by your cloud storage provider.