Skip to main content
The Halo measurement system is built using Bazel. The resulting container images are designed to run in Kubernetes clusters.

Requirements

Your build environment must have the following components:

Bazel

Version 7.7.1 (see .bazelversion)

Operating System

GNU/Linux with x86-64 architecture

Clang

Required for C++ compilation

SWIG

Interface generation tool
Some image targets require building with glibc ≤ 2.36. Known compatible platforms include Debian Bookworm and Ubuntu 22.04.

Additional Dependencies

  • Bash - Shell scripting
  • OpenSSL 1.1.1+ - Cryptographic operations
All executable dependencies must be in your $PATH.

Quick Start

1

Run all tests

Verify your environment is set up correctly:
bazel test //src/test/...
2

Specify host platform

Some targets require explicit platform specification:
bazel build --host_platform=//build/platforms:ubuntu_22_04 //your/target
Compatible platforms are defined in //build/platforms/BUILD.bazel.
Bazel cannot auto-detect glibc versions, so you must explicitly specify the --host_platform option for targets requiring glibc ≤ 2.36.

Make Variables

Some build targets use “Make” variables defined via the --define option. These can be set on the command line or in .bazelrc.
bazel build --define=variable_name=value //your/target
Variable definitions are located in build/variables.bzl.

Containerized Builds

If your host machine doesn’t meet the requirements, use the containerized build environment.

Using the Container Script

The ghcr.io/world-federation-of-advertisers/bazel container image provides a complete build environment. Use the tools/bazel-container script as a drop-in replacement for the bazel command:
tools/bazel-container test //src/test/...
The tools/bazel-container script automatically specifies the appropriate host platform, so you should not use the --host_platform option when using it.

Interactive Container Shell

For extensive development work, you can run a shell inside the container:
docker run -it --rm \
  -v "$PWD":/workspace \
  -w /workspace \
  ghcr.io/world-federation-of-advertisers/bazel \
  /bin/bash
You can even install IntelliJ IDEA inside the container and use X11 forwarding to access it from your host.

TestContainer-based Tests

Running tests that use TestContainers inside Docker requires additional setup: The tools/bazel-container script handles these configurations automatically.

Hybrid Development

If your host has a newer glibc version but meets other requirements, you can develop locally and use the container only for building/deploying images.

Running Container-Built Targets on Host

On Linux, the tools/bazel-container script writes output to bazel-container-output in your working directory. Use the tools/bazel-container-run script to generate executable scripts:
tools/bazel-container-run //your/target
This creates a script you can execute on your host machine.

Build Targets

Test All

bazel test //src/test/...

Build Images

bazel build //path/to:image_target

Run Target

bazel run //path/to:target

Container Build

tools/bazel-container build //target

Local Kubernetes

You can deploy a minimal testing environment in a local Kubernetes cluster for development and testing purposes.

Next Steps

Testing

Learn how to run and organize tests

IntelliJ Setup

Configure your IDE for development

Build docs developers (and LLMs) love