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

fix(zk_toolbox): wrong configs path for prover binaries #2922

Merged
merged 4 commits into from
Oct 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
15 changes: 15 additions & 0 deletions zk_toolbox/crates/zk_inception/src/commands/prover/args/run.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::path::Path;

use anyhow::anyhow;
use clap::{Parser, ValueEnum};
use common::{Prompt, PromptSelect};
Expand Down Expand Up @@ -92,6 +94,7 @@ impl ProverComponent {
in_docker: bool,
args: ProverRunArgs,
chain: &ChainConfig,
path_to_ecosystem: &Path,
) -> anyhow::Result<Vec<String>> {
let mut additional_args = vec![];
if in_docker {
Expand All @@ -109,6 +112,18 @@ impl ProverComponent {
.into_string()
.map_err(|_| anyhow!("Failed to convert path to string"))?;

let general_config = path_to_ecosystem
.join(general_config)
.into_os_string()
.into_string()
.unwrap();

let secrets_config = path_to_ecosystem
.join(secrets_config)
.into_os_string()
.into_string()
.unwrap();

additional_args.push(format!("--config-path={}", general_config));
additional_args.push(format!("--secrets-path={}", secrets_config));
}
Expand Down
11 changes: 9 additions & 2 deletions zk_toolbox/crates/zk_inception/src/commands/prover/run.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::path::PathBuf;
use std::path::{Path, PathBuf};

use anyhow::{anyhow, Context};
use common::{check_prerequisites, cmd::Cmd, config::global_config, logger, GPU_PREREQUISITES};
Expand All @@ -22,14 +22,17 @@ pub(crate) async fn run(args: ProverRunArgs, shell: &Shell) -> anyhow::Result<()
.load_chain(global_config().chain_name.clone())
.expect(MSG_CHAIN_NOT_FOUND_ERR);

let path_to_ecosystem = shell.current_dir();

let link_to_prover = get_link_to_prover(&ecosystem_config);
shell.change_dir(link_to_prover.clone());

let component = args.component.context(anyhow!(MSG_MISSING_COMPONENT_ERR))?;
let in_docker = args.docker.unwrap_or(false);

let application_args = component.get_application_args(in_docker)?;
let additional_args = component.get_additional_args(in_docker, args, &chain)?;
let additional_args =
component.get_additional_args(in_docker, args, &chain, &path_to_ecosystem)?;

let (message, error) = match component {
ProverComponent::WitnessGenerator => (
Expand Down Expand Up @@ -79,6 +82,7 @@ pub(crate) async fn run(args: ProverRunArgs, shell: &Shell) -> anyhow::Result<()
error,
&path_to_configs,
&path_to_prover,
&path_to_ecosystem,
)?
} else {
update_setup_data_path(&chain, "data/keys".to_string())?;
Expand All @@ -105,9 +109,12 @@ fn run_dockerized_component(
error: &'static str,
path_to_configs: &PathBuf,
path_to_prover: &PathBuf,
path_to_ecosystem: &Path,
) -> anyhow::Result<()> {
logger::info(message);

let path_to_configs = path_to_ecosystem.join(path_to_configs);

let mut cmd = Cmd::new(cmd!(
shell,
"docker run --net=host -v {path_to_prover}/data/keys:/prover/data/keys -v {path_to_prover}/artifacts:/artifacts -v {path_to_configs}:/configs {application_args...} {image_name} {args...}"
Expand Down
Loading