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

Implement Google Cloud Storage Store #1549

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
13 changes: 13 additions & 0 deletions deployment-examples/gcs-store-example.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
stores:
gcs_store:
type: "gcs_store"
bucket: "my-bucket"
key_prefix: "my-prefix/"
consider_expired_after_s: 3600
retry:
max_retries: 3
initial_delay_millis: 100
max_delay_millis: 1000
jitter: 0.1
multipart_max_concurrent_uploads: 10
max_retry_buffer_per_request: 5242880 # 5MB
47 changes: 47 additions & 0 deletions nativelink-config/src/stores.rs
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,26 @@ pub enum StoreSpec {
/// ```
///
noop(NoopSpec),

/// GCS store will use Google Cloud Storage (GCS) as a backend to store
/// the files. This configuration can be used to share files
/// across multiple instances.
///
/// **Example JSON Config:**
/// ```json
/// "gcs_store": {
/// "bucket": "crossplane-bucket-af79aeca9",
/// "key_prefix": "test-prefix-index/",
/// "retry": {
/// "max_retries": 6,
/// "delay": 0.3,
/// "jitter": 0.5
/// },
/// "multipart_max_concurrent_uploads": 10
/// }
/// ```
///
gcs_store(GcsSpec),
}

/// Configuration for an individual shard of the store.
Expand Down Expand Up @@ -1063,3 +1083,30 @@ pub struct Retry {
#[serde(default)]
pub retry_on_errors: Option<Vec<ErrorCode>>,
}

#[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GcsSpec {
/// The name of the GCS bucket.
pub bucket: String,

/// Optional prefix to prepend to all keys in the bucket.
pub key_prefix: Option<String>,

/// If set, objects older than this many seconds will be considered expired
/// and will be treated as if they don't exist.
#[serde(default)]
pub consider_expired_after_s: u32,

/// Configuration for retrying failed operations.
#[serde(default)]
pub retry: Retry,

/// Maximum number of bytes to buffer for retrying requests.
/// Defaults to 5MB if not specified.
pub max_retry_buffer_per_request: Option<usize>,

/// Maximum number of concurrent uploads for multipart operations.
/// Defaults to 10 if not specified.
pub multipart_max_concurrent_uploads: Option<usize>,
}
Loading
Loading