diff --git a/docs/remote_execution.md b/docs/remote_execution.md index fd1e6d96f76b1..043a227dc8adf 100644 --- a/docs/remote_execution.md +++ b/docs/remote_execution.md @@ -16,7 +16,7 @@ Keys supported include: * `engine_address` - address to your RE's engine. * `action_cache_address` - address to your action cache endpoint. * `cas_address` - address to your content-addressable storage (CAS) endpoint. -* `tls_ca_certs` - path to a CA certificates bundle. This must be PEM-encoded. If none is set, a default bundle will be used. This path contain environment variables using shell interpolation syntax (i.e. $VAR). They will be substituted before reading the file. +* `tls_ca_certs` - path to a CA certificates bundle. This must be PEM-encoded. If none is set, a default bundle will be used. This path contains environment variables using shell interpolation syntax (i.e. $VAR). They will be substituted before reading the file. * `tls_client_cert` - path to a client certificate (and intermediate chain), as well as its associated private key. This must be PEM-encoded. This path can contain environment variables using shell interpolation syntax (i.e. $VAR). They will be substituted before reading the file. * `http_headers` - HTTP headers to inject in all requests to RE. This is a comma-separated list of `Header: Value` pairs. Minimal validation of those headers is done here. This can contain environment variables using shell interpolation syntax ($VAR). They will be substituted before reading the file. diff --git a/examples/remote_execution/buildbarn/.buckconfig b/examples/remote_execution/buildbarn/.buckconfig index e12da5a522b57..26aad816249e4 100644 --- a/examples/remote_execution/buildbarn/.buckconfig +++ b/examples/remote_execution/buildbarn/.buckconfig @@ -2,14 +2,12 @@ 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 tls = false +instance_name = fuse [build] execution_platforms = root//platforms:platforms diff --git a/examples/remote_execution/buildbarn/README.md b/examples/remote_execution/buildbarn/README.md index 38ec72c4e931c..3953c28f8d08d 100644 --- a/examples/remote_execution/buildbarn/README.md +++ b/examples/remote_execution/buildbarn/README.md @@ -1,30 +1,63 @@ -## 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). +If you already have a Buildbarn deployment you can skip that. -### Relevant configs in .buckconfig +### Deploy a local 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 +The example deployments have two worker kinds "fuse", and "hardlinking", +you can see the queues in the Buildbarn scheduler, http://localhost:7982. + +``` +Buildbarn Scheduler + +... + +Instance name Platform properties Size Timeo + prefix class + +"fuse" OSFamily="Linux" container-image="docker://ghcr.io/catthehacker/ 0 ∞ + ubuntu:act-22.04@sha256:5f9c35c25db1d51a8ddaae5c0ba8d3c163c5e9a4a6cc97acd409ac7eae239448" +"hardlinking" OSFamily="Linux" container-image="docker://ghcr.io/catthehacker/ 0 ∞ + ubuntu:act-22.04@sha256:5f9c35c25db1d51a8ddaae5c0ba8d3c163c5e9a4a6cc97acd409ac7eae239448" ``` -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 +tls = false + +# Select the instance name, "fuse" or "hardlinking", without quotes +instance_name = fuse ``` -### Relevant configs in `ExecutionPlatformInfo` +TLS is not 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` -The execution platform used in this project `root//platforms:platforms` do so. +Buildbarn takes in a Docker image and `OSFamily` in its RE properties to select a worker. +This is configured in `root//platforms:platforms`. diff --git a/examples/remote_execution/buildbarn/platforms/defs.bzl b/examples/remote_execution/buildbarn/platforms/defs.bzl index 74b385a66a74f..a013cb508d01f 100644 --- a/examples/remote_execution/buildbarn/platforms/defs.bzl +++ b/examples/remote_execution/buildbarn/platforms/defs.bzl @@ -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", diff --git a/examples/remote_execution/engflow/README.md b/examples/remote_execution/engflow/README.md index ed833f8ff2cf9..c84964edfbd94 100644 --- a/examples/remote_execution/engflow/README.md +++ b/examples/remote_execution/engflow/README.md @@ -1,6 +1,6 @@ ## Remote execution integration with EngFlow -This project provides a small example of what a project that utilizies [EngFlow](https://www.engflow.com/)'s RE offering might look like. +This project provides a small example of what a project that utilizes [EngFlow](https://www.engflow.com/)'s RE offering might look like. In this document, we will go over the key configs used in this setup.