Skip to content

Commit

Permalink
Starts a Breakdown of Configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusSorealheis committed Feb 26, 2024
1 parent e402a10 commit a2c7114
Showing 1 changed file with 144 additions and 0 deletions.
144 changes: 144 additions & 0 deletions nativelink-config/examples/example-nl-config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
NativeLink uses a JSON file as the configuration format. This section of the
documentation will breakdown the anatomy of this configuration file with step-by-step instructions on its assembly.

# Assembling the Configuration File

Configuration JSON objects should begin with the `"stores"` key, followed by `"workers"`, `"schedulers"`, or other services you may wish to instantiate.


```json
{
"stores": {},
"workers": {},
"schedulers": {}, // The object is not valid configuration if left empty and should instead be removed
}
```

This is the scaffolding for a NativeLink deployment configuration.


<details>
<summary>Configuring Store</summary>

### Store Name

The value of `stores` includes top-level keys, which are the names of stores. The following example, defines the `AC_MAIN_STORE`.

```json
{
"stores": {
"AC_MAIN_STORE": {}
},
"workers": {},
"schedulers": {},
}
```

### Store Type

Once the store has been named and its object exists,
the next key is the type of store. The options are `filesystem`, `memory`, `compression`, `dedup`, `fast_slow`, `verify`, and `experimental_s3_store`.

```json
{
"stores": {
"AC_MAIN_STORE": {
"filesystem": {}
}
},
"workers": {},
"schedulers": {},
}
```

### Store Options

The contents of the object here must include `content_path`, `temp_path`, and an embedded JSON object, `eviction_policy`, which specifies the value of `max_bytes` for the store.

```json
{
"stores": {
"AC_MAIN_STORE": {
"filesystem": {
"content_path": "/tmp/nativelink/data/content_path-index",
"temp_path": "/tmp/nativelink/data/tmp_path-index",
"eviction_policy": {
// 500mb.
"max_bytes": 500000000,
}
}
}
},
"workers": {},
"schedulers": {},
}
```
</details>


<details>
<summary>Configuring Workers </summary>

## TODO

</details>


<details>
<summary>Configuring Schedulers </summary>

### Scheduler Name

The value of `stores` includes top-level keys, which are the names of stores. The following example, defines the `AC_MAIN_STORE`.

```json
{
"stores": {
"AC_MAIN_STORE": {}
},
"workers": {},
"schedulers": {},
}
```

### Store Type

Once the store has been named and its object exists,
the next key is the type of store. The options are `filesystem`, `memory`, `compression`, `dedup`, `fast_slow`, `verify`, and `experimental_s3_store`.

```json
{
"stores": {
"AC_MAIN_STORE": {
"filesystem": {}
}
},
"workers": {},
"schedulers": {},
}
```

### Store Options

The contents of the object here must include `content_path`, `temp_path`, and an embedded JSON object, `eviction_policy`, which specifies the value of `max_bytes` for the store.

```json
{
"stores": {
"AC_MAIN_STORE": {
"filesystem": {
"content_path": "/tmp/nativelink/data/content_path-index",
"temp_path": "/tmp/nativelink/data/tmp_path-index",
"eviction_policy": {
// 500mb.
"max_bytes": 500000000,
}
}
}
},
"workers": {},
"schedulers": {},
}
```

</details>

0 comments on commit a2c7114

Please sign in to comment.