-
Notifications
You must be signed in to change notification settings - Fork 14
/
docker-compose.yml
254 lines (239 loc) · 7.92 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
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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
---
version: "3.7"
services:
requester:
image: "ghcr.io/bacalhau-project/bacalhau:v${BACALHAU_VERSION:-1.2.0}"
hostname: requester
command: serve --ipfs-connect '/dns4/ipfs/tcp/5001' --node-type requester --private-internal-ipfs=false --peer none --labels "owner=labdao" --job-selection-probe-http "http://receptor:8080/judge"
environment:
BACALHAU_ENVIRONMENT: local
LOG_LEVEL: trace
ports:
- 1234:1234
- 1235:1235
depends_on:
ipfs:
condition: service_healthy
# sidecar container for requester healthcheck
requester_health:
image: "alpine"
command: sh -c 'apk add curl && sleep infinity'
depends_on:
requester:
condition: service_started
healthcheck:
test: curl -f http://requester:1234/api/v1/healthz
interval: 10s
timeout: 10s
retries: 10
start_period: 10s
compute:
image: "ghcr.io/bacalhau-project/bacalhau:v${BACALHAU_VERSION:-1.2.0}"
hostname: compute
user: root
command: serve --ipfs-connect '/dns4/ipfs/tcp/5001' --node-type compute --labels "owner=labdao" --private-internal-ipfs=false --peer "/dns4/requester/tcp/1234/http" --job-selection-probe-http "http://receptor:8080/judge" --job-selection-accept-networked --job-selection-data-locality anywhere
environment:
BACALHAU_ENVIRONMENT: local
LOG_LEVEL: trace
DOCKER_DEFAULT_PLATFORM: linux/amd64
# Keep containers around - I think
KEEP_STACK: "true"
BACALHAU_DIR: /tmp/bacalhau
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /tmp:/tmp
depends_on:
ipfs:
condition: service_healthy
requester:
condition: service_started
requester_health:
condition: service_healthy
# sidecar container for compute healthcheck
compute_health:
image: "alpine"
command: sh -c 'apk add curl && sleep infinity'
depends_on:
compute:
condition: service_started
healthcheck:
test: curl -f http://compute:1234/api/v1/healthz
interval: 10s
timeout: 10s
retries: 10
start_period: 10s
dbbackend:
image: "postgres:15.4"
command: ["postgres", "-c", "log_statement=all", "-c", "log_destination=stderr"]
environment:
POSTGRES_PASSWORD: labdao
POSTGRES_USER: labdao
POSTGRES_DB: backend
ports:
- 5432:5432
volumes:
- dbdata-backend:/var/lib/postgresql/data
healthcheck:
test: pg_isready -U postgres || exit 1
interval: 10s
timeout: 10s
retries: 10
start_period: 10s
backend:
build:
context: .
cache_from:
- quay.io/labdao/backend:latest
args:
BACALHAU_VERSION: ${BACALHAU_VERSION:-1.2.0}
ports:
- 8080:8080
environment:
POSTGRES_PASSWORD: labdao
POSTGRES_USER: labdao
POSTGRES_DB: backend
POSTGRES_HOST: dbbackend
BACALHAU_API_HOST: requester
IPFS_API_HOST: ipfs
FRONTEND_URL: ${FRONTEND_URL:-http://localhost:3000}
MAX_QUEUE_TIME_SECONDS: ${MAX_QUEUE_TIME_SECONDS:-259200} # default 72 hours
MAX_COMPUTE_TIME_SECONDS: ${MAX_COMPUTE_TIME_SECONDS:-259200} # default 72 hours
STRIPE_SECRET_KEY: ${STRIPE_SECRET_KEY}
STRIPE_WEBHOOK_SECRET_KEY: ${STRIPE_WEBHOOK_SECRET_KEY}
STRIPE_PRODUCT_ID: ${STRIPE_PRODUCT_ID:-prod_QKV1WnGBNd6YSf}
STRIPE_PRICE_ID: ${STRIPE_PRICE_ID:-price_1PTq152mES9P7kjwCKTlLICG}
NEXT_PUBLIC_PRIVY_APP_ID: ${NEXT_PUBLIC_PRIVY_APP_ID}
PRIVY_PUBLIC_KEY: ${PRIVY_PUBLIC_KEY}
AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID}
AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY}
AWS_REGION: ${AWS_REGION:-us-east-1}
AUTOTASK_WEBHOOK: ${AUTOTASK_WEBHOOK}
PINATA_API_TOKEN: ${PINATA_API_TOKEN}
BUCKET_ENDPOINT: ${BUCKET_ENDPOINT:-http://object-store:9000}
BUCKET_ACCESS_KEY_ID: ${BUCKET_ACCESS_KEY_ID:-minioadmin}
BUCKET_SECRET_ACCESS_KEY: ${BUCKET_SECRET_ACCESS_KEY:-minioadmin}
BUCKET_USE_SSL: ${BUCKET_USE_SSL}
BUCKET_NAME: ${BUCKET_NAME:-test-bucket}
RAY_API_HOST: ${RAY_API_HOST}
TIER_THRESHOLD: ${TIER_THRESHOLD}
depends_on:
dbbackend:
condition: service_healthy
# stripe-cli:
# condition: service_started
healthcheck:
test: wget --no-verbose --tries=1 --spider http://localhost:8080/healthcheck || exit 1
interval: 10s
timeout: 10s
retries: 10
start_period: 10s
volumes:
- stripe-secrets:/var/secrets/stripe
default-model-setup:
image: "alpine"
command: >
sh -exc "
apk add --no-cache curl jq &&
jq '{\"modelJson\": ., \"walletAddress\": \"0xA5B68dbA49cE48d0c1e0f29EA45885b5f83A0BD4\"}' /opt/plex/models/colabdesign/colabdesign-gateway.json | curl -s -H \"Content-Type: application/json\" -X POST --data-binary @- http://backend:8080/models &&
jq '{\"modelJson\": ., \"walletAddress\": \"0xA5B68dbA49cE48d0c1e0f29EA45885b5f83A0BD4\"}' /opt/plex/models/labsay/labsay.json | curl -s -H \"Content-Type: application/json\" -X POST --data-binary @- http://backend:8080/models &&
sleep infinity"
volumes:
- ./:/opt/plex:ro
depends_on:
backend:
condition: service_healthy
frontend:
build:
context: ./frontend
dockerfile: ./Dockerfile
cache_from:
- quay.io/labdao/frontend:latest
args:
NEXT_PUBLIC_PRIVY_APP_ID: ${NEXT_PUBLIC_PRIVY_APP_ID}
NEXT_PUBLIC_BACKEND_URL: ${NEXT_PUBLIC_BACKEND_URL:-http://localhost:8080}
NEXT_PUBLIC_IPFS_GATEWAY_ENDPOINT: ${NEXT_PUBLIC_IPFS_GATEWAY_ENDPOINT:-http://localhost:8888/ipfs/}
environment:
NODE_ENV: 'production'
ports:
- 3000:3000
dbreceptor:
image: "postgres:15.4"
command: ["postgres", "-c", "log_statement=all", "-c", "log_destination=stderr"]
environment:
POSTGRES_PASSWORD: labdao
POSTGRES_USER: labdao
POSTGRES_DB: receptor
volumes:
- dbdata-receptor:/var/lib/postgresql/data
healthcheck:
test: pg_isready -U postgres || exit 1
interval: 10s
timeout: 10s
retries: 10
start_period: 10s
receptor:
build:
context: ./receptor
dockerfile: ./Dockerfile
cache_from:
- quay.io/labdao/receptor:latest
x-develop:
watch:
- action: rebuild
path: ./receptor
environment:
PGHOST: dbreceptor
PGUSER: labdao
PGPASSWORD: labdao
PGDATABASE: receptor
PGSSLMODE: disable
depends_on:
dbreceptor:
condition: service_healthy
ipfs:
hostname: ipfs
# If building from Mac, comment out build and uncomment image
build:
context: ./docker/images/ipfs
dockerfile: ./Dockerfile
cache_from:
- quay.io/labdao/ipfs:latest
# image: "ipfs/kubo:v0.18.0"
volumes:
- ipfs:/data/ipfs
environment:
IPFS_LOGGING: "info"
IPFS_GATEWAY_PORT: "8888"
IPFS_DEBUG: "false"
ports:
- 4001:4001
- 5001:5001
- 8888:8888
object-store:
image: quay.io/minio/minio
ports:
- "9000:9000"
- "9001:9001"
environment:
MINIO_ROOT_USER: ${BUCKET_ACCESS_KEY_ID:-minioadmin}
MINIO_ROOT_PASSWORD: ${BUCKET_SECRET_ACCESS_KEY:-minioadmin}
command: server /data --console-address ":9001"
volumes:
- minio-data:/data
# stripe-cli:
# image: stripe/stripe-cli
# entrypoint: ["/bin/sh", "-c"]
# command: >
# "export STRIPE_WEBHOOK_SECRET_KEY=$(stripe listen --api-key ${STRIPE_SECRET_KEY} --print-secret --forward-to http://backend:8080/stripe | awk '/^> Ready! Your webhook signing secret is/ {print $NF}') &&
# echo $STRIPE_WEBHOOK_SECRET_KEY > /var/secrets/stripe/secret.txt &&
# stripe listen --api-key ${STRIPE_SECRET_KEY} --forward-to http://localhost:8080/stripe"
# environment:
# STRIPE_SECRET_KEY: ${STRIPE_SECRET_KEY}
# volumes:
# - stripe-secrets:/var/secrets/stripe
volumes:
dbdata-backend:
dbdata-receptor:
ipfs:
minio-data:
stripe-secrets: