Skip to content

Commit 1621939

Browse files
committed
dockerfile & compose: add triggerer and startup
1 parent d8f5d35 commit 1621939

2 files changed

Lines changed: 42 additions & 1 deletion

File tree

containers/airflow/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,4 @@ RUN sudo mkdir -p /opt/scripts /sources /opt/airflow \
110110
&& sudo touch /var/log/colombia_fetch.log \
111111
&& sudo chown -R airflow /var/log/*
112112

113-
ENTRYPOINT [ "/opt/entrypoint.sh" ]
113+
ENTRYPOINT [ "/entrypoint.sh" ]

containers/compose-base.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,47 @@ services:
208208
startup:
209209
condition: service_completed_successfully
210210

211+
airflow_triggerer:
212+
<<: *airflow-common
213+
command: triggerer
214+
image: eph_airflow
215+
hostname: triggerer
216+
container_name: eph_airflow_triggerer
217+
healthcheck:
218+
test: ["CMD-SHELL", 'airflow jobs check --job-type TriggererJob --hostname "$${HOSTNAME}"']
219+
interval: 30s
220+
timeout: 10s
221+
retries: 5
222+
start_period: 30s
223+
restart: always
224+
depends_on:
225+
<<: *airflow-common-depends-on
226+
startup:
227+
condition: service_completed_successfully
228+
229+
airflow_startup:
230+
<<: *airflow-common
231+
entrypoint: /bin/bash
232+
image: eph_airflow
233+
container_name: eph_airflow_startup
234+
# yamllint disable rule:line-length
235+
command:
236+
- -c
237+
- |
238+
mkdir -p /sources/logs /sources/dags /sources/plugins
239+
chown -R "${AIRFLOW_UID}:0" /sources/{logs,dags,plugins}
240+
exec /entrypoint airflow version
241+
# yamllint enable rule:line-length
242+
environment:
243+
<<: *airflow-common-env
244+
_AIRFLOW_DB_UPGRADE: 'true'
245+
_AIRFLOW_WWW_USER_CREATE: 'true'
246+
_AIRFLOW_WWW_USER_USERNAME: ${_AIRFLOW_WWW_USER_USERNAME}
247+
_AIRFLOW_WWW_USER_PASSWORD: ${_AIRFLOW_WWW_USER_PASSWORD}
248+
user: "0:0"
249+
volumes:
250+
- ${AIRFLOW_FILES_PATH_DIR_HOST}:/sources
251+
211252
volumes:
212253
redis:
213254
minio:

0 commit comments

Comments
 (0)