Skip to content

Commit 8d4d09e

Browse files
authored
Merge pull request #650 from openmina/fix/docker-circuit-blobs
fix: Put circuit blobs in the right place when building docker images
2 parents 0671b5e + 7d280fb commit 8d4d09e

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ RUN cargo build --release --package=cli --bin=openmina
99
RUN cargo build --release --features scenario-generators --bin openmina-node-testing
1010

1111
# necessary for proof generation when running a block producer.
12-
RUN git clone --depth 1 https://github.com/openmina/circuit-blobs.git
13-
RUN mv node/web/circuit-blobs/* ledger
12+
RUN git clone --depth 1 https://github.com/openmina/circuit-blobs.git \
13+
&& rm -rf circuit-blobs/berkeley_rc1 circuit-blobs/*/tests
1414

1515
FROM openmina/mina-snark-worker-prover:${MINA_SNARK_WORKER_TAG} AS prover
1616

@@ -19,5 +19,7 @@ RUN apt-get update && apt-get install -y libjemalloc2 libssl1.1 libpq5 curl jq p
1919
COPY --from=build /openmina/cli/bin/snark-worker /usr/local/bin/
2020
COPY --from=build /openmina/target/release/openmina /usr/local/bin/
2121
COPY --from=build /openmina/target/release/openmina-node-testing /usr/local/bin/
22+
RUN mkdir -p /usr/local/lib/openmina/circuit-blobs
23+
COPY --from=build /openmina/circuit-blobs/ /usr/local/lib/openmina/circuit-blobs/
2224
COPY --from=prover /usr/local/bin/mina /usr/local/bin
2325
ENTRYPOINT [ "openmina" ]

ledger/src/proofs/gates.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,14 @@ fn read_gates() -> Gates {
8888
Vec<CircuitGate<F>>,
8989
) {
9090
let circuits_config = openmina_core::NetworkConfig::global().circuits_config;
91-
let base_dir = Path::new(env!("CARGO_MANIFEST_DIR"));
91+
let base_dir = std::env::var("OPENMINA_CIRCUIT_BLOBS_BASE_DIR")
92+
.unwrap_or_else(|_| env!("CARGO_MANIFEST_DIR").to_string());
93+
let base_dir = Path::new(&base_dir);
94+
let base_dir = if base_dir.exists() {
95+
base_dir
96+
} else {
97+
Path::new("/usr/local/lib/openmina/circuit-blobs")
98+
};
9299
let base_dir = base_dir.join(circuits_config.directory_name);
93100

94101
let internal_vars_path = base_dir.join(format!("{}_internal_vars.bin", filename));

0 commit comments

Comments
 (0)