-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document the use of platform properties #45
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,6 +46,35 @@ 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 | ||
``` | ||
|
||
Note this is only necessary when the [bazel-toolchains](https://github.com/bazelbuild/bazel-toolchains) repository is not being used. Otherwise, platform properties are set via the [bazel platform](https://github.com/bazelbuild/bazel-toolchains/blob/master/configs/ubuntu16_04_clang/11.0.0/bazel_3.1.0/config/BUILD#L43) selected in [`rbe_autoconfig`](https://github.com/buildbarn/bb-deployments/blob/master/WORKSPACE#L93), and referenced using the [`--extra_execution_platforms`](https://github.com/buildbarn/bb-deployments/blob/master/bazelrc#L4) parameter. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe good to mention also that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When I see links to files in Git repositories, I'm always worried that the links become broken over time. Especially when line number anchors are used. Could you please replace the word |
||
|
||
Buildbarn workers are configured with its associated `.jsonnet` configuration file as part of the [runner](https://github.com/buildbarn/bb-remote-execution/blob/master/pkg/proto/configuration/bb_worker/bb_worker.proto#L102) configuration. | ||
|
||
``` | ||
# See worker-ubuntu16-04.jsonnet for the full worker configuration. | ||
runners: [{ | ||
# .. Additional runner configuration here | ||
cphang99 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
platform: { | ||
properties: [ | ||
{ name: 'OSFamily', value: 'Linux' }, | ||
{ name: 'container-image', value: 'docker://marketplace.gcr.io/google/rbe-ubuntu16-04@sha256:b516a2d69537cb40a7c6a7d92d0008abb29fba8725243772bdaf2c83f1be2272' }, | ||
], | ||
}, | ||
}], | ||
``` | ||
|
||
## 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). | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though I guess you normally never set those, because bazel-toolchains sets those for you, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mm that's fair. Related to the comment about the `try a build section' being a bit lost, maybe this needs to be its own section, distinct from the remote-execution section?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved it, let me know if that works for you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That place seems better. Thanks! Do make sure to explicitly mention that this isn’t needed for bazel-toolchain users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeh. I think that it would be helpful for bazel-toolchain users to document how the bazel platform referenced in
rbe_autoconfig
relates to the platform defined in the runner configuration, so I've just expanded that out a bit.