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(prover): Add port opt for prover #2375

Closed
wants to merge 6 commits into from
Closed
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
7 changes: 6 additions & 1 deletion prover/proof_fri_compressor/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ struct Cli {
pub(crate) config_path: Option<std::path::PathBuf>,
#[arg(long)]
pub(crate) secrets_path: Option<std::path::PathBuf>,
#[arg(long)]
pub(crate) prometheus_port: Option<u16>,
}

#[tokio::main]
Expand Down Expand Up @@ -69,9 +71,12 @@ async fn main() -> anyhow::Result<()> {
}
let _guard = builder.build();

let config = general_config
let mut config = general_config
.proof_compressor_config
.context("FriProofCompressorConfig")?;
if let Some(prometheus_port) = opt.prometheus_port {
config.prometheus_listener_port = prometheus_port;
}
let pool = ConnectionPool::<Prover>::singleton(database_secrets.prover_url()?)
.build()
.await
Expand Down
7 changes: 6 additions & 1 deletion prover/prover_fri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,10 @@ async fn main() -> anyhow::Result<()> {
tracing::info!("No sentry URL was provided");
}

let prover_config = general_config.prover_config.context("fri_prover config")?;
let mut prover_config = general_config.prover_config.context("fri_prover config")?;
if let Some(prometheus_port) = opt.prometheus_port {
prover_config.prometheus_port = prometheus_port;
}
let exporter_config = PrometheusExporterConfig::pull(prover_config.prometheus_port);

let (stop_signal_sender, stop_signal_receiver) = oneshot::channel();
Expand Down Expand Up @@ -317,4 +320,6 @@ pub(crate) struct Cli {
pub(crate) config_path: Option<std::path::PathBuf>,
#[arg(long)]
pub(crate) secrets_path: Option<std::path::PathBuf>,
#[arg(long)]
pub(crate) prometheus_port: Option<u16>,
}
8 changes: 7 additions & 1 deletion prover/prover_fri_gateway/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,14 @@ async fn main() -> anyhow::Result<()> {
}
let _guard = builder.build();

let config = general_config
let mut config = general_config
.prover_gateway
.context("prover gateway config")?;

if let Some(prometheus_port) = opt.prometheus_port {
config.prometheus_listener_port = prometheus_port;
}

let postgres_config = general_config.postgres_config.context("postgres config")?;
let pool = ConnectionPool::<Prover>::builder(
database_secrets.prover_url()?,
Expand Down Expand Up @@ -123,4 +127,6 @@ pub(crate) struct Cli {
pub(crate) config_path: Option<std::path::PathBuf>,
#[arg(long)]
pub(crate) secrets_path: Option<std::path::PathBuf>,
#[arg(long)]
pub(crate) prometheus_port: Option<u16>,
}
9 changes: 8 additions & 1 deletion prover/witness_generator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ struct Opt {
/// Path to the secrets file.
#[structopt(long)]
secrets_path: Option<std::path::PathBuf>,
/// Prometheus listener port.
#[structopt(long)]
prometheus_port: Option<u16>,
}

#[tokio::main]
Expand Down Expand Up @@ -122,9 +125,13 @@ async fn main() -> anyhow::Result<()> {
let config = general_config
.witness_generator
.context("witness generator config")?;
let prometheus_config = general_config
let mut prometheus_config = general_config
.prometheus_config
.context("prometheus config")?;
if let Some(prometheus_port) = opt.prometheus_port {
prometheus_config.listener_port = prometheus_port;
}

let postgres_config = general_config.postgres_config.context("postgres config")?;
let connection_pool = ConnectionPool::<Core>::builder(
database_secrets.master_url()?,
Expand Down
7 changes: 6 additions & 1 deletion prover/witness_vector_generator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ struct Cli {
pub(crate) config_path: Option<std::path::PathBuf>,
#[arg(long)]
pub(crate) secrets_path: Option<std::path::PathBuf>,
#[arg(long)]
pub(crate) prometheus_port: Option<u16>,
}

#[tokio::main]
Expand Down Expand Up @@ -66,9 +68,12 @@ async fn main() -> anyhow::Result<()> {
}
let _guard = builder.build();

let config = general_config
let mut config = general_config
.witness_vector_generator
.context("witness vector generator config")?;
if let Some(prometheus_port) = opt.prometheus_port {
config.prometheus_listener_port = prometheus_port;
}
let specialized_group_id = config.specialized_group_id;
let exporter_config = PrometheusExporterConfig::pull(config.prometheus_listener_port);

Expand Down
Loading