-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathdocker-compose.yml
291 lines (273 loc) · 8.99 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
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
services:
bee-api:
user: root
depends_on:
redis: { condition: service_started }
mongo: { condition: service_healthy }
minio: { condition: service_started }
image: icr.io/i-am-bee/bee-api:0.0.22
command: >
/bin/sh -c '
output=$(npx mikro-orm seeder:run 2>&1);
echo "$$output";
if ! (echo "$$output" | grep -qiE "already seeded|success"); then
echo "Error occured" && exit 1;
fi &&
npx mikro-orm migration:up &&
node \
--enable-source-maps \
--experimental-loader=@opentelemetry/instrumentation/hook.mjs \
--import ./dist/opentelemetry.js \
./dist/server.js
'
env_file: [ .env ]
environment: &api-env
MONGODB_URL: mongodb://mongo:27017?directConnection=true
MONGODB_DATABASE_NAME: bee-api
REDIS_URL: redis://redis:6379/0
REDIS_CACHE_URL: redis://redis:6379/8
AUTH_JWKS_URI: http://localhost:4000/v1/ui/jwks
AUTH_JWT_ISSUER: https://localhost
AUTH_JWT_AUDIENCE: bee-test
HTTP_PROXY_URL: http://localhost:3128
BEE_CODE_INTERPRETER_URL: http://bee-code-interpreter-k3s:30081
BEE_CODE_INTERPRETER_STORAGE_BACKEND: filesystem
BEE_CODE_INTERPRETER_FILE_STORAGE_PATH: /storage
# Shutdown is not working properly anyway
SHUTDOWN_GRACEFUL_PERIOD: 1
S3_ENDPOINT: http://minio:9000
S3_ACCESS_KEY_ID: minioadmin
S3_SECRET_ACCESS_KEY: minioadmin
S3_BUCKET_FILE_STORAGE: bee-api
BEE_OBSERVE_API_URL: http://bee-observe:4318
BEE_OBSERVE_API_AUTH_KEY: observe-auth-key
MILVUS_HOST: milvus
MILVUS_PORT: 19530
MILVUS_USE_TLS: false
MILVUS_USERNAME: user
MILVUS_PASSWORD: password
MILVUS_DATABASE_NAME: default
RUN_BULLMQ_WORKERS: runs,runs-cleanup,vectorStores-cleanup,vectorStores-fileProcessor,files-extraction-node,files-extraction-python
# Used to encrypt/decrypt values
# You can use `$ openssl rand -base64 32` to generate new one
CRYPTO_CIPHER_KEY: random_crypto_key
OTEL_EXPORTER_OTLP_ENDPOINT: http://collector:4318
BEE_FRAMEWORK_INSTRUMENTATION_ENABLED: true
BEE_FRAMEWORK_INSTRUMENTATION_METRICS_ENABLED: false
# Required env variables used only in migrations
IBM_ORGANIZATION_OWNER_ID: org_user_670cc04869ddffe24f4fd70e
AUTH_CLIENT_ID: dummy
AUTH_CLIENT_SECRET: dummy
AUTH_SERVER_PORT: 4001
AUTH_WELL_KNOWN: http://127.0.0.1:4001/.well-known/openid-configuration
AUTH_AUDIENCE: bee-test
healthcheck:
test: "wget --quiet -O - http://127.0.0.1:4000/healthcheck"
interval: 3s
retries: 20
start_period: 5s
volumes:
- code-interpreter-storage:/storage
ports:
- "4000:4000"
profiles: [ all ]
bee-api-python-workers:
image: icr.io/i-am-bee/bee-api-workers-python:0.0.21-docling
env_file: [ .env ]
environment:
<<: *api-env
DOCLING_DO_TABLE_STRUCTURE: false
DOCLING_PDF_DO_OCR: false
healthcheck:
test: "wget --quiet -O - http://127.0.0.1:8080/health"
interval: 3s
retries: 20
start_period: 5s
profiles: [ text-extraction ]
bee-ui:
depends_on:
bee-api: { condition: service_healthy }
image: icr.io/i-am-bee/bee-ui-local:0.0.24
env_file: [ .env ]
environment:
NEXTAUTH_URL: http://localhost:3000
NEXTAUTH_SECRET: top-secret
NEXT_PUBLIC_USERCONTENT_SITE_URL: http://localhost:5173
API_URL: http://bee-api:4000
DUMMY_JWT_TOKEN: "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ0ZXN0IiwicHJlZmVycmVkX3VzZXJuYW1lIjoiVGVzdCBVc2VyIiwiZW1haWwiOiJ0ZXN0QGVtYWlsLmNvbSIsImlhdCI6MTUxNjIzOTAyMiwiaXNzIjoiaHR0cHM6Ly9sb2NhbGhvc3QiLCJhdWQiOiJiZWUtdGVzdCJ9.vwkGnl7lBbzJYk6BtoW3VoA3mnNJVI-nDQU8aK7zOH-rkf2pn5cn6CKwpq7enDInIXro8WtBLNZP8Nr8GQIZKahICuP3YrPRmzv7YIW8LuXKnx1hycg5OAtj0OtQi5FYwwCxTYW9pBF2it7XwQSBcW7yYsOrvgs7jVhThCOsavX0YiAROxZIhk1idZT4Pl3egfUI_dy9iBxcn7xocTnos-94wqJNt8oCVgB8ynj75yJFHJbiQ-9Tym_V3LcMHoEyv67Jzie8KugCgdpuF6EbQqcyfYJ83q5jJpR2LiuWMuGsNSbjjDY-f1vCSMo9L9-R8KFrDylT_BzLvRBswOzW7A"
profiles: [ all ]
ports:
- "3000:3000"
bee-usercontent-site:
image: icr.io/i-am-bee/bee-usercontent-site-local:0.0.13
profiles: [ all ]
ports:
- "5173:8080"
bee-observe:
image: icr.io/i-am-bee/bee-observe:0.0.5
depends_on:
- mlflow
- mongo
- redis
command: >
/bin/sh -c "
touch tsconfig.json && npx mikro-orm --config dist/mikro-orm.config.js migration:up &&
node ./dist/index.js
"
environment:
PORT: 4318
AUTH_KEY: observe-auth-key
FASTIFY_BODY_LIMIT: 10485760
REDIS_URL: redis://redis:6379/1
MONGODB_URL: mongodb://mongo:27017?directConnection=true
DATA_EXPIRATION_IN_DAYS: 7
MLFLOW_API_URL: http://mlflow:8080/
MLFLOW_DEFAULT_EXPERIMENT_ID: 0
MLFLOW_AUTHORIZATION: BASE_AUTH
MLFLOW_USERNAME: user
MLFLOW_PASSWORD: password
MLFLOW_TRACE_DELETE_IN_BATCHES_CRON_PATTERN: "0 */1 * * * *"
MLFLOW_TRACE_DELETE_IN_BATCHES_BATCH_SIZE: 100
NODE_ENV: production
ports:
- "4318:4318"
profiles: [ all ]
bee-code-interpreter-k3s: &code-interpreter-def
image: "rancher/k3s:v1.30.5-k3s1"
command: [ "server", "--tls-san", "bee-code-interpreter-k3s" ]
tmpfs:
- /run
- /var/run
ulimits:
nproc: 65535
nofile:
soft: 65535
hard: 65535
privileged: true
restart: always
volumes:
- k3s-containerd:/var/lib/rancher/k3s/agent/containerd
- code-interpreter-storage:/storage
- ./bee-code-interpreter.yaml:/var/lib/rancher/k3s/server/manifests/bee-code-interpreter.yaml
ports:
- "50081:30081"
healthcheck:
test: "kubectl get pod code-interpreter | grep Running"
interval: 10s
retries: 10
start_period: 30s
profiles: [ all ]
collector:
image: otel/opentelemetry-collector-contrib:0.112.0
volumes:
- ./otel-collector-config.yaml:/etc/otelcol-contrib/config.yaml
profiles: [ all, infra ]
# Locally mounted storage to work with local bee-api instance
bee-code-interpreter-k3s-infra:
<<: *code-interpreter-def
volumes:
- k3s-containerd:/var/lib/rancher/k3s/agent/containerd
- ./tmp/code-interpreter-storage:/storage
- ./bee-code-interpreter.yaml:/var/lib/rancher/k3s/server/manifests/bee-code-interpreter.yaml
profiles: [ infra ]
redis:
image: redis:7
ports:
- 6379:6379
command: redis-server --save 20 1 --loglevel warning
volumes:
- redis:/data
profiles: [ all, infra ]
mongo:
image: mongo:7
command: [ "--replSet", "rs0", "--bind_ip_all", "--port", "27017" ]
ports:
- 27017:27017
healthcheck:
test: echo "try { rs.status() } catch (err) { rs.initiate({_id:'rs0',members:[{_id:0,host:'localhost:27017'}]}) }" | mongosh --port 27017 --quiet
interval: 3s
timeout: 30s
start_period: 0s
retries: 30
volumes:
- mongo:/data/db
profiles: [ all, infra ]
mlflow:
image: bitnami/mlflow:2.17.2
ports:
- '${MLFLOW_EXPOSED_PORT:-8080}:8080'
security_opt:
- "label=disable"
environment:
GUNICORN_CMD_ARGS: "--timeout=600"
entrypoint: [ "/bin/bash", "-c", "/entrypoint.sh && mlflow server --host 0.0.0.0 --port 8080" ]
volumes:
- mlflow:/app
- ./mlflow-entrypoint.sh:/entrypoint.sh:ro
profiles: [ all, infra ]
# MILVUS dependencies
milvus:
image: milvusdb/milvus:v2.4.6
command: [ "milvus", "run", "standalone" ]
security_opt:
- seccomp:unconfined
environment:
ETCD_ENDPOINTS: etcd:2379
MINIO_ADDRESS: minio:9000
volumes:
- milvus:/var/lib/milvus
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:9091/healthz" ]
interval: 30s
start_period: 90s
timeout: 20s
retries: 3
ports:
- "19530:19530"
- "9091:9091"
depends_on:
- "etcd"
- "minio"
profiles: [ all, infra ]
etcd:
image: quay.io/coreos/etcd:v3.5.5
environment:
- ETCD_AUTO_COMPACTION_MODE=revision
- ETCD_AUTO_COMPACTION_RETENTION=1000
- ETCD_QUOTA_BACKEND_BYTES=4294967296
- ETCD_SNAPSHOT_COUNT=50000
volumes:
- etcd:/etcd
command: etcd -advertise-client-urls=http://127.0.0.1:2379 -listen-client-urls http://0.0.0.0:2379 --data-dir /etcd
healthcheck:
test: [ "CMD", "etcdctl", "endpoint", "health" ]
interval: 30s
timeout: 20s
retries: 3
profiles: [ all, infra ]
minio:
image: bitnami/minio:2024.10.2
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
MINIO_DEFAULT_BUCKETS: bee-api
ports:
- 9001:9001
- 9000:9000
volumes:
- minio:/bitnami/minio/data
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:9000/minio/health/live" ]
interval: 30s
timeout: 20s
retries: 3
profiles: [ all, infra ]
volumes:
etcd:
minio:
milvus:
redis:
mongo:
code-interpreter-storage:
k3s-containerd:
mlflow: