-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
executable file
·106 lines (95 loc) · 2.62 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
version: "3.6"
services:
postgres:
image: "postgres:13"
container_name: "postgres"
environment:
- POSTGRES_USER=airflow
- POSTGRES_PASSWORD=airflow
- POSTGRES_DB=airflow
expose:
- 5432
volumes:
- ../../untracked/pipeline_logs/postgresql:/var/lib/postgresql/data:rw
user: "${UID}:${GID}" # This requires the enviroment variables (at host): export UID=$(id -u) and export GID=$(id -g)
initdb:
build: .
entrypoint: airflow db init
depends_on:
- postgres
volumes:
- ../../untracked/pipeline_logs/airflow_logs:/home/datawhale/airflow/logs:rw
env_file:
- airflow.env
create_user:
build: .
entrypoint: airflow users create -r Admin -u airflow -f datawhale -l datawhale -p airflow -e [email protected]
depends_on:
- postgres
- initdb
env_file:
- airflow.env
webserver:
build: .
restart: always
entrypoint: airflow webserver
healthcheck:
test: ["CMD-SHELL", "[ -f /home/datawhale/airflow/airflow-webserver.pid ]"]
interval: 30s
timeout: 30s
retries: 3
ports:
- "8080:8080"
depends_on:
- postgres
volumes:
- ../../untracked/pipeline_logs/airflow_logs:/home/datawhale/airflow/logs:rw
env_file:
- airflow.env
scheduler:
build: .
restart: always
entrypoint: airflow scheduler
healthcheck:
test: ["CMD-SHELL", "[ -f /home/datawhale/airflow/airflow-scheduler.pid ]"]
interval: 30s
timeout: 30s
retries: 3
depends_on:
- postgres
volumes:
- ../../untracked/pipeline_logs/airflow_logs:/home/datawhale/airflow/logs:rw
env_file:
- airflow.env
redis:
image: redis:latest
expose:
- 6379
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 30s
retries: 50
restart: always
volumes:
- ../../untracked/pipeline_logs/airflow_logs:/home/datawhale/airflow/logs:rw
worker:
build: .
command: airflow celery worker
restart: always
env_file:
- airflow.env
depends_on:
- redis
volumes:
- ../../untracked/pipeline_logs/airflow_logs:/home/datawhale/airflow/logs:rw
- ../../untracked/Datasets:/home/datawhale/datasets:rw
- ../../untracked/pipeline_data:/home/datawhale/pipeline_data:rw
- ../../untracked/tf_serving_models:/home/datawhale/output:rw
deploy:
resources:
reservations:
devices:
- driver: nvidia
device_ids: ['0']
capabilities: [gpu, compute, utility]