-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
175 lines (169 loc) · 7.7 KB
/
Copy pathdocker-compose.yml
File metadata and controls
175 lines (169 loc) · 7.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
services:
hierophant:
image: ${HIEROPHANT_IMAGE:-unattended/hierophant:latest}
container_name: hierophant
# Host networking: hierophant binds 9000 + 9010 directly on the host so
# Vast.ai contemplants reach them via the router-forwarded WAN IP and
# local fibonacci clients reach them via localhost. Eliminates Docker
# bridge + published-port indirection that complicates NAT hairpin.
network_mode: host
volumes:
- ./hierophant.toml:/home/hierophant/hierophant.toml:ro
env_file:
- .env
environment:
- RUST_LOG=info
healthcheck:
test: ["CMD", "bash", "-c", "exec 3<>/dev/tcp/localhost/9010 && echo -e 'GET /health HTTP/1.1\\r\\nHost: localhost\\r\\nConnection: close\\r\\n\\r\\n' >&3 && timeout 1 cat <&3 | head -n 1 | grep -q '200 OK'"]
# Generous window: Hierophant's SP1 CpuProver init alone can take
# several minutes on modest hardware (76s observed on a small
# droplet) before the HTTP server binds.
interval: 5s
timeout: 2s
retries: 60
start_period: 30s
magister:
image: ${MAGISTER_IMAGE:-unattended/magister:latest}
container_name: magister
network_mode: host
volumes:
- ./magister.toml:/home/magister/magister.toml:ro
env_file:
- .env
environment:
- RUST_LOG=info
depends_on:
hierophant:
condition: service_healthy
healthcheck:
test: ["CMD", "bash", "-c", "exec 3<>/dev/tcp/localhost/8555 && echo -e 'GET /summary HTTP/1.1\\r\\nHost: localhost\\r\\nConnection: close\\r\\n\\r\\n' >&3 && timeout 1 cat <&3 | head -n 1 | grep -q '200 OK'"]
interval: 2s
timeout: 2s
retries: 10
start_period: 10s
# SP1 fibonacci proof. Talks to Hierophant's SP1 prover network gRPC on
# :9000 via sp1-sdk's network prover. SP1_PROOF_SYSTEM picks the SP1
# proving mode and defaults to plonk; override via .env to exercise core,
# compressed, plonk, or groth16. Selected via the `sp1` compose profile;
# `make test-sp1` activates it, `make scriptory` activates this alongside
# fibonacci-risc0 and fibonacci-openvm via the `all` profile alias.
# The SP1 fibonacci demo client. Generates a proof and emits a Solidity-
# verifier-compatible JSON fixture; verification of the proof itself
# happens server-side at Hierophant before the proof is returned, so this
# client doesn't carry the SP1 circuit artifacts that a client.verify
# path would need. Build context is the repo root so the Dockerfile's
# `COPY src/sp1-fibonacci/...` and `COPY src/fibonacci/` paths resolve.
fibonacci-sp1:
profiles: ["sp1", "all"]
build:
context: .
dockerfile: src/sp1-fibonacci/Dockerfile
args:
BUILD_IMAGE: ${BUILD_IMAGE:-unattended/petros:latest}
container_name: fibonacci-sp1
network_mode: host
depends_on:
hierophant:
condition: service_healthy
magister:
condition: service_healthy
environment:
- RUST_LOG=info
- SP1_PROOF_SYSTEM=${SP1_PROOF_SYSTEM:-plonk}
# Override the Dockerfile-baked NETWORK_RPC_URL=http://hierophant:9000;
# with host networking the Docker DNS name no longer resolves.
- NETWORK_RPC_URL=http://${HIEROPHANT_IP:-localhost}:9000
command:
- bash
- -c
- |
echo "Waiting for an SP1-capable idle Contemplant..."
while ! (exec 3<>/dev/tcp/${HIEROPHANT_IP:-localhost}/9010 && echo -e 'GET /contemplants HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n\r\n' >&3 && cat <&3 | grep -q "Idle"); do
echo "No idle Contemplants available yet, waiting..."
sleep 5
done
echo "Idle Contemplant found, starting SP1 fibonacci proof (system=$$SP1_PROOF_SYSTEM)..."
cargo run --release --bin evm -- --n 10 --system "$$SP1_PROOF_SYSTEM"
# RISC Zero fibonacci proof. Talks to Hierophant's Bonsai-shaped REST
# surface at :9010/bonsai/ via bonsai-sdk. PROOF_MODE picks the STARK
# variant (composite / succinct / groth16) and WRAP_SNARK flips on the
# canonical Bonsai composite -> Groth16 wrap flow. WRAP_SNARK=true
# requires the spawned Contemplant to advertise groth16_enabled. The
# compose profile `risc0` opts this service in.
# The RISC Zero fibonacci Dockerfile is taken verbatim from hierophant's
# integration test. It uses the shared `src/fibonacci/` no_std crate
# (path-dep'd from both guest and host), so the build context must be
# the repo root rather than `src/risc0-fibonacci/`.
fibonacci-risc0:
profiles: ["risc0", "all"]
build:
context: .
dockerfile: src/risc0-fibonacci/Dockerfile
args:
BUILD_IMAGE: ${BUILD_IMAGE:-unattended/petros:latest}
container_name: fibonacci-risc0
network_mode: host
depends_on:
hierophant:
condition: service_healthy
magister:
condition: service_healthy
environment:
- RUST_LOG=info
- PROOF_MODE=${RISC0_PROOF_MODE:-composite}
- WRAP_SNARK=${RISC0_WRAP_SNARK:-false}
command:
- bash
- -c
- |
echo "Waiting for a RISC Zero-capable idle Contemplant..."
while ! (exec 3<>/dev/tcp/${HIEROPHANT_IP:-localhost}/9010 && echo -e 'GET /contemplants HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n\r\n' >&3 && cat <&3 | grep -q "Idle"); do
echo "No idle Contemplants available yet, waiting..."
sleep 5
done
echo "Idle Contemplant found, starting RISC Zero fibonacci proof (mode=$$PROOF_MODE, wrap=$$WRAP_SNARK)..."
cargo run --release --bin evm -- --n 10 --bonsai-url http://${HIEROPHANT_IP:-localhost}:9010/bonsai
# OpenVM fibonacci proof. Talks to Hierophant's OpenVM-shaped REST surface
# at :9010/openvm/ over raw reqwest; OpenVM has no bonsai-sdk analog, so
# the client speaks the wire format directly. PROOF_MODE picks the proof
# flavor: app (app-level continuation STARK, the default), stark
# (aggregated root STARK), or evm (halo2-wrapped EVM proof; requires a
# Contemplant spawned with CONTEMPLANT_OPENVM_EVM=true or an
# evm_enabled = true prover entry in magister.toml). The compose profile
# `openvm` opts this service in; `make test-openvm` activates it.
# Build context is the repo root so the Dockerfile can COPY the shared
# `src/fibonacci/` crate, `container/vendor.sh`, and the
# `provers/openvm/git/` checksums for the vendored OpenVM git mirrors.
# VENDOR_BASE_URL and OPENVM_GIT_VERSION come from `.env.maintainer` via
# the Makefile; the substitution defaults below match those values so a
# bare `docker compose` invocation also works.
fibonacci-openvm:
profiles: ["openvm", "all"]
build:
context: .
dockerfile: src/openvm-fibonacci/Dockerfile
args:
BUILD_IMAGE: ${BUILD_IMAGE:-unattended/petros:latest}
VENDOR_BASE_URL: ${VENDOR_BASE_URL:-https://sigil-attic.nyc3.digitaloceanspaces.com/sigil-tarballs}
OPENVM_GIT_VERSION: ${OPENVM_GIT_VERSION:-v2.0.1}
container_name: fibonacci-openvm
network_mode: host
depends_on:
hierophant:
condition: service_healthy
magister:
condition: service_healthy
environment:
- RUST_LOG=info
- PROOF_MODE=${OPENVM_PROOF_MODE:-app}
command:
- bash
- -c
- |
echo "Waiting for an OpenVM-capable idle Contemplant..."
while ! (exec 3<>/dev/tcp/${HIEROPHANT_IP:-localhost}/9010 && echo -e 'GET /contemplants HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n\r\n' >&3 && cat <&3 | grep -q "Idle"); do
echo "No idle Contemplants available yet, waiting..."
sleep 5
done
echo "Idle Contemplant found, starting OpenVM fibonacci proof (mode=$$PROOF_MODE)..."
cargo run --release --locked --bin host -- --n 10 --openvm-url http://${HIEROPHANT_IP:-localhost}:9010/openvm