Skip to content

Commit

Permalink
POC: Add OpenDAL based GCS Storage Support
Browse files Browse the repository at this point in the history
Signed-off-by: Xuanwo <[email protected]>
  • Loading branch information
Xuanwo committed Dec 18, 2024
1 parent c52514a commit e11158c
Show file tree
Hide file tree
Showing 6 changed files with 458 additions and 0 deletions.
202 changes: 202 additions & 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 Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ rustls-native-certs = "0.8"
x509-parser = "0.16"
whoami = "1.5.1"
zerocopy = { version = "0.7", features = ["derive"] }
opendal = {version = "0.50.2" }

## TODO replace this with tracing
env_logger = "0.10"
Expand Down
1 change: 1 addition & 0 deletions libs/remote_storage/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ metrics.workspace = true
utils.workspace = true
pin-project-lite.workspace = true

opendal = { workspace = true, features = ["services-gcs"] }
azure_core.workspace = true
azure_identity.workspace = true
azure_storage.workspace = true
Expand Down
8 changes: 8 additions & 0 deletions libs/remote_storage/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,14 @@ impl Debug for AzureConfig {
}
}

/// Gcs bucket coordinates and access credentials to manage the bucket contents (read and write).
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct GcsConfig {
pub bucket_name: String,
/// A "subfolder" in the bucket, to use the same bucket separately by multiple remote storage users at once.
pub prefix_in_bucket: Option<String>,
}

fn deserialize_storage_class<'de, D: serde::Deserializer<'de>>(
deserializer: D,
) -> Result<Option<StorageClass>, D::Error> {
Expand Down
Loading

0 comments on commit e11158c

Please sign in to comment.