Skip to content

Commit

Permalink
Rename example configs to json5 (#1508)
Browse files Browse the repository at this point in the history
  • Loading branch information
SchahinRohani authored Dec 6, 2024
1 parent 8671931 commit c84f793
Show file tree
Hide file tree
Showing 14 changed files with 92 additions and 92 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ for how to build the images yourself.

```bash
curl -O \
https://raw.githubusercontent.com/TraceMachina/nativelink/main/nativelink-config/examples/basic_cas.json
https://raw.githubusercontent.com/TraceMachina/nativelink/main/nativelink-config/examples/basic_cas.json5

# See https://github.com/TraceMachina/nativelink/pkgs/container/nativelink
# to find the latest tag
docker run \
-v $(pwd)/basic_cas.json:/config \
-v $(pwd)/basic_cas.json5:/config \
-p 50051:50051 \
ghcr.io/tracemachina/nativelink:v0.5.3 \
config
Expand All @@ -88,13 +88,13 @@ docker run \
```powershell
# Download the configuration file
Invoke-WebRequest `
-Uri "https://raw.githubusercontent.com/TraceMachina/nativelink/main/nativelink-config/examples/basic_cas.json" `
-OutFile "basic_cas.json"
-Uri "https://raw.githubusercontent.com/TraceMachina/nativelink/main/nativelink-config/examples/basic_cas.json5" `
-OutFile "basic_cas.json5"
# Run the Docker container
# Note: Adjust the path if the script is not run from the directory containing basic_cas.json
docker run `
-v ${PWD}/basic_cas.json:/config `
-v ${PWD}/basic_cas.json5:/config `
-p 50051:50051 `
ghcr.io/tracemachina/nativelink:v0.5.3 `
config
Expand All @@ -116,9 +116,9 @@ it via the [next-gen nix installer](https://github.com/NixOS/experimental-nix-in

```bash
curl -O \
https://raw.githubusercontent.com/TraceMachina/nativelink/main/nativelink-config/examples/basic_cas.json
https://raw.githubusercontent.com/TraceMachina/nativelink/main/nativelink-config/examples/basic_cas.json5

nix run github:TraceMachina/nativelink ./basic_cas.json
nix run github:TraceMachina/nativelink ./basic_cas.json5
```

See the [contribution docs](https://nativelink.com/docs/contribute/nix) for further information.
Expand Down
6 changes: 3 additions & 3 deletions deployment-examples/docker-compose/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ services:
RUST_LOG: ${RUST_LOG:-warn}
ports: [ "50051:50051/tcp", "127.0.0.1:50061:50061", "50071:50071/tcp", ]
command: |
nativelink /root/local-storage-cas.json
nativelink /root/local-storage-cas.json5
nativelink_scheduler:
image: trace_machina/nativelink:latest
Expand All @@ -51,7 +51,7 @@ services:
CAS_ENDPOINT: nativelink_local_cas
ports: [ "50052:50052/tcp" ]
command: |
nativelink /root/scheduler.json
nativelink /root/scheduler.json5
nativelink_executor:
image: trace_machina/nativelink:latest
Expand All @@ -71,4 +71,4 @@ services:
CAS_ENDPOINT: nativelink_local_cas
SCHEDULER_ENDPOINT: nativelink_scheduler
command: |
nativelink /root/worker.json
nativelink /root/worker.json5
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"temp_path": "~/.cache/nativelink/tmp_path-cas",
"eviction_policy": {
// 10gb.
"max_bytes": 10000000000,
"max_bytes": 10000000000
}
}
}
Expand All @@ -28,7 +28,7 @@
"temp_path": "~/.cache/nativelink/tmp_path-ac",
"eviction_policy": {
// 500mb.
"max_bytes": 500000000,
"max_bytes": 500000000
}
}
}
Expand All @@ -53,7 +53,7 @@
"capabilities": {},
"bytestream": {
"cas_stores": {
"": "CAS_MAIN_STORE",
"": "CAS_MAIN_STORE"
}
}
}
Expand Down Expand Up @@ -99,10 +99,10 @@
"capabilities": {},
"bytestream": {
"cas_stores": {
"": "CAS_MAIN_STORE",
"": "CAS_MAIN_STORE"
}
},
"health": {},
"health": {}
}
}]
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"servers": [{
"listener": {
"http": {
"socket_address": "0.0.0.0:50052",
"socket_address": "0.0.0.0:50052"
}
},
// Each of the services below is keyed on an instance_name.
Expand All @@ -52,21 +52,21 @@
"execution": {
"": {
"cas_store": "GRPC_LOCAL_STORE",
"scheduler": "MAIN_SCHEDULER",
"scheduler": "MAIN_SCHEDULER"
}
},
"capabilities": {
"": {
"remote_execution": {
"scheduler": "MAIN_SCHEDULER",
"scheduler": "MAIN_SCHEDULER"
}
}
}
}
}, {
"listener": {
"http": {
"socket_address": "0.0.0.0:50061",
"socket_address": "0.0.0.0:50061"
}
},
"services": {
Expand All @@ -75,9 +75,9 @@
// In other words, this service is a backend api. The ones above
// are a frontend api.
"worker_api": {
"scheduler": "MAIN_SCHEDULER",
"scheduler": "MAIN_SCHEDULER"
},
"health": {},
"health": {}
}
}]
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
"temp_path": "/root/.cache/nativelink/data-worker-test/tmp_path-cas",
"eviction_policy": {
// 10gb.
"max_bytes": 10000000000,
"max_bytes": 10000000000
}
}
},
"slow": {
"ref_store": {
"name": "GRPC_LOCAL_STORE",
"name": "GRPC_LOCAL_STORE"
}
}
}
Expand All @@ -43,11 +43,11 @@
"workers": [{
"local": {
"worker_api_endpoint": {
"uri": "grpc://${SCHEDULER_ENDPOINT:-127.0.0.1}:50061",
"uri": "grpc://${SCHEDULER_ENDPOINT:-127.0.0.1}:50061"
},
"cas_fast_slow_store": "WORKER_FAST_SLOW_STORE",
"upload_action_result": {
"ac_store": "GRPC_LOCAL_AC_STORE",
"ac_store": "GRPC_LOCAL_AC_STORE"
},
"work_directory": "/root/.cache/nativelink/work",
"platform_properties": {
Expand Down
6 changes: 3 additions & 3 deletions kubernetes/base/nativelink.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ spec:
- containerPort: 50061
volumeMounts:
- name: nativelink-config
mountPath: /nativelink-config.json
subPath: nativelink-config.json
mountPath: /nativelink-config.json5
subPath: nativelink-config.json5
- name: tls-volume
mountPath: /root
readOnly: true
args: ["/nativelink-config.json"]
args: ["/nativelink-config.json5"]
volumes:
- name: nativelink-config
configMap:
Expand Down
6 changes: 3 additions & 3 deletions kubernetes/base/worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ spec:
value: nativelink
volumeMounts:
- name: worker-config
mountPath: /worker.json
subPath: worker.json
mountPath: /worker.json5
subPath: worker.json5
- name: shared
mountPath: /shared
command: ["/shared/nativelink"]
args: ["/worker.json"]
args: ["/worker.json5"]
volumes:
- name: shared
emptyDir: {}
Expand Down
4 changes: 2 additions & 2 deletions kubernetes/configmaps/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ kind: Kustomization
configMapGenerator:
- name: nativelink-config
files:
- nativelink-config.json
- nativelink-config.json5
options:
annotations:
kustomize.toolkit.fluxcd.io/substitute: disabled
- name: worker
files:
- worker.json
- worker.json5
options:
annotations:
kustomize.toolkit.fluxcd.io/substitute: disabled
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"content_path": "~/.cache/nativelink/content_path-cas",
"temp_path": "~/.cache/nativelink/tmp_path-cas",
"eviction_policy": {
"max_bytes": "10Gb",
"max_bytes": "10Gb"
}
}
}
Expand All @@ -30,7 +30,7 @@
"content_path": "~/.cache/nativelink/content_path-ac",
"temp_path": "~/.cache/nativelink/tmp_path-ac",
"eviction_policy": {
"max_bytes": "500Mb",
"max_bytes": "500Mb"
}
}
},
Expand Down Expand Up @@ -63,7 +63,7 @@
"cpu_model": "priority",
"kernel_version": "priority",
"OSFamily": "priority",
"container-image": "priority",
"container-image": "priority"
}
}
}
Expand Down Expand Up @@ -101,20 +101,20 @@
"capabilities": {
"": {
"remote_execution": {
"scheduler": "MAIN_SCHEDULER",
"scheduler": "MAIN_SCHEDULER"
}
}
},
"execution": {
"": {
"cas_store": "CAS_MAIN_STORE",
"scheduler": "MAIN_SCHEDULER",
"scheduler": "MAIN_SCHEDULER"
}
},
"bytestream": {
"cas_stores": {
"": "CAS_MAIN_STORE",
},
"": "CAS_MAIN_STORE"
}
}
}
},
Expand Down Expand Up @@ -142,27 +142,27 @@
"capabilities": {
"": {
"remote_execution": {
"scheduler": "MAIN_SCHEDULER",
"scheduler": "MAIN_SCHEDULER"
}
}
},
"execution": {
"": {
"cas_store": "CAS_MAIN_STORE",
"scheduler": "MAIN_SCHEDULER",
"scheduler": "MAIN_SCHEDULER"
}
},
"bytestream": {
"cas_stores": {
"": "CAS_MAIN_STORE",
},
"": "CAS_MAIN_STORE"
}
}
}
},
{
"listener": {
"http": {
"socket_address": "0.0.0.0:50061",
"socket_address": "0.0.0.0:50061"
}
},
"services": {
Expand All @@ -171,9 +171,9 @@
// In other words, this service is a backend api. The ones above
// are a frontend api.
"worker_api": {
"scheduler": "MAIN_SCHEDULER",
"scheduler": "MAIN_SCHEDULER"
},
"health": {},
"health": {}
}
}]
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
},
"slow": {
"ref_store": {
"name": "GRPC_LOCAL_STORE",
"name": "GRPC_LOCAL_STORE"
}
}
}
Expand All @@ -42,25 +42,25 @@
"workers": [{
"local": {
"worker_api_endpoint": {
"uri": "grpc://${NATIVELINK_ENDPOINT:-127.0.0.1}:50061",
"uri": "grpc://${NATIVELINK_ENDPOINT:-127.0.0.1}:50061"
},
"cas_fast_slow_store": "WORKER_FAST_SLOW_STORE",
"upload_action_result": {
"ac_store": "GRPC_LOCAL_AC_STORE",
"ac_store": "GRPC_LOCAL_AC_STORE"
},
"work_directory": "~/.cache/nativelink/work",
"platform_properties": {
"cpu_count": {
"query_cmd": "nproc",
"query_cmd": "nproc"
},
"memory_kb": {
"values": ["500000"],
"values": ["500000"]
},
"network_kbps": {
"values": ["100000"],
"values": ["100000"]
},
"cpu_arch": {
"values": ["x86_64"],
"values": ["x86_64"]
},
"OSFamily": {
"values": ["Linux"]
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/overlays/lre/worker-lre-cc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ spec:
- name: entrypoint
mountPath: /entrypoint
command: ["/entrypoint/entrypoint.sh"]
args: ["/shared/nativelink", "/worker.json"]
args: ["/shared/nativelink", "/worker.json5"]
volumes:
- name: entrypoint
emptyDir: {}
Expand Down
Loading

0 comments on commit c84f793

Please sign in to comment.