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

feat: support initializing license key from env var #17906

Merged
merged 1 commit into from
Aug 12, 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
1 change: 1 addition & 0 deletions src/cmd_all/src/standalone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@ mod test {
heap_profiling_dir: None,
dangerous_max_idle_secs: None,
connector_rpc_endpoint: None,
license_key: None,
temp_secret_file_dir: "./meta/secrets/",
},
),
Expand Down
8 changes: 7 additions & 1 deletion src/meta/node/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ use educe::Educe;
pub use error::{MetaError, MetaResult};
use redact::Secret;
use risingwave_common::config::OverrideConfig;
use risingwave_common::license::LicenseKey;
use risingwave_common::util::meta_addr::MetaAddressStrategy;
use risingwave_common::util::resource_util;
use risingwave_common::util::tokio_util::sync::CancellationToken;
Expand Down Expand Up @@ -187,8 +188,13 @@ pub struct MetaNodeOpts {
#[clap(long, hide = true, env = "RW_CONNECTOR_RPC_ENDPOINT")]
pub connector_rpc_endpoint: Option<String>,

/// The license key to activate enterprise features.
#[clap(long, hide = true, env = "RW_LICENSE_KEY")]
#[override_opts(path = system.license_key)]
pub license_key: Option<LicenseKey>,

/// 128-bit AES key for secret store in HEX format.
#[educe(Debug(ignore))]
#[educe(Debug(ignore))] // TODO: use newtype to redact debug impl
#[clap(long, hide = true, env = "RW_SECRET_STORE_PRIVATE_KEY_HEX")]
pub secret_store_private_key_hex: Option<String>,

Expand Down
3 changes: 1 addition & 2 deletions src/meta/src/controller/system_param.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ use sea_orm::{ActiveModelTrait, DatabaseConnection, EntityTrait, TransactionTrai
use tokio::sync::oneshot::Sender;
use tokio::sync::RwLock;
use tokio::task::JoinHandle;
use tracing::info;

use crate::controller::SqlMetaStore;
use crate::manager::{LocalNotification, NotificationManagerRef};
Expand Down Expand Up @@ -143,7 +142,7 @@ impl SystemParamsController {
let params = SystemParameter::find().all(&db).await?;
let params = merge_params(system_params_from_db(params)?, init_params);

info!(initial_params = ?SystemParamsReader::new(&params), "initialize system parameters");
tracing::info!(initial_params = ?SystemParamsReader::new(&params), "initialize system parameters");
check_missing_params(&params).map_err(|e| anyhow!(e))?;

let ctl = Self {
Expand Down
3 changes: 1 addition & 2 deletions src/meta/src/manager/system_param/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ use risingwave_pb::meta::SystemParams;
use tokio::sync::oneshot::Sender;
use tokio::sync::RwLock;
use tokio::task::JoinHandle;
use tracing::info;

use self::model::SystemParamsModel;
use super::NotificationManagerRef;
Expand Down Expand Up @@ -77,7 +76,7 @@ impl SystemParamsManager {
return Err(require_sql_meta_store_err().into());
}

info!(initial_params = ?SystemParamsReader::new(&params), "initialize system parameters");
tracing::info!(initial_params = ?SystemParamsReader::new(&params), "initialize system parameters");
check_missing_params(&params).map_err(|e| anyhow!(e))?;

Ok(Self {
Expand Down
Loading