Overview

This document is for owners and maintainers of Bazel rule repositories. It
describes how to configure the Bazel Continuous Integration (CI) system for your
repository to test your rules for compatibility against a remote execution
scenario. The instructions in this document apply to projects stored in GitHub
repositories.

To view build results, click Details for the RBE (Ubuntu
16.04) pull request check in GItHub, as shown in the figure below. This link
becomes available after the pull request has been merged and the CI tests
have run. (See
example results.)

(Optional) Set the bazel test (RBE (Ubuntu 16.04)) check as a test
required to pass before merging in your branch protection rule. The setting
is located in GitHub in Settings > Branches > Branch protection rules,
as shown in the following figure.

Troubleshooting failed builds and tests

If your build or tests fail, it’s likely due to the following:

Required build or test tools are not installed in the default container.
Builds using the rbe_ubuntu1604 config run by default inside an
rbe-ubuntu16-04
container, which includes tools common to many Bazel builds. However, if
your rules require tools not present in the default container, you must
create a custom container based on the
rbe-ubuntu16-04
container and include those tools as described later in this document.

Specifying the build platform definition

You must include a Bazel platform configuration in your
custom toolchain configuration, which allows Bazel to select a toolchain
appropriate to the desired hardware/software platform. See this
example platform configuration
for the TensorFlow ubuntu16-04 container.

Create a similar configuration (that is, using the same constraints) but replace
the value of the container-image property with the name of your custom
container, as well as your GCR project ID and container image checksum. For
example: