-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdocker-compose.yml
147 lines (146 loc) · 4.95 KB
/
docker-compose.yml
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
services:
params-ftp:
image: zkwasm/params
network_mode: "host"
attach: false
# ports:
# - "21:21"
# - "30000-30009:30000-30009"
environment:
PUBLICHOST: "localhost"
FTP_USER_NAME: ftpuser
FTP_USER_PASS: ftppassword
FTP_USER_HOME: /home/ftpuser
# ADDED_FLAGS: "-p 2121:2121 -p 30000-31000:30000-31000"
healthcheck:
# Basic health check to ensure the FTP server is running
test: "ls -l /var/run/pure-ftpd.pid"
interval: 30s
timeout: 10s
retries: 3
mongodb:
image: zkwasm/zkwasm-mongo-merkle:6792da2e7893e0306e5b4efa
attach: false
network_mode: "host"
environment:
# Set this port if 27017 is already used by another service/mongodb instance
# Mostly useful if using network_mode: "host", as the port will be shared.
- MONGO_INITDB_PORT=27017
# ports:
# - "27017:27017"
volumes:
- mongodb_data:/data/db
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "5"
command: --port 27017 --wiredTigerCacheSizeGB 7
healthcheck:
test: |
mongosh --port 27017 --quiet --eval '
const ping = db.adminCommand({ ping: 1 }).ok;
const init = db.init_status.findOne({ "_id": "init" }) != null;
if (ping && init) { quit(0) } else { quit(1) }
'
interval: 30s
start_period: 20s
timeout: 10s
retries: 10000
container_name: zkwasm-mongodb
prover-dry-run-service:
image: zkwasm:latest
attach: false
runtime: nvidia
network_mode: "host"
user: "1001:1001"
build:
context: .
dockerfile: Dockerfile
depends_on:
mongodb:
condition: service_healthy
healthcheck:
test: pgrep -f zkwasm-playground
start_period: 15s
interval: 15s
timeout: 5s
retries: 3
volumes:
- ./prover_config.json:/home/zkwasm/prover-node-release/prover_config.json
- ./dry_run_config.json:/home/zkwasm/prover-node-release/dry_run_config.json
# Volume for the whole workspace directory to persist workspace data
# may have to consider handling changes in the workspace directory (delete volume probably)
- workspace-volume:/home/zkwasm/prover-node-release/workspace
# Volume for the logs directory to persist logs
- dry-run-logs-volume:/home/zkwasm/prover-node-release/logs/dry_run
# configure huge pages for the prover
- /dev/hugepages:/dev/hugepages
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "5"
environment:
- TZ=Etc/UTC
# Override default command to run as a dry-run service
command: bash -c "
time=$$(date +%Y-%m-%d-%H-%M-%S)
RUST_LOG=info ./target/release/zkwasm-playground --dryrunconfig dry_run_config.json -w workspace --dryrun=prover \
2>&1 | sudo rotatelogs -e -n 10 logs/dry_run/dry_run_$${time}.log 100M"
prover-node:
image: zkwasm:latest
runtime: nvidia
network_mode: "host"
depends_on:
prover-dry-run-service:
condition: service_healthy
params-ftp:
condition: service_healthy
deploy:
resources:
reservations:
devices:
- driver: nvidia
# Use all GPUs available on the system by default
# count: all
# If you want to specify which GPUs to use, uncomment the following line
# and specify the GPU IDs. You can run `nvidia-smi` to see the GPU IDs.
# Ensure 'count' field above is commented out if uncommenting the following line as they are mutually exclusive.
# ref:: https://docs.docker.com/compose/gpu-support/
# By default we just use the first GPU
device_ids: ["0"]
capabilities: [gpu]
user: "1001:1001"
build:
context: .
dockerfile: Dockerfile
volumes:
- ./prover_config.json:/home/zkwasm/prover-node-release/prover_config.json
- ./dry_run_config.json:/home/zkwasm/prover-node-release/dry_run_config.json
# Volume for the whole workspace directory to persist workspace data
# may have to consider handling changes in the workspace directory (delete volume probably)
- workspace-volume:/home/zkwasm/prover-node-release/workspace
# Volume for the logs directory to persist logs
- prover-logs-volume:/home/zkwasm/prover-node-release/logs/prover
# configure huge pages for the prover
- /dev/hugepages:/dev/hugepages
# Starting script for the prover
- ./_start_prover-node-service.sh:/home/zkwasm/prover-node-release/_start_prover-node-service.sh
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "5"
environment:
- TZ=Etc/UTC
command:
[
"/bin/bash",
"/home/zkwasm/prover-node-release/_start_prover-node-service.sh",
]
volumes:
workspace-volume:
prover-logs-volume:
dry-run-logs-volume:
mongodb_data: