logo

Bazel caching

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

Bazel caching is in early access. If you want to try Bazel caching, reach out to us.

Get in touch

Getting started

To use bazel caching, you produce a bazel configuring using the nsc CLI:

nsc bazel cache setup --bazelrc /etc/bazel.bazelrc
bazel --bazelrc=/etc/bazel.bazelrc test //..

Getting started with GitHub Actions

jobs:
build:
runs-on: namespace-profile-default
steps:
- name: Setup Bazel cache
run: |
nsc bazel cache setup --bazelrc /etc/bazel.bazelrc
- name: Bazel test
run: |
bazel --bazelrc=/etc/bazel.bazelrc test //..

The bazelrc path can be customized if you need to use a specific configuration file. See the Bazel's documentation for granularity control options.