Skip to content

Commit 5e23235

Browse files
committed
Improve documentation for the Buildbarn example
Add instructions for a simple local Buildbarn deployment to test with.
1 parent a663a93 commit 5e23235

File tree

3 files changed

+54
-23
lines changed

3 files changed

+54
-23
lines changed

examples/remote_execution/buildbarn/.buckconfig

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@
22
root = .
33
prelude = prelude
44

5-
[buck2]
6-
digest_algorithms = SHA256
7-
85
[buck2_re_client]
9-
action_cache_address = http://localhost:8980
10-
engine_address = http://localhost:8980
11-
cas_address = http://localhost:8980
6+
action_cache_address = grpc://localhost:8980
7+
engine_address = grpc://localhost:8980
8+
cas_address = grpc://localhost:8980
129
tls = false
10+
instance_name = fuse
1311

1412
[build]
1513
execution_platforms = root//platforms:platforms
Lines changed: 49 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,63 @@
1-
## Remote execution integration with Build Barn
1+
## Remote execution integration with Buildbarn
22

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

55
In this document, we will go over the key configs used in this setup.
6+
Using a local docker-compose deployment from the [example deployment repo](https://github.com/buildbarn/bb-deployments).
7+
If you already have a Buildbarn deployment you can skip that.
68

7-
### Relevant configs in .buckconfig
9+
### Deploy a local Buildbarn
810

9-
First, the Build Barn endpoint and certificate should be configured as the following:
11+
```
12+
... $ git clone https://github.com/buildbarn/bb-deployments
13+
... $ cd bb-deployments
14+
.../bb-deployments $ cd docker-compose
15+
.../bb-deployments/docker-compose $ ./run.sh
16+
```
1017

11-
```ini
12-
[buck2_re_client]
13-
engine_address = $BB_ENDPOINT
14-
action_cache_address = $BB_ENDPOINT
15-
cas_address = $BB_ENDPOINT
18+
This uses `docker-compose` to spin up the required Buildbarn services.
19+
Using FUSE based workers, those are generally the fastest as they can load action files on demand
20+
and avoids the overhead of setting up the full input root up front.
21+
In practice many actions do not read all the files in the input root.
22+
23+
If you do not want FUSE workers you can instead switch to hardlinking workers
24+
The example deployments have two worker kinds "fuse", and "hardlinking",
25+
you can see the queues in the Buildbarn scheduler, http://localhost:7982.
26+
27+
```
28+
Buildbarn Scheduler
29+
30+
...
31+
32+
Instance name Platform properties Size Timeo
33+
prefix class
34+
35+
"fuse" OSFamily="Linux" container-image="docker://ghcr.io/catthehacker/ 0 ∞
36+
ubuntu:act-22.04@sha256:5f9c35c25db1d51a8ddaae5c0ba8d3c163c5e9a4a6cc97acd409ac7eae239448"
37+
"hardlinking" OSFamily="Linux" container-image="docker://ghcr.io/catthehacker/ 0 ∞
38+
ubuntu:act-22.04@sha256:5f9c35c25db1d51a8ddaae5c0ba8d3c163c5e9a4a6cc97acd409ac7eae239448"
1639
```
1740

18-
If you're using the Docker-compose setup, the endpoint would be `http://localhost:8980` for all 3 of those.
41+
More information is available in the [repo](https://github.com/buildbarn/bb-deployments).
42+
43+
### Relevant configs in .buckconfig
44+
45+
First, the Buildbarn endpoint should be configured as the following:
1946

20-
Additionally, set the `digest_algorithm` config to `SHA256`.
2147
```ini
22-
[buck2]
23-
digest_algorithms = SHA256
48+
[buck2_re_client]
49+
engine_address = grpc://localhost:8980
50+
action_cache_address = grpc://localhost:8980
51+
cas_address = grpc://localhost:8980
52+
tls = false
53+
54+
# Select the instance name, "fuse" or "hardlinking", without quotes
55+
instance_name = fuse
2456
```
2557

26-
### Relevant configs in `ExecutionPlatformInfo`
58+
TLS is not used in this example.
2759

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

30-
The execution platform used in this project `root//platforms:platforms` do so.
62+
Buildbarn takes in a Docker image and `OSFamily` in its RE properties to select a worker.
63+
This is configured in `root//platforms:platforms`.

examples/remote_execution/buildbarn/platforms/defs.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def _platforms(ctx):
1818
local_enabled = True,
1919
remote_enabled = True,
2020
use_limited_hybrid = True,
21-
# Set those up based on what workers you've registered with Build Barn.
21+
# Set those up based on what workers you've registered with Buildbarn.
2222
remote_execution_properties = {
2323
"OSFamily": "Linux",
2424
"container-image": "docker://ghcr.io/catthehacker/ubuntu:act-22.04@sha256:5f9c35c25db1d51a8ddaae5c0ba8d3c163c5e9a4a6cc97acd409ac7eae239448",

0 commit comments

Comments
 (0)