Skip to content

Commit 1e5d866

Browse files
Update readme (#1611)
1 parent 284eeb2 commit 1e5d866

File tree

2 files changed

+76
-63
lines changed

2 files changed

+76
-63
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
bazel-*
22
target/
33
.vscode/
4+
.idea/
45
.zed
56
.cache
67
.terraform*

nativelink-config/examples/README.md

Lines changed: 75 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ Configuration JSON objects should begin with the `stores` key, followed by `work
88

99
```json5
1010
{
11-
"stores": {},
11+
"stores": [],
1212
"workers": [],
13-
"schedulers": {},
13+
"schedulers": [],
1414
"servers": [],
1515
"global": {}
1616
}
@@ -24,15 +24,17 @@ This is the scaffolding for a NativeLink deployment configuration.
2424

2525
### Store Name
2626

27-
The value of `stores` includes top-level keys, which are user supplied names stores. The following example, defines the `AC_MAIN_STORE`.
27+
The value of `stores` is an array where each element defines a store. Each should have a user supplied name. The following example, defines the `AC_MAIN_STORE`.
2828

2929
```json5
3030
{
31-
"stores": {
32-
"AC_MAIN_STORE": {}
33-
},
31+
"stores": [
32+
{
33+
"name": "AC_MAIN_STORE",
34+
}
35+
],
3436
"workers": [],
35-
"schedulers": {},
37+
"schedulers": [],
3638
"servers": [],
3739
"global": {},
3840
}
@@ -41,17 +43,18 @@ The value of `stores` includes top-level keys, which are user supplied names sto
4143
### Store Type
4244

4345
Once the store has been named and its object exists,
44-
the next key is the type of store. The options are `filesystem`, `memory`, `compression`, `dedup`, `fast_slow`, `verify`, and `experimental_s3_store`.
46+
the next key to add is the type of store. The options are `filesystem`, `memory`, `compression`, `dedup`, `fast_slow`, `verify`, and `experimental_s3_store`.
4547

4648
```json5
4749
{
48-
"stores": {
49-
"AC_MAIN_STORE": {
50-
"filesystem": {}
50+
"stores": [
51+
{
52+
"name": "AC_MAIN_STORE",
53+
"filesystem": {}
5154
}
52-
},
55+
],
5356
"workers": [],
54-
"schedulers": {},
57+
"schedulers": [],
5558
"servers": [],
5659
"global": {},
5760
}
@@ -63,8 +66,9 @@ The contents of the object here must include `content_path`, `temp_path`, and an
6366

6467
```json5
6568
{
66-
"stores": {
67-
"AC_MAIN_STORE": {
69+
"stores": [
70+
{
71+
"name": "AC_MAIN_STORE",
6872
"filesystem": {
6973
"content_path": "/tmp/nativelink/data/content_path-index",
7074
"temp_path": "/tmp/nativelink/data/tmp_path-index",
@@ -74,9 +78,9 @@ The contents of the object here must include `content_path`, `temp_path`, and an
7478
}
7579
}
7680
}
77-
},
81+
],
7882
"workers": [],
79-
"schedulers": {},
83+
"schedulers": [],
8084
"servers": [],
8185
"global": {},
8286
}
@@ -93,11 +97,11 @@ The value of `workers` includes a top level array that embeds the worker metadat
9397

9498
```json5
9599
{
96-
"stores": {},
100+
"stores": [],
97101
"workers": [{
98102
"local": {}
99103
}],
100-
"schedulers": {},
104+
"schedulers": [],
101105
"servers": [],
102106
"global": {},
103107
}
@@ -109,7 +113,7 @@ The Local object has five components, `worker_api_endpoint`, `cas_fast_slow_stor
109113

110114
```json5
111115
{
112-
"stores": {},
116+
"stores": [],
113117
"workers": [{
114118
"local": {
115119
"worker_api_endpoint": {
@@ -142,7 +146,7 @@ The Local object has five components, `worker_api_endpoint`, `cas_fast_slow_stor
142146
}
143147
}
144148
}],
145-
"schedulers": {},
149+
"schedulers": [],
146150
"servers": [],
147151
"global": {},
148152
}
@@ -153,17 +157,20 @@ The Local object has five components, `worker_api_endpoint`, `cas_fast_slow_stor
153157
<details>
154158
<summary>Configuring Schedulers </summary>
155159

156-
### Scheduler Name
160+
### Scheduler Name
161+
The value of `stores` is an array where each element defines a store. Each should have a user supplied name. The following example, defines the `AC_MAIN_STORE`.
157162

158-
The value of `schedulers` includes top-level keys, which are the user-supplied names of the schedulers. The following example, defines the `MAIN_SCHEDULER`.
163+
The value of `schedulers` is an array where each element defines a scheduler. Each scheduler must have a user-supplied name. The following example, defines the `MAIN_SCHEDULER`.
159164

160165
```json5
161166
{
162-
"stores": {},
163-
"workers": {},
164-
"schedulers": {
165-
"MAIN_SCHEDULER": {}
166-
},
167+
"stores": [],
168+
"workers": [],
169+
"schedulers": [
170+
{
171+
name: "MAIN_SCHEDULER"
172+
}
173+
],
167174
"servers": [],
168175
"global": {},
169176
}
@@ -176,13 +183,14 @@ the next key is the type of scheduler. The options are `simple`, `action_schedul
176183

177184
```json5
178185
{
179-
"stores": {},
180-
"workers": {},
181-
"schedulers": {
182-
"MAIN_SCHEDULER": {
183-
"simple": {}
184-
},
185-
}
186+
"stores": [],
187+
"workers": [],
188+
"schedulers": [
189+
{
190+
name: "MAIN_SCHEDULER",
191+
simple: {}
192+
}
193+
],
186194
}
187195
```
188196

@@ -192,11 +200,12 @@ The contents of the scheduler type object defines the options. For a list of opt
192200

193201
```json5
194202
{
195-
"stores": {},
196-
"workers": {},
197-
"schedulers": {
198-
"MAIN_SCHEDULER": {
199-
"simple": {
203+
"stores": [],
204+
"workers": [],
205+
"schedulers": [
206+
{
207+
name: "MAIN_SCHEDULER",
208+
simple: {
200209
"supported_platform_properties": {
201210
"cpu_count": "minimum",
202211
"memory_kb": "minimum",
@@ -217,7 +226,7 @@ The contents of the scheduler type object defines the options. For a list of opt
217226
}
218227
}
219228
}
220-
},
229+
],
221230
"servers": [],
222231
"global": {},
223232
}
@@ -228,15 +237,15 @@ The contents of the scheduler type object defines the options. For a list of opt
228237
<details>
229238
<summary>Configuring Servers</summary>
230239

231-
### Servers
240+
### Servers
232241

233242
The `servers` configuration object is an array, with two objects, `public`, and `private_workers_servers`.
234243

235244
```json5
236245
{
237-
"stores": {},
238-
"workers": {},
239-
"schedulers": {},
246+
"stores": [],
247+
"workers": [],
248+
"schedulers": [],
240249
"servers": [{
241250
"name": "public"
242251
},{
@@ -246,15 +255,15 @@ The `servers` configuration object is an array, with two objects, `public`, and
246255
}
247256
```
248257

249-
### Public Server
258+
### Public Server
250259

251260
The `public` server consists of a `listener` object and a `services` object. The `listener` object is one level of depth and includes an `http` with a `socket address`. The `services` server consists of a `cas`, an `ac`, the `execution`, `capabilities`, and `bytestream`.
252261

253262
```json5
254263
{
255-
"stores": {},
256-
"workers": {},
257-
"schedulers": {},
264+
"stores": [],
265+
"workers": [],
266+
"schedulers": [],
258267
"servers": [{
259268
"name": "public",
260269
"listener": {
@@ -299,17 +308,17 @@ The `public` server consists of a `listener` object and a `services` object. The
299308
}
300309
```
301310

302-
### Private Server
311+
### Private Server
303312

304-
> ⚠️ _WARNING_: A private server shouldn't be exposed to the public. ⚠️
313+
> ⚠️ _WARNING_: A private server shouldn't be exposed to the public. ⚠️
305314
306-
The `private` server consists of a `listener` object and a `services` object. The `listener` object is one level and includes an `http` with a `socket address`. The `services` server consists of an `experimental_prometheus` object with a `path` field, a `worker_api` object with `scheduler_field`, and an `admin` object.
315+
The `private` server consists of a `listener` object and a `services` object. The `listener` object is one level and includes an `http` with a `socket address`. The `services` server consists of an `experimental_prometheus` object with a `path` field, a `worker_api` object with `scheduler_field`, and an `admin` object.
307316

308317
```json5
309318
{
310-
"stores": {},
311-
"workers": {},
312-
"schedulers": {},
319+
"stores": [],
320+
"workers": [],
321+
"schedulers": [],
313322
"servers": [{
314323
"name": "public",
315324
"listener": {
@@ -386,13 +395,14 @@ The `public` server consists of a `listener` object and a `services` object. The
386395
<details>
387396
<summary>Complete Example </summary>
388397

389-
Below, you will find a fully tested example that you can also find in [basic_cas.json](basic_cas.json)
398+
Below, you will find a fully tested example that you can also find in [basic_cas.json](basic_cas.json)
390399

391400
```json5
392401

393402
{
394-
"stores": {
395-
"AC_MAIN_STORE": {
403+
"stores": [
404+
{
405+
name: "AC_MAIN_STORE",
396406
"filesystem": {
397407
"content_path": "/tmp/nativelink/data-worker-test/content_path-ac",
398408
"temp_path": "/tmp/nativelink/data-worker-test/tmp_path-ac",
@@ -402,7 +412,8 @@ The `public` server consists of a `listener` object and a `services` object. The
402412
}
403413
}
404414
},
405-
"WORKER_FAST_SLOW_STORE": {
415+
{
416+
name: "WORKER_FAST_SLOW_STORE",
406417
"fast_slow": {
407418
// "fast" must be a "filesystem" store because the worker uses it to make
408419
// hardlinks on disk to a directory where the jobs are running.
@@ -426,9 +437,10 @@ The `public` server consists of a `listener` object and a `services` object. The
426437
}
427438
}
428439
}
429-
},
430-
"schedulers": {
431-
"MAIN_SCHEDULER": {
440+
],
441+
"schedulers": [
442+
{
443+
name: "MAIN_SCHEDULER",
432444
"simple": {
433445
"supported_platform_properties": {
434446
"cpu_count": "minimum",
@@ -453,7 +465,7 @@ The `public` server consists of a `listener` object and a `services` object. The
453465
}
454466
}
455467
}
456-
},
468+
],
457469
"workers": [{
458470
"local": {
459471
"worker_api_endpoint": {

0 commit comments

Comments
 (0)