Skip to content

Commit

Permalink
Improve documentation for the Buildbarn example
Browse files Browse the repository at this point in the history
  • Loading branch information
stagnation committed Apr 19, 2023
1 parent 311ff86 commit 36e1e37
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 22 deletions.
9 changes: 3 additions & 6 deletions examples/remote_execution/buildbarn/.buckconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@
root = .
prelude = prelude

[buck2]
digest_algorithms = SHA256

[buck2_re_client]
action_cache_address = http://localhost:8980
engine_address = http://localhost:8980
cas_address = http://localhost:8980
action_cache_address = grpc://localhost:8980
engine_address = grpc://localhost:8980
cas_address = grpc://localhost:8980

[build]
execution_platforms = root//platforms:platforms
45 changes: 30 additions & 15 deletions examples/remote_execution/buildbarn/README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,45 @@
## Remote execution integration with Build Barn
## Remote execution integration with Buildbarn

This project provides a small example of what a project that utilizes [Build Barn](https://github.com/buildbarn) for RE might look like.
This project provides a small example of what a project that utilizes [Buildbarn](https://github.com/buildbarn).

In this document, we will go over the key configs used in this setup.
Using a local docker-compose deployment from the [example deployment repo](https://github.com/buildbarn/bb-deployments)

### Relevant configs in .buckconfig
### Deploy Buildbarn

First, the Build Barn endpoint and certificate should be configured as the following:
```
... $ git clone https://github.com/buildbarn/bb-deployments
... $ cd bb-deployments
.../bb-deployments $ cd docker-compose
.../bb-deployments/docker-compose $ ./run.sh
```

```ini
[buck2_re_client]
engine_address = $BB_ENDPOINT
action_cache_address = $BB_ENDPOINT
cas_address = $BB_ENDPOINT
This uses `docker-compose` to spin up the required Buildbarn services.
Using FUSE based workers, those are generally the fastest as they can load action files on demand
and avoids the overhead of setting up the full input root up front.
In practice many actions do not read all the files in the input root.

If you do not want FUSE workers you can instead switch to hardlinking workers
```
... TODO: update after #181
```

If you're using the Docker-compose setup, the endpoint would be `http://localhost:8980` for all 3 of those.
More information is available in the [repo](https://github.com/buildbarn/bb-deployments).

### Relevant configs in .buckconfig

First, the Buildbarn endpoint should be configured as the following:

Additionally, set the `digest_algorithm` config to `SHA256`.
```ini
[buck2]
digest_algorithms = SHA256
[buck2_re_client]
engine_address = grpc://localhost:8980
action_cache_address = grpc://localhost:8980
cas_address = grpc://localhost:8980
```

### Relevant configs in `ExecutionPlatformInfo`
No TLS is used in this example.

Build Barn takes in a Docker image and OSFamily in its RE properties to select a worker.
### Relevant configs in `ExecutionPlatformInfo`

Buildbarn takes in a Docker image and OSFamily in its RE properties to select a worker.
The execution platform used in this project `root//platforms:platforms` do so.
2 changes: 1 addition & 1 deletion examples/remote_execution/buildbarn/platforms/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def _platforms(ctx):
local_enabled = True,
remote_enabled = True,
use_limited_hybrid = True,
# Set those up based on what workers you've registered with Build Barn.
# Set those up based on what workers you've registered with Buildbarn.
remote_execution_properties = {
"OSFamily": "Linux",
"container-image": "docker://ghcr.io/catthehacker/ubuntu:act-22.04@sha256:5f9c35c25db1d51a8ddaae5c0ba8d3c163c5e9a4a6cc97acd409ac7eae239448",
Expand Down

0 comments on commit 36e1e37

Please sign in to comment.