Skip to content
Closed
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
16 changes: 8 additions & 8 deletions deployment-examples/docker-compose/local-storage-cas.json5
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@
},
],
capabilities: [],
bytestream: {
cas_stores: {
"": "CAS_MAIN_STORE",
bytestream: [
{
cas_store: "CAS_MAIN_STORE",
},
},
],
fetch: {},
push: {},
},
Expand Down Expand Up @@ -91,11 +91,11 @@
},
],
capabilities: [],
bytestream: {
cas_stores: {
"": "CAS_MAIN_STORE",
bytestream: [
{
cas_store: "CAS_MAIN_STORE",
},
},
],
health: {},
},
},
Expand Down
8 changes: 4 additions & 4 deletions integration_tests/buildstream/buildstream_cas.json5
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,11 @@
},
},
],
bytestream: {
cas_stores: {
"": "WORKER_FAST_SLOW_STORE",
bytestream: [
{
cas_store: "WORKER_FAST_SLOW_STORE",
},
},
],
},
},
{
Expand Down
8 changes: 4 additions & 4 deletions kubernetes/nativelink/nativelink-config.json5
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,11 @@
scheduler: "MAIN_SCHEDULER",
},
],
bytestream: {
cas_stores: {
"": "CAS_MAIN_STORE",
bytestream: [
{
cas_store: "CAS_MAIN_STORE",
},
},
],
},
},
{
Expand Down
93 changes: 51 additions & 42 deletions nativelink-config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,54 +12,63 @@ A very basic configuration that's a pure in-memory store is:

```js
{
"stores": [
stores: [
{
"name": "CAS_MAIN_STORE",
"memory": {
"eviction_policy": {
name: "CAS_MAIN_STORE",
memory: {
eviction_policy: {
// 1gb.
"max_bytes": 1000000000,
}
}
max_bytes: 1000000000,
},
},
},
{
"name": "AC_MAIN_STORE",
"memory": {
"eviction_policy": {
name: "AC_MAIN_STORE",
memory: {
eviction_policy: {
// 100mb.
"max_bytes": 100000000,
}
}
}
max_bytes: 100000000,
},
},
},
],
"servers": [{
"listener": {
"http": {
"socket_address": "0.0.0.0:50051",
"advanced_http": {
"http2_keep_alive_interval": 10
}
}
servers: [
{
listener: {
http: {
socket_address: "0.0.0.0:50051",
advanced_http: {
http2_keep_alive_interval: 10,
},
},
},
services: {
cas: [
{
instance_name: "main",
cas_store: "CAS_MAIN_STORE",
},
],
ac: [
{
instance_name: "main",
ac_store: "AC_MAIN_STORE",
},
],
capabilities: [
{
instance_name: "main",
},
],
bytestream: [
{
instance_name: "main",
cas_store: "CAS_MAIN_STORE",
},
],
},
},
"services": {
"cas": [{
"instance_name": "main",
"cas_store": "CAS_MAIN_STORE"
}],
"ac": [{
"instance_name": "main",
"ac_store": "AC_MAIN_STORE"
}],
"capabilities": [{
"instance_name": "main"
}],
"bytestream": {
"cas_stores": {
"main": "CAS_MAIN_STORE",
}
}
}
}]
]
}
```

Expand Down Expand Up @@ -103,7 +112,7 @@ the data is retrieved.
}
}
}
],
]
// Place rest of configuration here ...
}
```
Expand Down
39 changes: 18 additions & 21 deletions nativelink-config/examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,19 +283,18 @@ The `public` server consists of a `listener` object and a `services` object. The
"execution": [{
"instance_name": "main",
"cas_store": "WORKER_FAST_SLOW_STORE",
"scheduler": "MAIN_SCHEDULER",
"scheduler": "MAIN_SCHEDULER"
}],
"capabilities": [{
"instance_name": "main",
"remote_execution": {
"scheduler": "MAIN_SCHEDULER",
"scheduler": "MAIN_SCHEDULER"
}
}],
"bytestream": {
"cas_stores": {
"main": "WORKER_FAST_SLOW_STORE",
}
}
"bytestream": [{
"instance_name": "main",
"cas_store": "WORKER_FAST_SLOW_STORE"
}]
},
},{
"name": "private_workers_servers"
Expand Down Expand Up @@ -334,19 +333,18 @@ The `private` server consists of a `listener` object and a `services` object. Th
"execution": [{
"instance_name": "main",
"cas_store": "WORKER_FAST_SLOW_STORE",
"scheduler": "MAIN_SCHEDULER",
"scheduler": "MAIN_SCHEDULER"
}],
"capabilities": [{
"instance_name": "main",
"remote_execution": {
"scheduler": "MAIN_SCHEDULER",
"scheduler": "MAIN_SCHEDULER"
}
}],
"bytestream": {
"cas_stores": {
"main": "WORKER_FAST_SLOW_STORE",
}
}
"bytestream": [{
"instance_name": "main",
"cas_store": "WORKER_FAST_SLOW_STORE"
}]
},
},{
"name": "private_workers_servers",
Expand Down Expand Up @@ -511,19 +509,18 @@ Below, you will find a fully tested example that you can also find in [basic_cas
"execution": [{
"instance_name": "main",
"cas_store": "WORKER_FAST_SLOW_STORE",
"scheduler": "MAIN_SCHEDULER",
"scheduler": "MAIN_SCHEDULER"
}],
"capabilities": [{
"instance_name": "main",
"remote_execution": {
"scheduler": "MAIN_SCHEDULER",
"scheduler": "MAIN_SCHEDULER"
}
}],
"bytestream": {
"cas_stores": {
"main": "WORKER_FAST_SLOW_STORE",
}
}
"bytestream": [{
"instance_name": "main",
"cas_store": "WORKER_FAST_SLOW_STORE"
}]
}
}, {
"name": "private_workers_servers",
Expand Down
9 changes: 5 additions & 4 deletions nativelink-config/examples/basic_cas.json5
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,12 @@
},
},
],
bytestream: {
cas_stores: {
main: "WORKER_FAST_SLOW_STORE",
bytestream: [
{
instance_name: "main",
cas_store: "WORKER_FAST_SLOW_STORE",
},
},
],
},
},
{
Expand Down
9 changes: 5 additions & 4 deletions nativelink-config/examples/filesystem_cas.json5
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,12 @@
},
},
],
bytestream: {
cas_stores: {
main: "CAS_MAIN_STORE",
bytestream: [
{
instance_name: "main",
cas_store: "CAS_MAIN_STORE",
},
},
],
},
},
{
Expand Down
9 changes: 5 additions & 4 deletions nativelink-config/examples/gcs_backend.json5
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,12 @@
},
},
],
bytestream: {
cas_stores: {
main: "CAS_MAIN_STORE",
bytestream: [
{
instance_name: "main",
cas_store: "CAS_MAIN_STORE",
},
},
],
health: {},
},
},
Expand Down
9 changes: 5 additions & 4 deletions nativelink-config/examples/mongo.json5
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,12 @@
},
},
],
bytestream: {
cas_stores: {
main: "PRODUCTION_CAS",
bytestream: [
{
instance_name: "main",
cas_store: "PRODUCTION_CAS",
},
},
],
},
},
],
Expand Down
9 changes: 5 additions & 4 deletions nativelink-config/examples/redis.json5
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,12 @@
},
],
capabilities: [],
bytestream: {
cas_stores: {
main: "CAS_MAIN_STORE",
bytestream: [
{
instance_name: "main",
cas_store: "CAS_MAIN_STORE",
},
},
],
},
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,12 @@
},
},
],
bytestream: {
cas_stores: {
main: "CAS_MAIN_STORE",
bytestream: [
{
instance_name: "main",
cas_store: "CAS_MAIN_STORE",
},
},
],
health: {},
},
},
Expand Down
10 changes: 7 additions & 3 deletions nativelink-config/src/cas_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ pub struct PushConfig {
#[serde(deny_unknown_fields)]
pub struct ByteStreamConfig {
/// Name of the store in the "stores" configuration.
pub cas_stores: HashMap<InstanceName, StoreRefName>,
#[serde(deserialize_with = "convert_string_with_shellexpand")]
pub cas_store: StoreRefName,

/// Max number of bytes to send on each grpc stream chunk.
/// According to <https://github.com/grpc/grpc.github.io/issues/371>
Expand All @@ -191,7 +192,10 @@ pub struct ByteStreamConfig {
#[serde(default, deserialize_with = "convert_data_size_with_shellexpand")]
pub max_bytes_per_stream: usize,

/// Maximum number of bytes to decode on each grpc stream chunk.
/// Maximum number of bytes to decode on each gRPC stream chunk.
/// The gRPC server uses the maximum value across all stores as the global
/// limit.
///
/// Default: 4 MiB
#[serde(default, deserialize_with = "convert_data_size_with_shellexpand")]
pub max_decoding_message_size: usize,
Expand Down Expand Up @@ -322,7 +326,7 @@ pub struct ServicesConfig {
/// This is the service used to stream data to and from the CAS.
/// Bazel's protocol strongly encourages users to use this streaming
/// interface to interact with the CAS when the data is large.
pub bytestream: Option<ByteStreamConfig>,
pub bytestream: Option<Vec<WithInstanceName<ByteStreamConfig>>>,

/// These two are collectively the Remote Asset protocol, but it's
/// defined as two separate services
Expand Down
Loading
Loading