-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompose.yml
164 lines (154 loc) · 4.9 KB
/
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
services:
# Somehow the service key here needs to be `minio` to be compatible with mlflow_server boto call...
minio:
restart: always
image: minio/minio@sha256:2c8ac2a6255a2fa7b73a0a3647314c07121432b8ca1ce4ed8bfe31ca8495d7f7
container_name: mlflow_s3
ports:
- "9000:9000"
- "9001:9001"
command: server /data --console-address ':9001' --address ':9000'
environment:
- MINIO_ROOT_USER=${AWS_ACCESS_KEY_ID}
- MINIO_ROOT_PASSWORD=${AWS_SECRET_ACCESS_KEY}
volumes:
- ./data/mlflow/minio_data:/data
mlflow_mc:
image: minio/mc@sha256:3adae97df95c66b301b25ca7b38a9d7cfbd93b8f0652687331d552cd046dbfc1
depends_on:
- minio
container_name: mlflow_mc
env_file:
- .env
entrypoint: >
/bin/sh -c "
/tmp/wait-for-it.sh minio:9000 &&
/usr/bin/mc alias set minio http://minio:9000 ${AWS_ACCESS_KEY_ID} ${AWS_SECRET_ACCESS_KEY} &&
/usr/bin/mc mb minio/mlflow &&
/usr/bin/mc mb minio/data &&
/usr/bin/mc mb minio/runs;
exit 0;
"
volumes:
- ./mlflow/wait-for-it.sh:/tmp/wait-for-it.sh
mlflow_db:
restart: always
image: mysql/mysql-server@sha256:5b40d96b11333570143d98d3a74100fefadb9abb17b27a95dbc9ad33544ec142
container_name: mlflow_db
ports:
- "3306:3306"
environment:
- MYSQL_DATABASE=${MYSQL_DATABASE}
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
volumes:
- ./data/mlflow/dbdata:/var/lib/mysql
mlflow_server:
restart: always
# Need to build MLflow because the official Docker image does not come with pymysql installed
build: ./mlflow
image: mlflow_server
container_name: mlflow_server
depends_on:
- mlflow_mc
- mlflow_db
ports:
- "5002:5000"
environment:
# Somehow the MLFLOW_S3_ENDPOINT_URL must be minio instead of a custom name like mlflow_s3 for the service because if the endpoint is not `minio` then boto3 would raise error
- MLFLOW_S3_ENDPOINT_URL=http://minio:9000
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
command: >
mlflow server
--backend-store-uri mysql+pymysql://${MYSQL_USER}:${MYSQL_PASSWORD}@mlflow_db:3306/${MYSQL_DATABASE}
--artifacts-destination s3://mlflow
--serve-artifacts
--host 0.0.0.0
--port 5000
kv_store:
# Redis is limited to 7.2-bookworm due to licencing change
# https://redis.io/blog/redis-adopts-dual-source-available-licensing/
image: redis:7.2-bookworm
container_name: kv_store
ports:
- "${REDIS_PORT}:6379"
volumes:
- ./data/redis:/data
env_file:
- .env
healthcheck:
test: ["CMD", "redis-cli", "-p", "6379", "ping"]
interval: 10s
timeout: 30s
retries: 50
start_period: 30s
qdrant:
image: qdrant/qdrant:v1.12.0
ports:
- "6333:6333"
- "6334:6334"
volumes:
- ./data/qdrant_storage:/qdrant/storage:z
restart: always
dwh:
container_name: dwh
image: postgres
env_file:
- .env
environment:
PGDATA: /data/postgres
volumes:
- ./data/postgres:/data/postgres
# Run scripts to create schemas upon startup
- ./init-db:/docker-entrypoint-initdb.d
ports:
- "5432:5432"
healthcheck:
test: ["CMD", "pg_isready", "-U", "airflow", "-p", "5432"]
interval: 10s
retries: 5
start_period: 5s
feature_online_server:
container_name: feature_online_server
build:
context: .
dockerfile: feature_pipeline.Dockerfile
env_file:
- .env
environment:
- POSTGRES_HOST=dwh
ports:
- "${FEAST_ONLINE_SERVER_PORT:-8815}:${FEAST_ONLINE_SERVER_PORT:-6566}"
working_dir: /app/feature_pipeline/feature_store/feature_repo
entrypoint: ["uv", "run", "feast", "serve", "--port", "${FEAST_ONLINE_SERVER_PORT:-6566}", "--host", "0.0.0.0"]
feature_offline_server:
container_name: feature_offline_server
build:
context: .
dockerfile: feature_pipeline.Dockerfile
env_file:
- .env
environment:
- POSTGRES_HOST=dwh
ports:
- "${FEAST_OFFLINE_SERVER_PORT:-8815}:${FEAST_OFFLINE_SERVER_PORT:-8815}"
working_dir: /app/feature_pipeline/feature_store/feature_repo
entrypoint: ["uv", "run", "feast", "serve_offline", "--port", "${FEAST_OFFLINE_SERVER_PORT:-8815}", "--host", "0.0.0.0"]
feature_store_ui:
container_name: feature_store_ui
build:
context: .
dockerfile: feature_pipeline.Dockerfile
env_file:
- .env
environment:
- POSTGRES_HOST=dwh
ports:
- "${FEAST_UI_PORT:-8887}:${FEAST_UI_PORT:-8887}"
working_dir: /app/feature_pipeline/feature_store/feature_repo
entrypoint: ["uv", "run", "feast", "ui", "--port", "${FEAST_UI_PORT:-8887}", "--host", "0.0.0.0"]
networks:
recsys-mvp:
driver: bridge