-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
145 lines (138 loc) · 4.22 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
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
version: '3.7'
services:
minio:
image: minio/minio:RELEASE.2020-12-18T03-27-42Z
container_name: myminio
volumes:
- artifact-store:/mlflow_bucket
ports:
- "9000:9000"
environment:
MINIO_ACCESS_KEY: minio-id
MINIO_SECRET_KEY: minio-key
networks:
- backend
command: server /mlflow_bucket
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 10s
timeout: 10s
start_period: 3s
retries: 3
create-bucket:
image: minio/mc:RELEASE.2019-07-17T22-13-42Z
depends_on:
- minio
networks:
- backend
environment:
MINIO_ACCESS_KEY: minio-id
MINIO_SECRET_KEY: minio-key
PORT: 9000
entrypoint: >
/bin/sh -c "
/usr/bin/mc config host rm local;
/usr/bin/mc config host add --quiet --api s3v4 local http://myminio:9000 minio-id minio-key;
/usr/bin/mc rb --force local/mlflow-bucket/;
/usr/bin/mc mb --quiet local/mlflow-bucket/;
/usr/bin/mc policy set public local/mlflow-bucket;
"
pgdb:
container_name: pgdb
restart: always
build: ./docker-db
image: pgdb
volumes:
- database:/var/lib/postgresql/data
ports:
- 5432:5432
expose:
- "5432"
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DATABASE: ${POSTGRES_DATABASE}
PGDATA: /var/lib/postgresql/data/pgdata
networks:
- backend
mlflow-server:
restart: always
build: ./docker-mlflow-server
image: mlflow-server
container_name: mlflow-server
ports:
- 5000:5000
expose:
- 5000
environment:
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_DATABASE: ${POSTGRES_DATABASE}
MLFLOW_S3_ENDPOINT_URL: http://minio:9000
AWS_ACCESS_KEY_ID: minio-id
AWS_SECRET_ACCESS_KEY: minio-key
depends_on:
- minio
- pgdb
networks:
- frontend
- backend
command: bash -c
"mlflow server --backend-store-uri postgresql+psycopg2://${POSTGRES_USER}:${POSTGRES_PASSWORD}@pgdb:5432/${POSTGRES_DATABASE} --host 0.0.0.0 --default-artifact-root s3://mlflow-bucket/"
# healthcheck:
# test: ["CMD", "curl", "--fail", "http://localhost:5000"]
# interval: 10s
# timeout: 10s
# start_period: 3s
# retries: 3
mlflow-code:
restart: always
build: .
image: mlflow-code
container_name: mlflow-code
ports:
- 5010:5010
- 5011:5011
- 5012:5012
- 5013:5013
- 5014:5014
- 5015:5015
- 5020:5020
- 5021:5021
- 5022:5022
- 5023:5023
- 5024:5024
- 5025:5025
- 5026:5026
- 5030:5030
- 5031:5031
- 5032:5032
- 5100:5100
environment:
MLFLOW_TRACKING_URI: http://mlflow-server:5000
MLFLOW_S3_ENDPOINT_URL: http://minio:9000
AWS_ACCESS_KEY_ID: 'minio-id'
AWS_SECRET_ACCESS_KEY: 'minio-key'
depends_on:
- minio
- create-bucket
- pgdb
- mlflow-server
working_dir: '/code/'
# volumes:
# - ./:/code/ # remoooooooooooooooooooove
networks:
- backend
- frontend
command: bash -c "sleep 5 && (python3 api/server.py & python3 shell_scripts/shell_script_composer.py && ./shell_scripts/init_models.sh )"
networks:
frontend:
name: frontend
driver: bridge
backend:
name: backend
driver: bridge
# volumes are initiated locally in /var/lib/docker/volumes
volumes:
database:
artifact-store: