-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: prove stdio using amqp docker compose setup (#763)
* feat: docker compose setup for proving test * fix: number of workers * fix: cleanup * fix: nit * nit: comment * fix: shellcheck * fix: load strategy * fix: update shellcheck
- Loading branch information
Showing
4 changed files
with
80 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- # Docker compose setup for running the leader and worker with amqp communication | ||
version: "3" | ||
services: | ||
|
||
leader: | ||
build: | ||
context: ../ | ||
dockerfile: Dockerfile | ||
depends_on: | ||
rabbitmq: | ||
condition: service_healthy | ||
command: bash -c "leader --runtime amqp \ | ||
--load-strategy on-demand \ | ||
--proof-output-dir ./proofs \ | ||
--block-batch-size ${LEADER_BLOCK_BATCH_SIZE} stdio < /witness" | ||
environment: | ||
- RUST_LOG=info | ||
- AMQP_URI=amqp://rabbitmq:5672 | ||
volumes: | ||
- ${PROOF_OUTPUT_DIR}:/proofs/:rw | ||
- ${LEADER_INPUT_JSON_FILE}:/witness:ro | ||
|
||
worker: | ||
build: | ||
context: ../ | ||
dockerfile: Dockerfile | ||
depends_on: | ||
rabbitmq: | ||
condition: service_healthy | ||
environment: | ||
- RUST_LOG=info | ||
- AMQP_URI=amqp://rabbitmq:5672 | ||
- ZK_EVM_CACHE_DIR=/zk_evm_circuit_cache | ||
command: worker | ||
volumes: | ||
- ${DOCKER_CIRCUITS_CACHE_DIR}/worker:/zk_evm_circuit_cache:rw | ||
deploy: | ||
mode: replicated | ||
replicas: 2 | ||
|
||
rabbitmq: | ||
image: rabbitmq:3-management | ||
ports: | ||
- "5672:5672" | ||
- "15672:15672" | ||
healthcheck: | ||
test: rabbitmq-diagnostics -q ping | ||
interval: 10s | ||
timeout: 30s | ||
retries: 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
export LEADER_INPUT_JSON_FILE=$1 | ||
|
||
export LEADER_BLOCK_BATCH_SIZE="${BLOCK_BATCH_SIZE:-8}" | ||
|
||
REPO_ROOT=$(git rev-parse --show-toplevel) | ||
|
||
export PROOF_OUTPUT_DIR="${REPO_ROOT}/proofs" | ||
mkdir -p "$PROOF_OUTPUT_DIR" | ||
chmod 777 "$PROOF_OUTPUT_DIR" | ||
|
||
export DOCKER_CIRCUITS_CACHE_DIR="./docker_circuit_cache" | ||
mkdir -p "$DOCKER_CIRCUITS_CACHE_DIR/worker" | ||
chmod 777 "$DOCKER_CIRCUITS_CACHE_DIR/worker" | ||
|
||
docker compose up |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters