-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathdocker-compose.yaml
157 lines (148 loc) · 5.11 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
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
ray:
image: rayproject/ray:2.30.0-py311-cpu${RAY_ARCH_SUFFIX}
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
command: bash -c "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
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:latest
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
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
- PYTHONPATH=/mzai/lumigator/python/mzai/backend
- EVALUATOR_PIP_REQS=/mzai/lumigator/python/mzai/jobs/evaluator/requirements.txt
- EVALUATOR_WORK_DIR=/mzai/lumigator/python/mzai/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/python/mzai/jobs/evaluator_lite/requirements.txt
- EVALUATOR_LITE_WORK_DIR=/mzai/lumigator/python/mzai/jobs/evaluator_lite
- INFERENCE_PIP_REQS=/mzai/lumigator/python/mzai/jobs/inference/requirements.txt
- INFERENCE_WORK_DIR=/mzai/lumigator/python/mzai/jobs/inference
- RAY_DASHBOARD_PORT
- RAY_HEAD_NODE_HOST
- MISTRAL_API_KEY=$MISTRAL_API_KEY
- OPENAI_API_KEY=$OPENAI_API_KEY
- RAY_WORKER_GPUS=0
- RAY_WORKER_GPUS_FRACTION=0
- LUMI_API_CORS_ALLOWED_ORIGINS
# 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:
image: mzdotai/lumigator-frontend:latest
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
volumes:
minio-data:
database_volume: