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: Add option to run prover images from tag #3120

Merged
merged 4 commits into from
Oct 17, 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
10 changes: 9 additions & 1 deletion zkstack_cli/crates/zkstack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,11 @@ Initialize prover
- `--public-location <PUBLIC_LOCATION>`
- `--public-project-id <PUBLIC_PROJECT_ID>`
- `--bellman-cuda-dir <BELLMAN_CUDA_DIR>`
- `--download-key <DOWNLOAD_KEY>`
- `--bellman-cuda`

Possible values: `true`, `false`

- `--setup-compressor-key <SETUP_COMPRESSOR_KEY>`
Artemka374 marked this conversation as resolved.
Show resolved Hide resolved

Possible values: `true`, `false`

Expand Down Expand Up @@ -564,6 +568,10 @@ Run prover

Possible values: `true`, `false`

- `--tag' - Tag of the docker image to run.

Default value is `latest2.0` but you can specify your prefered one.

- `--round <ROUND>`

Possible values: `all-rounds`, `basic-circuits`, `leaf-aggregation`, `node-aggregation`, `recursion-tip`, `scheduler`
Expand Down
4 changes: 2 additions & 2 deletions zkstack_cli/crates/zkstack/src/commands/prover/args/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ pub struct ProverInitArgs {
pub bellman_cuda: Option<bool>,

#[clap(long, default_missing_value = "true", num_args = 0..=1)]
pub setup_compressor_keys: Option<bool>,
pub setup_compressor_key: Option<bool>,
#[clap(flatten)]
pub compressor_keys_args: CompressorKeysArgs,

Expand Down Expand Up @@ -363,7 +363,7 @@ impl ProverInitArgs {
});
}

let download_key = self.clone().setup_compressor_keys.unwrap_or_else(|| {
let download_key = self.clone().setup_compressor_key.unwrap_or_else(|| {
PromptConfirm::new(MSG_DOWNLOAD_SETUP_COMPRESSOR_KEY_PROMPT)
.default(false)
.ask()
Expand Down
5 changes: 5 additions & 0 deletions zkstack_cli/crates/zkstack/src/commands/prover/args/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ pub struct ProverRunArgs {
pub circuit_prover_args: CircuitProverArgs,
#[clap(long)]
pub docker: Option<bool>,
#[clap(long)]
pub tag: Option<String>,
}

#[derive(
Expand Down Expand Up @@ -300,13 +302,16 @@ impl ProverRunArgs {
.ask()
});

let tag = self.tag.unwrap_or("latest2.0".to_string());

Ok(ProverRunArgs {
component: Some(component),
witness_generator_args,
witness_vector_generator_args,
fri_prover_args: self.fri_prover_args,
circuit_prover_args,
docker: Some(docker),
tag: Some(tag),
})
}
}
Expand Down
6 changes: 4 additions & 2 deletions zkstack_cli/crates/zkstack/src/commands/prover/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub(crate) async fn run(args: ProverRunArgs, shell: &Shell) -> anyhow::Result<()

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

let (message, error) = match component {
ProverComponent::WitnessGenerator => (
Expand Down Expand Up @@ -83,6 +83,7 @@ pub(crate) async fn run(args: ProverRunArgs, shell: &Shell) -> anyhow::Result<()
run_dockerized_component(
shell,
component.image_name(),
&args.tag.unwrap(),
&application_args,
&additional_args,
message,
Expand Down Expand Up @@ -110,6 +111,7 @@ pub(crate) async fn run(args: ProverRunArgs, shell: &Shell) -> anyhow::Result<()
fn run_dockerized_component(
shell: &Shell,
image_name: &str,
tag: &str,
application_args: &[String],
args: &[String],
message: &'static str,
Expand All @@ -124,7 +126,7 @@ fn run_dockerized_component(

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...}"
"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}:{tag} {args...}"
));

cmd = cmd.with_force_run();
Expand Down
15 changes: 7 additions & 8 deletions zkstack_cli/crates/zkstack/src/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@ pub const EXPLORER_APP_DOCKER_IMAGE: &str = "matterlabs/block-explorer-app";
pub const PORTAL_DOCKER_CONFIG_PATH: &str = "/usr/src/app/dist/config.js";
pub const PORTAL_DOCKER_IMAGE: &str = "matterlabs/dapp-portal";

pub const PROVER_GATEWAY_DOCKER_IMAGE: &str = "matterlabs/prover-fri-gateway:latest2.0";
pub const WITNESS_GENERATOR_DOCKER_IMAGE: &str = "matterlabs/witness-generator:latest2.0";
pub const WITNESS_VECTOR_GENERATOR_DOCKER_IMAGE: &str =
"matterlabs/witness-vector-generator:latest2.0";
pub const PROVER_DOCKER_IMAGE: &str = "matterlabs/prover-gpu-fri:latest2.0";
pub const CIRCUIT_PROVER_DOCKER_IMAGE: &str = "matterlabs/circuit-prover-gpu:latest2.0";
pub const COMPRESSOR_DOCKER_IMAGE: &str = "matterlabs/proof-fri-gpu-compressor:latest2.0";
pub const PROVER_JOB_MONITOR_DOCKER_IMAGE: &str = "matterlabs/prover-job-monitor:latest2.0";
pub const PROVER_GATEWAY_DOCKER_IMAGE: &str = "matterlabs/prover-fri-gateway";
pub const WITNESS_GENERATOR_DOCKER_IMAGE: &str = "matterlabs/witness-generator";
pub const WITNESS_VECTOR_GENERATOR_DOCKER_IMAGE: &str = "matterlabs/witness-vector-generator";
pub const PROVER_DOCKER_IMAGE: &str = "matterlabs/prover-gpu-fri";
pub const CIRCUIT_PROVER_DOCKER_IMAGE: &str = "matterlabs/circuit-prover-gpu";
pub const COMPRESSOR_DOCKER_IMAGE: &str = "matterlabs/proof-fri-gpu-compressor";
pub const PROVER_JOB_MONITOR_DOCKER_IMAGE: &str = "matterlabs/prover-job-monitor";

pub const PROVER_GATEWAY_BINARY_NAME: &str = "zksync_prover_fri_gateway";
pub const WITNESS_GENERATOR_BINARY_NAME: &str = "zksync_witness_generator";
Expand Down
Loading