Skip to content

Commit

Permalink
Document the use of platform properties
Browse files Browse the repository at this point in the history
Add this to the README, to identify how platform properties
in bazel are expressed and how buildbarn workers are configured.
  • Loading branch information
cphang99 committed Aug 15, 2020
1 parent 750dc3b commit 6dae722
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,48 @@ worker-ubuntu16-04_1 | xxxx/xx/xx xx:xx:xx rpc error: code = Unavailable desc =

This is usually because container of the worker has started before the scheduler and so it cannot connect. After a second or so, this error message should stop.

## Platform properties

For clients to be able to use Buildbarn, clients need to send actions with platform properties that
match the platform properties that Buildbarn workers register themselves with.

For Bazel clients, platform properties can be set in the `.bazelrc` or as command line parameters:

```
--remote_default_exec_properties=OSFamily=Linux
--remote_default_exec_properties=container-image=docker://marketplace.gcr.io/google/rbe-ubuntu16-04@sha256:b516a2d69537cb40a7c6a7d92d0008abb29fba8725243772bdaf2c83f1be2272
```

Buildbarn workers are configured with its associated `.jsonnet` configuration file.

```
{
# See worker-ubuntu16-04.jsonnet for the full worker configuration.
buildDirectories: [{
native: {
buildDirectoryPath: '/worker/build',
cacheDirectoryPath: '/worker/cache',
maximumCacheFileCount: 10000,
maximumCacheSizeBytes: 1024 * 1024 * 1024,
cacheReplacementPolicy: 'LEAST_RECENTLY_USED',
},
runners: [{
endpoint: { address: 'unix:///worker/runner' },
concurrency: 8,
platform: {
properties: [
{ name: 'OSFamily', value: 'Linux' },
{ name: 'container-image', value: 'docker://marketplace.gcr.io/google/rbe-ubuntu16-04@sha256:b516a2d69537cb40a7c6a7d92d0008abb29fba8725243772bdaf2c83f1be2272' },
],
},
defaultExecutionTimeout: '1800s',
maximumExecutionTimeout: '3600s',
workerId: {},
}],
}],
}
```

## Remote execution

Bazel can perform remote builds against these deployments by adding [the official Bazel toolchain definitions](https://releases.bazel.build/bazel-toolchains.html) for the RBE container images to the `WORKSPACE` file of your project. It is also possible to derive your own configuration files using the `rbe_autoconfig`. More information can be found by reading the documentation [here](https://github.com/bazelbuild/bazel-toolchains/blob/master/rules/rbe_repo.bzl).
Expand Down

0 comments on commit 6dae722

Please sign in to comment.