@@ -180,7 +180,7 @@ pub struct PushConfig {
180180#[ serde( deny_unknown_fields) ]
181181pub struct ByteStreamConfig {
182182 /// Name of the store in the "stores" configuration.
183- pub cas_stores : HashMap < InstanceName , StoreRefName > ,
183+ pub cas_store : StoreRefName ,
184184
185185 /// Max number of bytes to send on each grpc stream chunk.
186186 /// According to <https://github.com/grpc/grpc.github.io/issues/371>
@@ -191,11 +191,6 @@ pub struct ByteStreamConfig {
191191 #[ serde( default , deserialize_with = "convert_data_size_with_shellexpand" ) ]
192192 pub max_bytes_per_stream : usize ,
193193
194- /// Maximum number of bytes to decode on each grpc stream chunk.
195- /// Default: 4 MiB
196- #[ serde( default , deserialize_with = "convert_data_size_with_shellexpand" ) ]
197- pub max_decoding_message_size : usize ,
198-
199194 /// In the event a client disconnects while uploading a blob, we will hold
200195 /// the internal stream open for this many seconds before closing it.
201196 /// This allows clients that disconnect to reconnect and continue uploading
@@ -206,6 +201,21 @@ pub struct ByteStreamConfig {
206201 pub persist_stream_on_disconnect_timeout : usize ,
207202}
208203
204+ // Older bytestream config. All fields are as per the newer docs, but this requires
205+ // the hashed cas_stores v.s. the WithInstanceName approach. This should _not_ be updated
206+ // with newer fields, and eventually dropped
207+ #[ derive( Deserialize , Serialize , Debug , Clone ) ]
208+ #[ serde( deny_unknown_fields) ]
209+ pub struct OldByteStreamConfig {
210+ pub cas_stores : HashMap < InstanceName , StoreRefName > ,
211+ #[ serde( default , deserialize_with = "convert_data_size_with_shellexpand" ) ]
212+ pub max_bytes_per_stream : usize ,
213+ #[ serde( default , deserialize_with = "convert_data_size_with_shellexpand" ) ]
214+ pub max_decoding_message_size : usize ,
215+ #[ serde( default , deserialize_with = "convert_duration_with_shellexpand" ) ]
216+ pub persist_stream_on_disconnect_timeout : usize ,
217+ }
218+
209219#[ derive( Deserialize , Serialize , Debug ) ]
210220#[ serde( deny_unknown_fields) ]
211221pub struct WorkerApiConfig {
@@ -322,7 +332,8 @@ pub struct ServicesConfig {
322332 /// This is the service used to stream data to and from the CAS.
323333 /// Bazel's protocol strongly encourages users to use this streaming
324334 /// interface to interact with the CAS when the data is large.
325- pub bytestream : Option < ByteStreamConfig > ,
335+ #[ serde( default , deserialize_with = "super::backcompat::opt_bytestream" ) ]
336+ pub bytestream : Option < Vec < WithInstanceName < ByteStreamConfig > > > ,
326337
327338 /// These two are collectively the Remote Asset protocol, but it's
328339 /// defined as two separate services
@@ -462,7 +473,7 @@ pub enum ListenerConfig {
462473 Http ( HttpListener ) ,
463474}
464475
465- #[ derive( Deserialize , Serialize , Debug ) ]
476+ #[ derive( Deserialize , Serialize , Debug , Default ) ]
466477#[ serde( deny_unknown_fields) ]
467478pub struct HttpListener {
468479 /// Address to listen on. Example: `127.0.0.1:8080` or `:8080` to listen
@@ -478,6 +489,11 @@ pub struct HttpListener {
478489 #[ serde( default ) ]
479490 pub advanced_http : HttpServerConfig ,
480491
492+ /// Maximum number of bytes to decode on each grpc stream chunk.
493+ /// Default: 4 MiB
494+ #[ serde( default , deserialize_with = "convert_data_size_with_shellexpand" ) ]
495+ pub max_decoding_message_size : usize ,
496+
481497 /// Tls Configuration for this server.
482498 /// If not set, the server will not use TLS.
483499 ///
0 commit comments