forked from flink-extended/ai-flow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
116 lines (110 loc) · 3.07 KB
/
docker-compose.yaml
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
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
---
version: '3'
x-airflow-common:
&airflow-common
image: flinkaiflow/flink-ai-flow:0.2.0
# build: .
environment:
&airflow-common-env
AIRFLOW_HOME: /usr/local/airflow
MYSQL_CONN: mysql://root@mysql/airflow?charset=utf8mb4
BROKER_URL: redis://:@redis:6379/0
RESULT_BACKEND: redis://:@redis:6379/0
depends_on:
redis:
condition: service_healthy
services:
redis:
image: redis:latest
ports:
- 6379:6379
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 30s
retries: 50
restart: always
aiflow-server:
<<: *airflow-common
stdin_open: true
tty: true
entrypoint: /bin/bash
cap_add:
- SYS_PTRACE
ports:
- "8080:8080"
- "50051:50051"
restart: always
depends_on:
airflow-worker:
condition: service_healthy
mysql:
condition: service_healthy
mysql:
image: mysql:8
environment:
- MYSQL_ALLOW_EMPTY_PASSWORD=true
- MYSQL_ROOT_HOST=%
- MYSQL_DATABASE=airflow
volumes:
- ../mysql/conf.d:/etc/mysql/conf.d:ro
- /dev/urandom:/dev/random
- mysql-db-volume:/var/lib/mysql
ports:
- 3307:3306
command: ['mysqld', '--character-set-server=utf8mb4',
'--collation-server=utf8mb4_unicode_ci']
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
interval: 10s
timeout: 10s
retries: 5
restart: always
airflow-worker:
<<: *airflow-common
command: /bin/bash -c "
init-airflow-with-celery-executor.sh $${MYSQL_CONN} $${BROKER_URL} $${RESULT_BACKEND}
&& airflow celery worker"
ports:
- 8793
scale: 3
healthcheck:
test:
- "CMD-SHELL"
- 'celery --app airflow.executors.celery_executor.app inspect ping -d "celery@$${HOSTNAME}"'
interval: 10s
timeout: 10s
retries: 5
restart: always
flower:
<<: *airflow-common
command: /bin/bash -c "
init-airflow-with-celery-executor.sh $${MYSQL_CONN} $${BROKER_URL} $${RESULT_BACKEND}
&& airflow celery flower"
ports:
- 5555:5555
healthcheck:
test: ["CMD", "curl", "--fail", "http://localhost:5555/"]
interval: 10s
timeout: 10s
retries: 5
restart: always
volumes:
mysql-db-volume: