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

cherrypick feat(object store): support azblob workload identity (#15940) to branch release-1.8 #16063

Merged
merged 3 commits into from
Apr 2, 2024
Merged
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
105 changes: 100 additions & 5 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,8 @@ tokio-postgres = { git = "https://github.com/madsim-rs/rust-postgres.git", rev =
futures-timer = { git = "https://github.com/madsim-rs/futures-timer.git", rev = "05b33b4" }
# patch: unlimit 4MB message size for grpc client
etcd-client = { git = "https://github.com/risingwavelabs/etcd-client.git", rev = "4e84d40" }
# todo(wcy-fdu): remove this patch fork after opendal release a new version to apply azure workload identity change.
reqsign = { git = "https://github.com/wcy-fdu/reqsign.git", rev = "e6cb304" }

[workspace.metadata.dylint]
libraries = [{ path = "./lints" }]
2 changes: 1 addition & 1 deletion risedev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1378,4 +1378,4 @@ template:
port: 6379

# address of redis
address: "127.0.0.1"
address: "127.0.0.1"
10 changes: 3 additions & 7 deletions src/object_store/src/object/opendal_engine/azblob.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ use opendal::Operator;

use super::{EngineType, OpendalObjectStore};
use crate::object::ObjectResult;

const AZBLOB_ENDPOINT: &str = "AZBLOB_ENDPOINT";
impl OpendalObjectStore {
/// create opendal azblob engine.
pub fn new_azblob_engine(container_name: String, root: String) -> ObjectResult<Self> {
Expand All @@ -26,16 +28,10 @@ impl OpendalObjectStore {
builder.root(&root);
builder.container(&container_name);

let endpoint = std::env::var("AZBLOB_ENDPOINT")
let endpoint = std::env::var(AZBLOB_ENDPOINT)
.unwrap_or_else(|_| panic!("AZBLOB_ENDPOINT not found from environment variables"));
let account_name = std::env::var("AZBLOB_ACCOUNT_NAME")
.unwrap_or_else(|_| panic!("AZBLOB_ACCOUNT_NAME not found from environment variables"));
let account_key = std::env::var("AZBLOB_ACCOUNT_KEY")
.unwrap_or_else(|_| panic!("AZBLOB_ACCOUNT_KEY not found from environment variables"));

builder.endpoint(&endpoint);
builder.account_name(&account_name);
builder.account_key(&account_key);
let op: Operator = Operator::new(builder)?
.layer(LoggingLayer::default())
.layer(RetryLayer::default())
Expand Down
Loading