Skip to content

Commit

Permalink
Use an empty instance_name in docker compose example (TraceMachina#1486)
Browse files Browse the repository at this point in the history
Previously, the `docker compose` example used a default `instance_name`
of "main", which meant that `--remote_instance_name=main` needed to be
added to Bazel to get it to work as expected. This can be confusing for
people who are just getting started and unfamiliar with all of the
available configuration options. Since the value defaults to an empty
string if this configuration item isn't provided, using that in the
example should make it easier for someone to spin-up.
  • Loading branch information
swarren12 authored Nov 25, 2024
1 parent afe0f4c commit 458527f
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 18 deletions.
2 changes: 0 additions & 2 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,9 @@ build --test_output=errors

build:debug -c dbg

build:self_test --remote_instance_name=main
build:self_test --remote_cache=grpc://127.0.0.1:50051

build:self_execute --remote_executor=grpc://127.0.0.1:50052
build:self_execute --remote_instance_name=main
build:self_execute --remote_default_exec_properties=cpu_count=1
build:self_execute --platform_suffix=self-execute

Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,15 +159,13 @@ jobs:
docker run --rm --net=host -w /root/nativelink -v $PWD:/root/nativelink trace_machina/nativelink:builder sh -c ' \
bazel clean && \
bazel test //... \
--remote_instance_name=main \
--remote_cache=grpc://127.0.0.1:50051 \
--remote_executor=grpc://127.0.0.1:50052 \
--remote_default_exec_properties=cpu_count=1 \
' && \
docker run --rm --net=host -w /root/nativelink -v $PWD:/root/nativelink trace_machina/nativelink:builder sh -c ' \
bazel clean && \
bazel test //... \
--remote_instance_name=main \
--remote_cache=grpc://127.0.0.1:50051 \
--remote_executor=grpc://127.0.0.1:50052 \
--remote_default_exec_properties=cpu_count=1 \
Expand Down
1 change: 0 additions & 1 deletion deployment-examples/docker-compose/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ something like:

```sh
bazel test //... \
--remote_instance_name=main \
--remote_cache=grpc://127.0.0.1:50051 \
--remote_executor=grpc://127.0.0.1:50052 \
--remote_default_exec_properties=cpu_count=1
Expand Down
17 changes: 11 additions & 6 deletions deployment-examples/docker-compose/local-storage-cas.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,19 @@
},
"services": {
"cas": {
"main": {
"": {
"cas_store": "CAS_MAIN_STORE"
}
},
"ac": {
"main": {
"": {
"ac_store": "AC_MAIN_STORE"
}
},
"capabilities": {},
"bytestream": {
"cas_stores": {
"main": "CAS_MAIN_STORE",
"": "CAS_MAIN_STORE",
}
}
}
Expand All @@ -80,21 +80,26 @@
}
}
},
// Each of the services below is keyed on an instance_name.
// By default, an empty string is used, but if a different
// instance_name is provided, the instance name must be
// specified by the invoking tool (e.g. using
// `--remote_instance_name=` for Bazel)
"services": {
"cas": {
"main": {
"": {
"cas_store": "CAS_MAIN_STORE"
}
},
"ac": {
"main": {
"": {
"ac_store": "AC_MAIN_STORE"
}
},
"capabilities": {},
"bytestream": {
"cas_stores": {
"main": "CAS_MAIN_STORE",
"": "CAS_MAIN_STORE",
}
},
"health": {},
Expand Down
15 changes: 10 additions & 5 deletions deployment-examples/docker-compose/scheduler.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"GRPC_LOCAL_STORE": {
// Note: This file is used to test GRPC store.
"grpc": {
"instance_name": "main",
"instance_name": "",
"endpoints": [
{"address": "grpc://${CAS_ENDPOINT:-127.0.0.1}:50051"}
],
Expand All @@ -13,7 +13,7 @@
"GRPC_LOCAL_AC_STORE": {
// Note: This file is used to test GRPC store.
"grpc": {
"instance_name": "main",
"instance_name": "",
"endpoints": [
{"address": "grpc://${CAS_ENDPOINT:-127.0.0.1}:50051"}
],
Expand All @@ -38,20 +38,25 @@
"socket_address": "0.0.0.0:50052",
}
},
// Each of the services below is keyed on an instance_name.
// By default, an empty string is used, but if a different
// instance_name is provided, the instance name must be
// specified by the invoking tool (e.g. using
// `--remote_instance_name=` for Bazel)
"services": {
"ac": {
"main": {
"": {
"ac_store": "GRPC_LOCAL_AC_STORE"
}
},
"execution": {
"main": {
"": {
"cas_store": "GRPC_LOCAL_STORE",
"scheduler": "MAIN_SCHEDULER",
}
},
"capabilities": {
"main": {
"": {
"remote_execution": {
"scheduler": "MAIN_SCHEDULER",
}
Expand Down
4 changes: 2 additions & 2 deletions deployment-examples/docker-compose/worker.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"GRPC_LOCAL_STORE": {
// Note: This file is used to test GRPC store.
"grpc": {
"instance_name": "main",
"instance_name": "",
"endpoints": [
{"address": "grpc://${CAS_ENDPOINT:-127.0.0.1}:50051"}
],
Expand All @@ -13,7 +13,7 @@
"GRPC_LOCAL_AC_STORE": {
// Note: This file is used to test GRPC store.
"grpc": {
"instance_name": "main",
"instance_name": "",
"endpoints": [
{"address": "grpc://${CAS_ENDPOINT:-127.0.0.1}:50051"}
],
Expand Down

0 comments on commit 458527f

Please sign in to comment.