-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.mapped-packages.yaml
More file actions
137 lines (129 loc) · 5.21 KB
/
docker-compose.mapped-packages.yaml
File metadata and controls
137 lines (129 loc) · 5.21 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
# 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.9'
x-aliases:
- &common_parameters
networks:
- airflow-cwl-docker
- &airflow_build_params
build:
context: .
dockerfile: Dockerfile
args:
AIRFLOW_CONDA_ENV: "${AIRFLOW_CONDA_ENV:-none}"
- &airflow_env
environment:
AIRFLOW_HOME: /opt/airflow
AIRFLOW__CORE__EXECUTOR: LocalExecutor
AIRFLOW__CORE__SQL_ALCHEMY_CONN: postgresql+psycopg2://${POSTGRE_USER:-airflow}:${POSTGRE_PASS:-airflow}@${POSTGRE_SERVER:-postgres}/${POSTGRE_DB:-airflow}
AIRFLOW__CORE__FERNET_KEY:
AIRFLOW_CONN_METADATA_DB: postgresql+psycopg2://${POSTGRE_USER:-airflow}:${POSTGRE_PASS:-airflow}@${POSTGRE_SERVER:-postgres}/${POSTGRE_DB:-airflow}
AIRFLOW_VAR__METADATA_DB_SCHEMA: ${POSTGRE_DB:-airflow}
AIRFLOW__SCHEDULER__SCHEDULER_HEARTBEAT_SEC: 10
AIRFLOW__CORE__DAGS_ARE_PAUSED_AT_CREATION: "True"
AIRFLOW__CORE__LOAD_EXAMPLES: ${AIRFLOW__CORE__LOAD_EXAMPLES:-False}
AIRFLOW__CORE__DAGS_FOLDER: ${DAGS_FOLDER:-/opt/airflow/dags}
_AIRFLOW_DB_UPGRADE: "True"
_AIRFLOW_WWW_USER_CREATE: "True"
AIRFLOW__WEBSERVER__ENABLE_PROXY_FIX: "True"
AIRFLOW__WEBSERVER__EXPOSE_CONFIG: ${AIRFLOW__WEBSERVER__EXPOSE_CONFIG:-True}
_AIRFLOW_WWW_USER_USERNAME: ${_AIRFLOW_WWW_USER_USERNAME:-airflow}
_AIRFLOW_WWW_USER_PASSWORD: ${_AIRFLOW_WWW_USER_PASSWORD:-airflow}
AIRFLOW__WEBSERVER__BASE_URL: ${BASE_URL:-http://localhost:8080}
AIRFLOW__LOGGING__BASE_LOG_FOLDER: "/opt/airflow/logs"
PROJECT_DIR: "/opt/airflow/project"
AIRFLOW_CONDA_ENV: "${AIRFLOW_CONDA_ENV:-none}"
- &airflow_volumes
volumes:
- ${PROJECT_DIR:-./project}:/opt/airflow/project
- ${DAGS_DIR:-./dags}:/opt/airflow/dags
- ${LOGS_DIR:-./airflow-logs}:/opt/airflow/logs
- ${CWL_TMP_FOLDER:-./cwl_tmp_folder}:/opt/airflow/cwl_tmp_folder
- ${CWL_INPUTS_FOLDER:-./cwl_inputs_folder}:/opt/airflow/cwl_inputs_folder
- ${CWL_OUTPUTS_FOLDER:-./cwl_outputs_folder}:/opt/airflow/cwl_outputs_folder
- ${CWL_PICKLE_FOLDER:-./cwl_pickle_folder}:/opt/airflow/cwl_pickle_folder
- ./cwl-airflow/cwl_airflow:/root/anaconda/envs/nsaph/lib/python3.8/site-packages/cwl_airflow
- ./project/census/src/python/census:/root/anaconda/envs/nsaph/lib/python3.8/site-packages/census
- ./project/epa/src/python/epa:/root/anaconda/envs/nsaph/lib/python3.8/site-packages/epa
- ./project/gridmet/src/python/gridmet:/root/anaconda/envs/nsaph/lib/python3.8/site-packages/gridmet
- ./project/data_platform/src/python/nsaph:/root/anaconda/envs/nsaph/lib/python3.8/site-packages/nsaph/
- ./project/gis/nsaph_gis:/root/anaconda/envs/nsaph/lib/python3.8/site-packages/nsaph_gis/
- ./project/nsaph_utils/nsaph_utils:/root/anaconda/envs/nsaph/lib/python3.8/site-packages/nsaph_utils
- type: bind
source: /var/run/docker.sock
target: /var/run/docker.sock
services:
scheduler:
image: "${AIRFLOW_IMAGE_NAME:-myairflow-conda}"
<<: *airflow_build_params
restart: always
user: root
container_name: scheduler
depends_on:
webserver:
condition: service_healthy
<<: *airflow_env
<<: *airflow_volumes
<<: *common_parameters
command: [ "airflow", "scheduler" ]
webserver:
image: "${AIRFLOW_IMAGE_NAME:-myairflow-conda}"
<<: *airflow_build_params
container_name: webserver
restart: always
user: root
<<: *airflow_env
<<: *airflow_volumes
<<: *common_parameters
ports:
- "8080:8080"
command: [ "airflow", "webserver" ]
healthcheck:
test: ["CMD", "curl", "--fail", "http://localhost:8080/health"]
interval: 30s
timeout: 4s
retries: 5
postgres:
image: postgres:13
container_name: postgres
volumes:
- postgres-db-volume:/var/lib/postgresql/data
environment:
POSTGRES_USER: ${POSTGRE_USER:-airflow}
POSTGRES_PASSWORD: ${POSTGRE_PASS:-airflow}
POSTGRES_DB: ${POSTGRE_DB:-airflow}
POSTGRES_HOST_AUTH_METHOD: trust
<<: *common_parameters
ports:
- "${POSTGRES_PORT:-5432}:5432"
profiles:
- postgres
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRE_USER} -d ${POSTGRE_DB}"]
interval: 3s
timeout: 5s
retries: 50
volumes:
postgres-db-volume:
networks:
airflow-cwl-docker:
driver: bridge
name: airflow
ipam:
config:
- subnet: 172.16.238.0/24