-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathdocker-compose.yaml
204 lines (194 loc) · 6.55 KB
/
docker-compose.yaml
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
name: lumigator
services:
minio:
image: quay.io/minio/minio:RELEASE.2024-12-18T13-15-44Z
command: server /data --console-address ":9001"
ports:
- 9000:9000
- 9001:9001
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 5s
timeout: 20s
retries: 18
environment:
- MINIO_ROOT_USER=minioadmin
- MINIO_ROOT_PASSWORD=minioadmin
- MINIO_API_CORS_ALLOW_ORIGIN=*
volumes:
# - ${HOME}/minio/data:/data
- minio-data:/data
profiles:
- local
minio-admin:
image: quay.io/minio/minio:RELEASE.2024-12-18T13-15-44Z
depends_on:
minio:
condition: service_healthy
entrypoint:
- /bin/bash
- -c
- |
set -ex
mc alias set lumigator_s3 http://minio:9000 minioadmin minioadmin
mc admin user add lumigator_s3 lumigator lumigator
mc admin policy attach lumigator_s3 readwrite --user lumigator
mc mb -p lumigator_s3/lumigator-storage
extra_hosts:
- "localhost:host-gateway"
profiles:
- local
redis:
image: redis:8.0-M03-alpine
command: redis-server --save 60 1 --loglevel warning
profiles:
- local
volumes:
- redis-data:/data
healthcheck:
test: ["CMD-SHELL", "redis-cli ping"]
interval: 1s
timeout: 3s
retries: 5
ray:
image: rayproject/ray:2.30.0-py311${COMPUTE_TYPE}${RAY_ARCH_SUFFIX}
depends_on:
redis:
condition: service_healthy
ports:
- "6379:6379"
- "8265:8265"
- "10001:10001"
# https://docs.ray.io/en/releases-2.30.0/cluster/cli.html#ray-start for more info about the command
# Apparently dead head nodes can be selected unless
# RAY_JOB_ALLOW_DRIVER_ON_WORKER_NODES_ENV_VAR is set
# Dead head nodes appear because of the GCS data being
# persisted in Redis
command: bash -c "RAY_REDIS_ADDRESS=redis:6379 RAY_JOB_ALLOW_DRIVER_ON_WORKER_NODES_ENV_VAR=1 RAY_REDIS_ADDRESS=redis:6379 ray start --head --dashboard-port=8265 --port=6379 --dashboard-host=0.0.0.0 --ray-client-server-port 10001 --block" # pragma: allowlist secret
shm_size: 2g
volumes:
- ${HOME}/.cache/huggingface:/home/ray/.cache/huggingface
deploy:
resources:
limits:
cpus: '2'
memory: '5g'
environment:
# LOCAL_FSSPEC_S3 env vars required by s3fs running inside evaluator ray jobs
- LOCAL_FSSPEC_S3_ENDPOINT_URL=${AWS_ENDPOINT_URL} # Should match AWS_ENDPOINT_URL
- LOCAL_FSSPEC_S3_KEY=${AWS_ACCESS_KEY_ID} # Should match AWS_SECRET_ACCESS_KEY
- LOCAL_FSSPEC_S3_SECRET=${AWS_SECRET_ACCESS_KEY} # Should match AWS_SECRET_ACCESS_KEY
- MISTRAL_API_KEY
- OPENAI_API_KEY
- HF_TOKEN
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_DEFAULT_REGION
- AWS_ENDPOINT_URL
# NOTE: to keep AWS_ENDPOINT_URL as http://localhost:9000 both on the host system
# and inside containers, we map localhost to the host gateway IP.
# This currently works properly, but might be the cause of networking
# issues down the line. This should be used only for local, development
# deployments.
extra_hosts:
- "localhost:host-gateway"
profiles:
- local
backend:
image: mzdotai/lumigator:v0.1.0-alpha
pull_policy: always
build:
context: .
dockerfile: "Dockerfile"
target: "main_image"
depends_on:
minio-admin:
condition: service_completed_successfully
minio:
condition: "service_started"
required: false
ray:
condition: "service_started"
required: false
mlflow:
condition: "service_started"
required: false
ports:
- 8000:8000
environment:
- DEPLOYMENT_TYPE=local
# The local file needs to be available through a mount,
# if persistence is needed
- SQLALCHEMY_DATABASE_URL=sqlite:///local.db
- S3_ENDPOINT_URL=${AWS_ENDPOINT_URL}
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_DEFAULT_REGION
- AWS_ENDPOINT_URL
- S3_BUCKET
- EVALUATOR_PIP_REQS=/mzai/lumigator/jobs/evaluator/requirements.txt
- EVALUATOR_WORK_DIR=/mzai/lumigator/jobs/evaluator
# TODO: the following two rows should be renamed to EVALUATOR_*
# and the two above should be removed when we depreate evaluator
- EVALUATOR_LITE_PIP_REQS=/mzai/lumigator/jobs/evaluator_lite/requirements.txt
- EVALUATOR_LITE_WORK_DIR=/mzai/lumigator/jobs/evaluator_lite
- INFERENCE_PIP_REQS=/mzai/lumigator/jobs/inference/requirements.txt
- INFERENCE_WORK_DIR=/mzai/lumigator/jobs/inference
- RAY_DASHBOARD_PORT
- RAY_HEAD_NODE_HOST
- MISTRAL_API_KEY=$MISTRAL_API_KEY
- OPENAI_API_KEY=$OPENAI_API_KEY
- RAY_WORKER_GPUS=$RAY_WORKER_GPUS
- RAY_WORKER_GPUS_FRACTION=$RAY_WORKER_GPUS_FRACTION
- LUMI_API_CORS_ALLOWED_ORIGINS
- MLFLOW_TRACKING_URI
# NOTE: to keep AWS_ENDPOINT_URL as http://localhost:9000 both on the host system
# and inside containers, we map localhost to the host gateway IP.
# This currently works properly, but might be the cause of networking
# issues down the line. This should be used only for local, development
# deployments.
extra_hosts:
- "localhost:host-gateway"
frontend:
pull_policy: always
image: mzdotai/lumigator-frontend:v0.1.0-alpha
build:
context: .
dockerfile: "./lumigator/frontend/Dockerfile"
target: "server"
args:
VUE_APP_BASE_URL: http://localhost/api/v1/
environment:
LUMIGATOR_API_PORT: 8000
LUMIGATOR_API_HOST: backend
volumes:
- ./lumigator/frontend/nginx/:/etc/nginx/templates/
depends_on:
backend:
condition: "service_started"
required: true
ports:
- 80:80
mlflow:
image: ghcr.io/mlflow/mlflow:v2.0.1
environment:
- MLFLOW_TRACKING_URI=${MLFLOW_TRACKING_URI}
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
- AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION}
- BACKEND_STORE_URI=sqlite:///mlflow.db
- ARTIFACT_ROOT=s3://mlflow`
ports:
- "8001:5000"
depends_on:
minio:
condition: service_healthy
command: mlflow server --backend-store-uri ${BACKEND_STORE_URI} --default-artifact-root ${ARTIFACT_ROOT} --host 0.0.0.0
extra_hosts:
- "localhost:host-gateway"
profiles:
- local
volumes:
minio-data:
database_volume:
redis-data: