Bazel integration
Bazel is a popular build system optimized for polyglot, large monorepos.
Namespace provides high-performance Bazel caching with very low network latency between runners and the cache storage. This allows your Bazel workflows to reuse build artifacts across runs, irrespective of your chosen granularity, significantly reducing build times.
Bazel caching is particularly effective for:
- Build steps that are time-consuming to execute but produce relatively small outputs
- Projects where compilation is typically slow, such as Rust and C++ codebases
- Workflows that can benefit from cross-invocation artifact reuse
Getting started
To use Bazel caching, you can produce a ready-to-use configuration using the CLI:
Configure cache access
$ nsc bazel cache setup --bazelrc /etc/bazel.bazelrc
This command generates short-term credentials, and sets up a bazelrc
configuration file.
Use the Bazel cache
$ bazel --bazelrc=/etc/bazel.bazelrc test //..
You can pass multiple configuration files by setting --bazelrc
repeatedly, allowing you to combine your existing configuration with Namespace cache access.
See Bazel's documentation for granularity control options.
GitHub Actions Example
Configure cache access
When using Namespace runners, you can enable Bazel caching directly in your profile configuration.

Use the Bazel cache
In your workflow, you only need to select the corresponding profile. Bazel is already configured to use the Namespace cache.
jobs:
build:
runs-on: namespace-profile-with-bazel
steps:
- name: Bazel test
run: bazel test //..
How it works
The Bazel caching solution employs a tiered caching approach, where the hot cache lives as close to the consumer (e.g. your CI job runner) as possible. The cold caching tier is backed by our high-performance artifact storage and enables Bazel to retain a vast amount of cached artifacts.
Access to the Bazel cache is granted through short-lived secure credentials.
Usage
Namespace accounts Bazel cache usage in two categories:
- Bazel cache storage
- Bazel cache reads
For detailed billing information for each item as well as included amounts in your plans, visit the pricing page.
What's next?
Namespace is highly invested in accelerating Bazel builds through a deeper framework integration. Next up is the ability to horizontally scale your Bazel builds through remote execution on Namespace compute. Reach out to sign up for early access.