Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set chunk size in process_executor #6337

Merged
Merged
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
30 changes: 22 additions & 8 deletions src/rust/engine/process_executor/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#[macro_use]
extern crate clap;
extern crate env_logger;
extern crate fs;
Expand Down Expand Up @@ -68,6 +69,14 @@ fn main() {
.takes_value(true)
.help("The host:port of the gRPC CAS server to connect to."),
)
.arg(
Arg::with_name("upload-chunk-bytes")
.help("Number of bytes to include per-chunk when uploading bytes. grpc imposes a hard message-size limit of around 4MB.")
.takes_value(true)
.long("chunk-bytes")
.required(false)
.default_value("3145728") // 3MB
)
.arg(
Arg::with_name("env")
.long("env")
Expand Down Expand Up @@ -109,14 +118,19 @@ fn main() {
let pool = Arc::new(fs::ResettablePool::new("process-executor-".to_owned()));
let server_arg = args.value_of("server");
let store = match (server_arg, args.value_of("cas-server")) {
(Some(_server), Some(cas_server)) => fs::Store::with_remote(
local_store_path,
pool.clone(),
cas_server.to_owned(),
1,
10 * 1024 * 1024,
Duration::from_secs(30),
),
(Some(_server), Some(cas_server)) => {
let chunk_size =
value_t!(args.value_of("upload-chunk-bytes"), usize).expect("Bad upload-chunk-bytes flag");

fs::Store::with_remote(
local_store_path,
pool.clone(),
cas_server.to_owned(),
1,
chunk_size,
Duration::from_secs(30),
)
}
(None, None) => fs::Store::local_only(local_store_path, pool.clone()),
_ => panic!("Must specify either both --server and --cas-server or neither."),
}.expect("Error making store");
Expand Down