From 4af6a4d5e8ebe1053d2df186cb91e79e44ef497d Mon Sep 17 00:00:00 2001 From: Alek Westover Date: Tue, 18 Jul 2023 08:45:39 -0400 Subject: [PATCH] hopefully unbroken wip --- compute_tools/src/bin/compute_ctl.rs | 36 ++++++++++++++++------------ 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/compute_tools/src/bin/compute_ctl.rs b/compute_tools/src/bin/compute_ctl.rs index cda5ed3fb4..09434d70bf 100644 --- a/compute_tools/src/bin/compute_ctl.rs +++ b/compute_tools/src/bin/compute_ctl.rs @@ -60,6 +60,7 @@ use compute_tools::params::*; use compute_tools::spec::*; const BUILD_TAG_DEFAULT: &str = "local"; +const DEFAULT_REMOTE_EXT_CONFIG: &str = r#"{"bucket": "neon-dev-extensions", "region": "eu-central-1", "endpoint": null, "prefix": "5555"}"#; fn main() -> Result<()> { init_tracing_and_logging(DEFAULT_LOG_LEVEL)?; @@ -71,25 +72,30 @@ fn main() -> Result<()> { let pgbin_default = String::from("postgres"); let pgbin = matches.get_one::("pgbin").unwrap_or(&pgbin_default); - let remote_ext_config = matches.get_one::("remote-ext-config"); + let remote_ext_config = matches + .get_one::("remote-ext-config") + .map(|x| x.to_string()); + // let remote_ext_config = + // Some(remote_ext_config.unwrap_or(DEFAULT_REMOTE_EXT_CONFIG.to_string())); + let ext_remote_storage = remote_ext_config.map(|x| { - init_remote_storage(x, build_tag) + init_remote_storage(&x, build_tag) .expect("cannot initialize remote extension storage from config") }); // creds used to connect to remote extensions bucket - let aws_creds = matches.get_one::("awscreds"); - if let Some(aws_creds) = aws_creds { - // not sure if this is a bad idea? - let aws_creds_dict: serde_json::Value = serde_json::from_str(aws_creds)?; - std::env::set_var( - "AWS_ACCESS_KEY_ID", - aws_creds_dict["ID"].as_str().expect("config parse error"), - ); - std::env::set_var( - "AWS_SECRET_ACCESS_KEY", - aws_creds_dict["key"].as_str().expect("config parse error"), - ); - } + // let aws_creds = matches.get_one::("awscreds"); + // if let Some(aws_creds) = aws_creds { + // // not sure if this is a bad idea? + // let aws_creds_dict: serde_json::Value = serde_json::from_str(aws_creds)?; + // std::env::set_var( + // "AWS_ACCESS_KEY_ID", + // aws_creds_dict["ID"].as_str().expect("config parse error"), + // ); + // std::env::set_var( + // "AWS_SECRET_ACCESS_KEY", + // aws_creds_dict["key"].as_str().expect("config parse error"), + // ); + // } let http_port = *matches .get_one::("http-port")