Thanks to visit codestin.com
Credit goes to github.com

Skip to content

A bazel remote cache implementation for azure blob storage that supports injecting auth into bazel grpc requests

License

Notifications You must be signed in to change notification settings

Azure/azcu-bazel-cache

Repository files navigation

Bazel Azure Blob Storage Cache

This an an implementation of the bazel remote cache that stores data in Azure Blob storage.

The project is essentially feature complete, outside of exposing certain configuration options. It is not currently being used in production but there has been a fair amount of testing (both manual and automated) to ensure that the implementation is correct.

This is intended to be used as a library to build your own integration with.

There are two components:

Proxy

The proxy is meant to be run local to where bazel is executing. Configure bazel to send cache to the proxy, and the proxy can send to the actual caching backend.

The proxy is reseponsible for authenticating with Azure and injecting those short-lived authentication tokens along in the GRPC request metadata.

Note: bazel itself is (currently) only capable of doing basic auth. This is where the proxy comes in to inject azure auth tokens into the GRPC request sent by bazel.

Server

The server is responsible for managing the data in the azure blob store. This is what actually does the work of the bazel remote caches.

The server will look for authentication tokens from the GRPC request metadata.

Bazel has two sets of caches:

  1. Action cache - Bazel hashes all the build inputs into a digest. The digest used to lookup action cache data which contains digests of all the outputs. In effect the action cache acts as a cache index for a set of build inputs so that bazel can find what is cached. These should all typically be small files.

  2. CAS - The CAS (or content addressable store) is (generally) what the action cache points to. It is where all the data that bazel wants to cache lives. Files can range from very small to very large.

The server allows you to choose how to store each of these, e.g. what storage account, container, and path.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

About

A bazel remote cache implementation for azure blob storage that supports injecting auth into bazel grpc requests

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages