|
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) |
6 | 7 |
|
7 |
| -### Relevant configs in .buckconfig |
| 8 | +### Deploy Buildbarn |
8 | 9 |
|
9 |
| -First, the Build Barn endpoint and certificate should be configured as the following: |
| 10 | +This is mostly a turn-key solution, with just one modification. |
| 11 | +Buck2 does not yet support instance-name prefixes for different workers [issue link](https://github.com/facebook/buck2/issues/180). |
| 12 | +So we will remove that from the deployment. |
10 | 13 |
|
11 |
| -```ini |
12 |
| -[buck2_re_client] |
13 |
| -engine_address = $BB_ENDPOINT |
14 |
| -action_cache_address = $BB_ENDPOINT |
15 |
| -cas_address = $BB_ENDPOINT |
16 | 14 | ```
|
| 15 | +... $ git clone https://github.com/buildbarn/bb-deployments |
| 16 | +... $ cd bb-deployments |
| 17 | +.../bb-deployments # Temporary workaround for issue #180: Remove the instance-name prefix |
| 18 | +.../bb-deployments $ sed -i 's/instanceNamePrefix: \'fuse\'/instanceNamePrefix: \'\'/' docker-compose/config/worker-fuse-ubuntu22-04.jsonnet |
| 19 | +.../bb-deployments $ cd docker-compose |
| 20 | +.../bb-deployments/docker-compose $ ./run.sh |
| 21 | +``` |
| 22 | + |
| 23 | +This uses `docker-compose` to spin up the required Buildbarn services. |
| 24 | +Using FUSE based workers, those are generally the fastest as they can load action files on demand |
| 25 | +and avoids the overhead of setting up the full input root up front. |
| 26 | +In practice many actions do not read all the files in the input root. |
| 27 | + |
| 28 | +If you do not want FUSE workers you can instead switch to hardlinking workers |
| 29 | +``` |
| 30 | +.../bb-deployments $ sed -i 's/instanceNamePrefix: \'hardlinking\'/instanceNamePrefix: \'\'/' docker-compose/config/worker-hardlinking-ubuntu22-04.jsonnet |
| 31 | +``` |
| 32 | + |
| 33 | +More information is available in the [repo](https://github.com/buildbarn/bb-deployments). |
| 34 | + |
| 35 | +### Relevant configs in .buckconfig |
17 | 36 |
|
18 |
| -If you're using the Docker-compose setup, the endpoint would be `http://localhost:8980` for all 3 of those. |
| 37 | +First, the Buildbarn endpoint should be configured as the following: |
19 | 38 |
|
20 |
| -Additionally, set the `digest_algorithm` config to `SHA256`. |
21 | 39 | ```ini
|
22 |
| -[buck2] |
23 |
| -digest_algorithms = SHA256 |
| 40 | +[buck2_re_client] |
| 41 | +engine_address = grpc://localhost:8980 |
| 42 | +action_cache_address = grpc://localhost:8980 |
| 43 | +cas_address = grpc://localhost:8980 |
24 | 44 | ```
|
25 | 45 |
|
26 |
| -### Relevant configs in `ExecutionPlatformInfo` |
| 46 | +No TLS is used in this example (for history see this [issue](https://github.com/facebook/buck2/issues/156)). |
27 | 47 |
|
28 |
| -Build Barn takes in a Docker image and OSFamily in its RE properties to select a worker. |
| 48 | +### Relevant configs in `ExecutionPlatformInfo` |
29 | 49 |
|
30 |
| -The execution platform used in this project `root//platforms:platforms` do so. |
| 50 | +The Buildbarn workers take in a Docker image as their execution platform. |
| 51 | +The execution platform used in this project `root//platforms:platforms` uses the `container-image` key to set this up. |
0 commit comments