-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose.yml
108 lines (101 loc) · 2.6 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
# Example docker-compose configuration for deploying a local MLOps stack to a single server
# ML infrastructure resources like airflow and mlflow server can be reused for any amount of ml experiments
# This example also consists using a ml playground docker container with some custom deep learning python package
# along with the whole MLOps stack. ie. You can do ETL loads, data validation, ML training, versioning, tracking etc.
version: '3'
services:
# test airflow service with SQLite backend to make it MVP (not for production)
airflow:
build:
context: .
dockerfile: ./docker/Dockerfile.airflow
container_name: airflow
ports:
- 8080:8080
depends_on:
- mlflow
volumes:
- airflowdata:/tmp/airflow/artifacts/
- ./mlflows:/mlflow/artifacts
- ./dags:/opt/airflow/dags
networks:
- frontend
- backend
env_file:
- ./env_files/compose.env
- ./env_files/secrets.env
command: standalone
# mlfow server with postgresql db backend
mlflow:
build:
context: .
dockerfile: ./docker/Dockerfile.mlflow
container_name: mlflow
ports:
- 5000:5000
volumes:
- ./mlflows:/mlflow/artifacts
- ./:/workspace/
depends_on:
postgresql:
condition: service_healthy
networks:
- frontend
- backend
env_file:
- ./env_files/compose.env
- ./env_files/secrets.env
command: /tmp/start_mlflow.sh
# db backend for mlflow
postgresql:
image: postgres:10.5
container_name: postgresql
expose:
- "5432"
env_file:
- ./env_files/compose.env
- ./env_files/secrets.env
hostname: postgresql
shm_size: 256mb
volumes:
- ./dbs:/var/lib/postgresql/data
networks:
- backend
restart: always
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
# running ml experiments with single GPU device support
# you need to have nvidia-docker installed on host system
playground-gpu:
build:
context: .
dockerfile: ./docker/Dockerfile.playground
container_name: playground
depends_on:
- mlflow
volumes:
- ./scripts:/workspace/
networks:
- frontend
- backend
env_file:
- ./env_files/compose.env
entrypoint: []
shm_size: 6gb
deploy:
resources:
reservations:
devices:
- driver: nvidia
device_ids: ['0']
capabilities: [ gpu ]
networks:
frontend:
driver: bridge
backend:
driver: bridge
volumes:
airflowdata: