-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.override.yml
More file actions
138 lines (130 loc) · 3.68 KB
/
Copy pathdocker-compose.override.yml
File metadata and controls
138 lines (130 loc) · 3.68 KB
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
# This file extends the Astro docker-compose setup with additional services
# It will be automatically loaded by docker-compose when running astro dev start
services:
# MLflow tracking server
mlflow:
image: python:3.11-slim
platform: linux/arm64
command: >
bash -c "pip install mlflow==2.9.2 psycopg2-binary boto3 &&
export MLFLOW_S3_ENDPOINT_URL=http://minio:9000 &&
mlflow server --host 0.0.0.0 --port 5001
--backend-store-uri postgresql://mlflow:mlflow@mlflow-db:5432/mlflow
--default-artifact-root s3://mlflow-artifacts/
--serve-artifacts"
ports:
- '5001:5001'
environment:
- AWS_ACCESS_KEY_ID=minioadmin
- AWS_SECRET_ACCESS_KEY=minioadmin
- MLFLOW_S3_ENDPOINT_URL=http://minio:9000
- AWS_DEFAULT_REGION=us-east-1
depends_on:
- mlflow-db
- minio
networks:
- airflow
- default
restart: unless-stopped
# PostgreSQL for MLflow
mlflow-db:
image: postgres:16-alpine
platform: linux/arm64
environment:
POSTGRES_USER: mlflow
POSTGRES_PASSWORD: mlflow
POSTGRES_DB: mlflow
volumes:
- mlflow-db-volume:/var/lib/postgresql/data
healthcheck:
test: ['CMD', 'pg_isready', '-U', 'mlflow']
interval: 5s
retries: 5
networks:
- airflow
- default
restart: unless-stopped
# MinIO for S3-compatible storage
minio:
image: minio/minio:latest
platform: linux/arm64
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
ports:
- '9000:9000'
- '9001:9001'
volumes:
- minio-data:/data
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:9000/minio/health/live']
interval: 30s
timeout: 20s
retries: 3
networks:
- airflow
- default
restart: unless-stopped
# Create MLflow bucket in MinIO
minio-mc:
image: minio/mc:latest
platform: linux/arm64
depends_on:
- minio
entrypoint: >
/bin/sh -c "
sleep 10;
mc alias set myminio http://minio:9000 minioadmin minioadmin;
mc mb myminio/mlflow-artifacts || true;
mc anonymous set public myminio/mlflow-artifacts;
exit 0;
"
# Add Redis to the Airflow network for Celery if needed
redis:
image: redis:7-alpine
platform: linux/arm64
expose:
- 6379
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
interval: 5s
timeout: 30s
retries: 50
restart: unless-stopped
# Streamlit UI for model inference
streamlit-ui:
image: python:3.11-slim
platform: linux/arm64
working_dir: /app
command: >
bash -c "
apt-get update && apt-get install -y libgomp1 build-essential cmake &&
pip install --no-cache-dir streamlit==1.29.0 pandas==2.1.4 numpy==1.24.3 scikit-learn==1.3.2 matplotlib==3.8.2 seaborn==0.13.0 plotly==5.18.0 mlflow==2.9.2 boto3==1.34.14 lightgbm==4.2.0 catboost==1.2.2 xgboost==2.0.3 &&
chmod +x /app/entrypoint.sh &&
/app/entrypoint.sh
"
ports:
- '8501:8501'
environment:
- MLFLOW_TRACKING_URI=http://mlflow:5001
- MLFLOW_S3_ENDPOINT_URL=http://minio:9000
- AWS_ACCESS_KEY_ID=minioadmin
- AWS_SECRET_ACCESS_KEY=minioadmin
- AWS_DEFAULT_REGION=us-east-1
volumes:
- ./ui:/app
- ./include:/usr/local/airflow/include:ro
depends_on:
- mlflow
- minio
restart: unless-stopped
volumes:
mlflow-db-volume:
minio-data:
networks:
airflow:
external: true
name: astro-sales-forecast_eaa509_airflow
default:
name: astro-sales-forecast_eaa509_default