|
1 | | -## Remote execution integration with Build Barn |
| 1 | +## Remote execution integration with Buildbarn |
2 | 2 |
|
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). |
4 | 4 |
|
5 | 5 | 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. |
6 | 8 |
|
7 | | -### Relevant configs in .buckconfig |
| 9 | +### Deploy a local Buildbarn |
8 | 10 |
|
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 | +``` |
10 | 17 |
|
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" |
16 | 39 | ``` |
17 | 40 |
|
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: |
19 | 46 |
|
20 | | -Additionally, set the `digest_algorithm` config to `SHA256`. |
21 | 47 | ```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 |
24 | 56 | ``` |
25 | 57 |
|
26 | | -### Relevant configs in `ExecutionPlatformInfo` |
| 58 | +TLS is not used in this example. |
27 | 59 |
|
28 | | -Build Barn takes in a Docker image and OSFamily in its RE properties to select a worker. |
| 60 | +### Relevant configs in `ExecutionPlatformInfo` |
29 | 61 |
|
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`. |
0 commit comments