Skip to content

Commit

Permalink
[ENH] multipart S3 file uploads (#2590)
Browse files Browse the repository at this point in the history
  • Loading branch information
codetheweb authored Aug 1, 2024
1 parent c0a1104 commit 9472830
Show file tree
Hide file tree
Showing 6 changed files with 236 additions and 58 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions rust/worker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ rayon = "1.8.0"
criterion = "0.3"
random-port = "0.1.1"
serial_test = "3.1.1"
rand_xorshift = "0.3.0"

[build-dependencies]
tonic-build = "0.10"
Expand Down
2 changes: 2 additions & 0 deletions rust/worker/chroma_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ query_service:
credentials: "Minio"
connect_timeout_ms: 5000
request_timeout_ms: 30000 # 1 minute
upload_part_size_bytes: 8388608 # 8MB
log:
Grpc:
host: "logservice.chroma"
Expand Down Expand Up @@ -80,6 +81,7 @@ compaction_service:
credentials: "Minio"
connect_timeout_ms: 5000
request_timeout_ms: 60000 # 1 minute
upload_part_size_bytes: 8388608 # 8MB
log:
Grpc:
host: "logservice.chroma"
Expand Down
12 changes: 12 additions & 0 deletions rust/worker/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ mod tests {
credentials: Minio
connect_timeout_ms: 5000
request_timeout_ms: 1000
upload_part_size_bytes: 8388608
log:
Grpc:
host: "localhost"
Expand Down Expand Up @@ -236,6 +237,7 @@ mod tests {
credentials: Minio
connect_timeout_ms: 5000
request_timeout_ms: 1000
upload_part_size_bytes: 8388608
log:
Grpc:
host: "localhost"
Expand Down Expand Up @@ -314,6 +316,7 @@ mod tests {
credentials: Minio
connect_timeout_ms: 5000
request_timeout_ms: 1000
upload_part_size_bytes: 8388608
log:
Grpc:
host: "localhost"
Expand Down Expand Up @@ -366,6 +369,7 @@ mod tests {
credentials: Minio
connect_timeout_ms: 5000
request_timeout_ms: 1000
upload_part_size_bytes: 8388608
log:
Grpc:
host: "localhost"
Expand Down Expand Up @@ -462,6 +466,7 @@ mod tests {
credentials: Minio
connect_timeout_ms: 5000
request_timeout_ms: 1000
upload_part_size_bytes: 8388608
log:
Grpc:
host: "localhost"
Expand Down Expand Up @@ -514,6 +519,7 @@ mod tests {
credentials: Minio
connect_timeout_ms: 5000
request_timeout_ms: 1000
upload_part_size_bytes: 8388608
log:
Grpc:
host: "localhost"
Expand Down Expand Up @@ -570,6 +576,10 @@ mod tests {
let _ = jail.set_env("CHROMA_COMPACTION_SERVICE__MY_PORT", 50051);
let _ = jail.set_env("CHROMA_COMPACTION_SERVICE__STORAGE__S3__BUCKET", "buckets!");
let _ = jail.set_env("CHROMA_COMPACTION_SERVICE__STORAGE__S3__CREDENTIALS", "AWS");
let _ = jail.set_env(
"CHROMA_COMPACTION_SERVICE__STORAGE__S3__upload_part_size_bytes",
format!("{}", 1024 * 1024 * 8),
);
let _ = jail.set_env(
"CHROMA_COMPACTION_SERVICE__STORAGE__S3__CONNECT_TIMEOUT_MS",
5000,
Expand Down Expand Up @@ -604,6 +614,7 @@ mod tests {
credentials: Minio
connect_timeout_ms: 5000
request_timeout_ms: 1000
upload_part_size_bytes: 8388608
log:
Grpc:
host: "localhost"
Expand Down Expand Up @@ -698,6 +709,7 @@ mod tests {
);
assert_eq!(s.connect_timeout_ms, 5000);
assert_eq!(s.request_timeout_ms, 1000);
assert_eq!(s.upload_part_size_bytes, 1024 * 1024 * 8);
}
_ => panic!("Invalid storage config"),
}
Expand Down
1 change: 1 addition & 0 deletions rust/worker/src/storage/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ pub(crate) struct S3StorageConfig {
pub(crate) credentials: S3CredentialsConfig,
pub(crate) connect_timeout_ms: u64,
pub(crate) request_timeout_ms: u64,
pub(crate) upload_part_size_bytes: usize,
}

#[derive(Deserialize, Debug)]
Expand Down
Loading

0 comments on commit 9472830

Please sign in to comment.