forked from risc0/risc0
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yml
More file actions
205 lines (196 loc) · 5.59 KB
/
compose.yml
File metadata and controls
205 lines (196 loc) · 5.59 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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
name: bento
services:
redis:
hostname: ${REDIS_HOST}
image: ${REDIS_IMG}
restart: always
ports:
- 6379:6379
volumes:
- redis-data:/data
postgres:
hostname: ${POSTGRES_HOST}
image: ${POSTGRES_IMG}
restart: always
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
expose:
- '${POSTGRES_PORT}'
ports:
- '${POSTGRES_PORT}:${POSTGRES_PORT}'
volumes:
- postgres-data:/var/lib/postgresql/data
command: -p ${POSTGRES_PORT}
minio:
hostname: ${MINIO_HOST}
image: ${MINIO_IMG}
ports:
- '9000:9000'
- '9001:9001'
volumes:
- minio-data:/data
command: server /data --console-address ":9001"
environment:
- MINIO_ROOT_USER=${MINIO_ROOT_USER}
- MINIO_ROOT_PASSWORD=${MINIO_ROOT_PASS}
- MINIO_DEFAULT_BUCKETS=${MINIO_BUCKET}
healthcheck:
test: ["CMD", "mc", "ready", "local"]
interval: 5s
timeout: 5s
retries: 5
grafana:
image: ${GRAFANA_IMG}
restart: unless-stopped
ports:
- '3000:3000'
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=admin
- GF_LOG_LEVEL=WARN
- POSTGRES_HOST=${POSTGRES_HOST}
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_PORT={POSTGRES_PORT}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASS=${POSTGRES_PASSWORD}
volumes:
- ./grafana:/etc/grafana/provisioning/
- grafana-data:/var/lib/grafana
depends_on:
- postgres
- redis
- minio
exec_agent:
image: agent
runtime: nvidia
restart: always
depends_on:
- postgres
- redis
- minio
build:
context: .
dockerfile: bento/dockerfiles/agent.dockerfile
args:
NVCC_APPEND_FLAGS: "--gpu-architecture=compute_86 --gpu-code=compute_86,sm_86 --generate-code arch=compute_86,code=sm_86"
CUDA_OPT_LEVEL: 1
mem_limit: 4G
cpu_count: 4
environment:
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}
REDIS_URL: redis://${REDIS_HOST}:6379
S3_URL: http://${MINIO_HOST}:9000
S3_BUCKET: ${MINIO_BUCKET}
# TODO: create a lower perm user on startup of minio to use for agents
S3_ACCESS_KEY: ${MINIO_ROOT_USER}
S3_SECRET_KEY: ${MINIO_ROOT_PASS}
RUST_LOG: ${RUST_LOG}
RUST_BACKTRACE: 1
RISC0_KECCAK_PO2: ${RISC0_KECCAK_PO2}
# Enable / disable along with gpu_*_agent*
# JOIN_STREAM: 1
# COPROC_STREAM: 1
entrypoint: /app/agent -t exec --segment-po2 ${SEGMENT_SIZE}
aux_agent:
image: agent
runtime: nvidia
pull_policy: never
restart: always
depends_on:
- postgres
- redis
- minio
mem_limit: 256M
cpu_count: 1
environment:
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}
REDIS_URL: redis://${REDIS_HOST}:6379
S3_URL: http://${MINIO_HOST}:9000
S3_BUCKET: ${MINIO_BUCKET}
S3_ACCESS_KEY: ${MINIO_ROOT_USER}
S3_SECRET_KEY: ${MINIO_ROOT_PASS}
RUST_LOG: ${RUST_LOG}
RUST_BACKTRACE: 1
# NOTE: if adding more aux workers, only one needs --monitor-requeue (for task reaping)
entrypoint: /app/agent -t aux --monitor-requeue
gpu_prove_agent0: &gpu
image: agent
runtime: nvidia
pull_policy: never
restart: always
depends_on:
- postgres
- redis
- minio
mem_limit: 4G
cpu_count: 4
environment:
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}
REDIS_URL: redis://${REDIS_HOST}:6379
S3_URL: http://${MINIO_HOST}:9000
S3_BUCKET: ${MINIO_BUCKET}
S3_ACCESS_KEY: ${MINIO_ROOT_USER}
S3_SECRET_KEY: ${MINIO_ROOT_PASS}
RUST_LOG: ${RUST_LOG}
RUST_BACKTRACE: 1
entrypoint: /app/agent -t prove
# comment-out if running in CPU proving mode
deploy:
resources:
reservations:
devices:
- driver: nvidia
# TODO: how to scale this with N gpus?
device_ids: ['0']
capabilities: [gpu]
snark_agent:
image: agent
runtime: nvidia
pull_policy: never
restart: always
depends_on:
- postgres
- redis
- minio
environment:
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}
REDIS_URL: redis://${REDIS_HOST}:6379
S3_URL: http://${MINIO_HOST}:9000
S3_BUCKET: ${MINIO_BUCKET}
S3_ACCESS_KEY: ${MINIO_ROOT_USER}
S3_SECRET_KEY: ${MINIO_ROOT_PASS}
RUST_LOG: ${RUST_LOG}
RUST_BACKTRACE: 1
entrypoint: /app/agent -t snark
ulimits:
# Needed for stark_verify bin
# TODO: this number was just guess and check found
stack: 90000000
rest_api:
restart: always
depends_on:
- postgres
- minio
build:
context: .
dockerfile: bento/dockerfiles/rest_api.dockerfile
mem_limit: 1G
cpu_count: 1
environment:
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}
S3_URL: http://${MINIO_HOST}:9000
S3_BUCKET: ${MINIO_BUCKET}
S3_ACCESS_KEY: ${MINIO_ROOT_USER}
S3_SECRET_KEY: ${MINIO_ROOT_PASS}
RUST_LOG: ${RUST_LOG}
RUST_BACKTRACE: 1
ports:
- '8081:8081'
entrypoint: /app/rest_api --bind-addr 0.0.0.0:8081
volumes:
redis-data:
postgres-data:
minio-data:
grafana-data: