Skip to content

Commit

Permalink
[Breaking] Make stores and schedulers lists of named specs
Browse files Browse the repository at this point in the history
To migrate, change your config like this (similar for schedulers):

```
// Old:
"stores": {
  "SOMESTORE": {
    "memory": {}
  }
}

// New:
"stores": [
  {
    "name": "SOMESTORE",
    "memory": {}
  }
]
```

Closes TraceMachina#834
  • Loading branch information
aaronmondal committed Nov 24, 2024
1 parent 99b9cbb commit 0dc6735
Show file tree
Hide file tree
Showing 14 changed files with 119 additions and 92 deletions.
11 changes: 6 additions & 5 deletions deployment-examples/docker-compose/local-storage-cas.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
// so objects are compressed, deduplicated and uses some in-memory
// optimizations for certain hot paths.
{
"stores": {
"CAS_MAIN_STORE": {
"stores": [
{
"name": "CAS_MAIN_STORE",
"compression": {
"compression_algorithm": {
"lz4": {}
Expand All @@ -21,8 +22,8 @@
}
}
}
},
"AC_MAIN_STORE": {
}, {
"name": "AC_MAIN_STORE",
"filesystem": {
"content_path": "~/.cache/nativelink/content_path-ac",
"temp_path": "~/.cache/nativelink/tmp_path-ac",
Expand All @@ -32,7 +33,7 @@
}
}
}
},
],
"servers": [{
"listener": {
"http": {
Expand Down
18 changes: 10 additions & 8 deletions deployment-examples/docker-compose/scheduler.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"stores": {
"GRPC_LOCAL_STORE": {
"stores": [
{
"name": "GRPC_LOCAL_STORE",
// Note: This file is used to test GRPC store.
"grpc": {
"instance_name": "main",
Expand All @@ -9,8 +10,8 @@
],
"store_type": "cas"
}
},
"GRPC_LOCAL_AC_STORE": {
}, {
"name": "GRPC_LOCAL_AC_STORE",
// Note: This file is used to test GRPC store.
"grpc": {
"instance_name": "main",
Expand All @@ -20,9 +21,10 @@
"store_type": "ac"
}
}
},
"schedulers": {
"MAIN_SCHEDULER": {
],
"schedulers": [
{
"name": "MAIN_SCHEDULER",
"simple": {
"supported_platform_properties": {
"cpu_count": "minimum",
Expand All @@ -31,7 +33,7 @@
}
}
}
},
],
"servers": [{
"listener": {
"http": {
Expand Down
15 changes: 8 additions & 7 deletions deployment-examples/docker-compose/worker.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"stores": {
"GRPC_LOCAL_STORE": {
"stores": [
{
"name": "GRPC_LOCAL_STORE",
// Note: This file is used to test GRPC store.
"grpc": {
"instance_name": "main",
Expand All @@ -9,8 +10,8 @@
],
"store_type": "cas"
}
},
"GRPC_LOCAL_AC_STORE": {
}, {
"name": "GRPC_LOCAL_AC_STORE",
// Note: This file is used to test GRPC store.
"grpc": {
"instance_name": "main",
Expand All @@ -19,8 +20,8 @@
],
"store_type": "ac"
}
},
"WORKER_FAST_SLOW_STORE": {
}, {
"name": "WORKER_FAST_SLOW_STORE",
"fast_slow": {
"fast": {
"filesystem": {
Expand All @@ -39,7 +40,7 @@
}
}
}
},
],
"workers": [{
"local": {
"worker_api_endpoint": {
Expand Down
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,7 @@
pkgs.cosign
pkgs.kubectl
pkgs.kubernetes-helm
pkgs.kubectx
pkgs.cilium-cli
pkgs.vale
pkgs.trivy
Expand Down
11 changes: 6 additions & 5 deletions kubernetes/configmaps/cas.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
// `~/.cache/nativelink`. When this location is mounted as a PersistentVolume
// it persists the cache across restarts.
{
"stores": {
"CAS_MAIN_STORE": {
"stores": [
{
"name": "CAS_MAIN_STORE",
"existence_cache": {
"backend": {
"compression": {
Expand All @@ -23,8 +24,8 @@
}
}
}
},
"AC_MAIN_STORE": {
}, {
"name": "AC_MAIN_STORE",
"completeness_checking": {
"backend": {
"filesystem": {
Expand All @@ -43,7 +44,7 @@
}
}
}
},
],
"servers": [{
"listener": {
"http": {
Expand Down
18 changes: 10 additions & 8 deletions kubernetes/configmaps/scheduler.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"stores": {
"GRPC_LOCAL_STORE": {
"stores": [
{
"name": "GRPC_LOCAL_STORE",
// Note: This file is used to test GRPC store.
"grpc": {
"instance_name": "main",
Expand All @@ -9,8 +10,8 @@
],
"store_type": "cas"
}
},
"GRPC_LOCAL_AC_STORE": {
}, {
"name": "GRPC_LOCAL_AC_STORE",
// Note: This file is used to test GRPC store.
"grpc": {
"instance_name": "main",
Expand All @@ -20,9 +21,10 @@
"store_type": "ac"
}
}
},
"schedulers": {
"MAIN_SCHEDULER": {
],
"schedulers": [
{
"name": "MAIN_SCHEDULER",
// TODO(adams): use the right scheduler because reclient doesn't use the cached results?
// TODO(adams): max_bytes_per_stream
"simple": {
Expand All @@ -46,7 +48,7 @@
}
}
}
},
],
"servers": [{
"listener": {
"http": {
Expand Down
15 changes: 8 additions & 7 deletions kubernetes/configmaps/worker.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"stores": {
"GRPC_LOCAL_STORE": {
"stores": [
{
"name": "GRPC_LOCAL_STORE",
// Note: This file is used to test GRPC store.
"grpc": {
"instance_name": "main",
Expand All @@ -9,8 +10,8 @@
],
"store_type": "cas"
}
},
"GRPC_LOCAL_AC_STORE": {
}, {
"name": "GRPC_LOCAL_AC_STORE",
// Note: This file is used to test GRPC store.
"grpc": {
"instance_name": "main",
Expand All @@ -19,8 +20,8 @@
],
"store_type": "ac"
}
},
"WORKER_FAST_SLOW_STORE": {
}, {
"name": "WORKER_FAST_SLOW_STORE",
"fast_slow": {
"fast": {
"filesystem": {
Expand All @@ -39,7 +40,7 @@
}
}
}
},
],
"workers": [{
"local": {
"worker_api_endpoint": {
Expand Down
18 changes: 10 additions & 8 deletions nativelink-config/examples/basic_cas.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"stores": {
"AC_MAIN_STORE": {
"stores": [
{
"name": "AC_MAIN_STORE",
"filesystem": {
"content_path": "/tmp/nativelink/data-worker-test/content_path-ac",
"temp_path": "/tmp/nativelink/data-worker-test/tmp_path-ac",
Expand All @@ -9,8 +10,8 @@
"max_bytes": 1000000000,
}
}
},
"WORKER_FAST_SLOW_STORE": {
}, {
"name": "WORKER_FAST_SLOW_STORE",
"fast_slow": {
// "fast" must be a "filesystem" store because the worker uses it to make
// hardlinks on disk to a directory where the jobs are running.
Expand All @@ -34,9 +35,10 @@
}
}
}
},
"schedulers": {
"MAIN_SCHEDULER": {
],
"schedulers": [
{
"name": "MAIN_SCHEDULER",
"simple": {
"supported_platform_properties": {
"cpu_count": "minimum",
Expand All @@ -61,7 +63,7 @@
}
}
}
},
],
"workers": [{
"local": {
"worker_api_endpoint": {
Expand Down
22 changes: 12 additions & 10 deletions nativelink-config/examples/filesystem_cas.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
// so objects are compressed, deduplicated and uses some in-memory
// optimizations for certain hot paths.
{
"stores": {
"FS_CONTENT_STORE": {
"stores": [
{
"name": "FS_CONTENT_STORE",
"compression": {
"compression_algorithm": {
"lz4": {}
Expand All @@ -21,8 +22,8 @@
}
}
}
},
"CAS_MAIN_STORE": {
}, {
"name": "CAS_MAIN_STORE",
"verify": {
"backend": {
// Because we are using a dedup store, we can bypass small objects
Expand Down Expand Up @@ -78,8 +79,8 @@
"verify_size": true,
"verify_hash": true
}
},
"AC_MAIN_STORE": {
}, {
"name": "AC_MAIN_STORE",
"filesystem": {
"content_path": "/tmp/nativelink/data/content_path-ac",
"temp_path": "/tmp/nativelink/data/tmp_path-ac",
Expand All @@ -89,9 +90,10 @@
}
}
}
},
"schedulers": {
"MAIN_SCHEDULER": {
],
"schedulers": [
{
"name": "MAIN_SCHEDULER",
"simple": {
"supported_platform_properties": {
"cpu_count": "minimum",
Expand All @@ -112,7 +114,7 @@
}
}
}
},
],
"servers": [{
"listener": {
"http": {
Expand Down
19 changes: 10 additions & 9 deletions nativelink-config/examples/redis.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
{
"stores": {
"CAS_FAST_SLOW_STORE": {
"stores": [
{
"name": "CAS_FAST_SLOW_STORE",
"redis_store": {
"addresses": ["redis://127.0.0.1:6379/"],
"mode": "cluster"
}
},
"AC_FAST_SLOW_STORE": {
}, {
"name": "AC_FAST_SLOW_STORE",
"redis_store": {
"addresses": ["redis://127.0.0.1:6379/"],
"mode": "cluster"
}
},
"AC_MAIN_STORE": {
}, {
"name": "AC_MAIN_STORE",
"completeness_checking": {
"backend": {
"ref_store": {
Expand All @@ -25,8 +26,8 @@
}
}
}
},
"CAS_MAIN_STORE": {
}, {
"name": "CAS_MAIN_STORE",
"existence_cache": {
"backend": {
"compression": {
Expand All @@ -42,7 +43,7 @@
}
}
}
},
],
"servers": [
{
"listener": {
Expand Down
Loading

0 comments on commit 0dc6735

Please sign in to comment.