From 65cfc8e74ce4076e34cb5b5565b1a048fd242be3 Mon Sep 17 00:00:00 2001 From: oyyblin <4529189+oyyblin@users.noreply.github.com> Date: Wed, 20 Nov 2024 16:24:57 -0800 Subject: [PATCH] fix(prover-service): expose port in docker; add missing elf file --- prover-service/Dockerfile | 6 +++++- prover-service/src/bin/server.rs | 12 ++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/prover-service/Dockerfile b/prover-service/Dockerfile index 401c0e9..f31a98a 100644 --- a/prover-service/Dockerfile +++ b/prover-service/Dockerfile @@ -19,4 +19,8 @@ FROM debian:bookworm-slim RUN apt-get update && apt-get install -y libssl3 ca-certificates COPY --from=builder /usr/src/app/target/release/server /usr/local/bin/server -CMD ["server"] +COPY --from=builder /usr/src/app/elf/riscv32im-succinct-zkvm-elf /usr/local/bin/elf/ + +EXPOSE 9090 + +CMD ["server", "--elf-path", "/usr/local/bin/elf/riscv32im-succinct-zkvm-elf"] diff --git a/prover-service/src/bin/server.rs b/prover-service/src/bin/server.rs index 8115246..fd47ea3 100644 --- a/prover-service/src/bin/server.rs +++ b/prover-service/src/bin/server.rs @@ -13,7 +13,7 @@ use tonic_health::server::health_reporter; )] struct Args { /// Port number for the server - #[arg(long, default_value = "9090")] + #[arg(long, default_value = "9090", env = "PORT")] port: u16, /// Private key of the prover (must be allowlisted by the prover network for now) @@ -22,11 +22,15 @@ struct Args { private_key: String, /// Path to the ELF file - #[arg(long, default_value = "elf/riscv32im-succinct-zkvm-elf")] + #[arg( + long, + default_value = "elf/riscv32im-succinct-zkvm-elf", + env = "ELF_PATH" + )] elf_path: String, /// Timeout for waiting for the proof in seconds - #[arg(long, default_value = "300")] + #[arg(long, default_value = "300", env = "TIMEOUT_SECS")] timeout_secs: u64, } @@ -39,7 +43,7 @@ async fn main() -> Result<(), Box> { let args = Args::parse(); // Start the server - let addr = format!("[::1]:{}", args.port).parse()?; + let addr = format!("0.0.0.0:{}", args.port).parse()?; let service: ProverServiceImpl = ProverServiceImpl::new(&args.private_key, &args.elf_path, args.timeout_secs)?;