Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make stores and schedulers lists of named specs #1496

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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
2 changes: 2 additions & 0 deletions nativelink-config/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ rust_test_suite(
name = "integration",
timeout = "short",
srcs = [
"tests/backwards_compat_test.rs",
"tests/deserialization_test.rs",
],
deps = [
Expand All @@ -40,6 +41,7 @@ rust_test_suite(
"@crates//:humantime",
"@crates//:pretty_assertions",
"@crates//:serde",
"@crates//:serde_json",
"@crates//:serde_json5",
],
)
Expand Down
1 change: 1 addition & 0 deletions nativelink-config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ shellexpand = { version = "3.1.0", default-features = false, features = ["base-0

[dev-dependencies]
pretty_assertions = { version = "1.4.1", features = ["std"] }
serde_json = "1.0.133"
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
Loading