This repository contains a set of scripts and configuration files that can be used to deploy Buildbarn on various platforms. Buildbarn is pretty flexible, in that it can both be used for single-node remote caching setups and large-scale remote execution setups. Unless noted otherwise, the configurations in this repository all use assume the following setup:
- Sharded storage, using the Buildbarn storage daemon. To apply the sharding to client RPCs, a separate set of stateless frontend servers is used to fan out requests.
- Remote execution of build actions, using container images based on Google RBE's official Ubuntu 16.04 image.
- An installation of the Buildbarn Browser.
- An installation of the Buildbarn Event Service.
Below is a diagram of what this setup Buildbarn looks like. In this diagram, the arrows represent the direction in which network connections are established.
Bazel can perform remote builds against these deployments by adding
the official Bazel toolchain definitions
for the RBE container images to the WORKSPACE
file of your project:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "bazel_toolchains",
sha256 = "28cb3666da80fbc62d4c46814f5468dd5d0b59f9064c0b933eee3140d706d330",
strip_prefix = "bazel-toolchains-0.27.1",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/archive/0.27.1.tar.gz",
"https://github.com/bazelbuild/bazel-toolchains/archive/0.27.1.tar.gz",
],
)
In addition to that, you will need to add
a list of generic build options
to your ~/.bazelrc
, followed by the following set of options that are
specific to your environment:
build:mycluster --bes_backend=fill-in-the-frontend-service-hostname-here:8983
build:mycluster --bes_results_url=http://fill-in-the-browser-service-hostname-here/build_events/bb-event-service/
build:mycluster --config=remote
build:mycluster --remote_executor=fill-in-the-frontend-service-hostname-here:8980
build:mycluster-ubuntu16-04 --config=mycluster
build:mycluster-ubuntu16-04 --config=rbe-ubuntu16-04
build:mycluster-ubuntu16-04 --jobs=64
build:mycluster-ubuntu16-04 --remote_instance_name=ubuntu16-04
Once added, you may perform remote builds against Buildbarn by running the command below:
bazel build --config=mycluster-ubuntu16-04 //...