forked from puckel/docker-airflow
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from dataops-sre/adaptdockercompose
Adapt docker compose file and better documentations
- Loading branch information
Showing
6 changed files
with
75 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,14 +8,9 @@ | |
TRY_LOOP="20" | ||
|
||
# Global defaults and back-compat | ||
: "${AIRFLOW_HOME:="/usr/local/airflow"}" | ||
: "${AIRFLOW__CORE__FERNET_KEY:=${FERNET_KEY:=$(python -c "from cryptography.fernet import Fernet; FERNET_KEY = Fernet.generate_key().decode(); print(FERNET_KEY)")}}" | ||
: "${AIRFLOW__CORE__EXECUTOR:=${EXECUTOR:-Sequential}Executor}" | ||
|
||
# Load DAGs examples (default: Yes) | ||
if [[ -z "$AIRFLOW__CORE__LOAD_EXAMPLES" && "${LOAD_EX:=n}" == n ]]; then | ||
AIRFLOW__CORE__LOAD_EXAMPLES=False | ||
fi | ||
: "${AIRFLOW_HOME:="/opt/airflow"}" | ||
: "${AIRFLOW__CORE__FERNET_KEY:=$(python -c "from cryptography.fernet import Fernet; FERNET_KEY = Fernet.generate_key().decode(); print(FERNET_KEY)")}" | ||
: "${AIRFLOW__CORE__EXECUTOR:="SequentialExecutor"}" | ||
|
||
export \ | ||
AIRFLOW_HOME \ | ||
|
@@ -110,27 +105,13 @@ fi | |
case "$1" in | ||
webserver) | ||
airflow db init | ||
airflow users create --username airflow --password airflow --firstname Peter --lastname Parker --role Admin --email [email protected] | ||
if [ "$AIRFLOW__CORE__EXECUTOR" = "LocalExecutor" ] || [ "$AIRFLOW__CORE__EXECUTOR" = "SequentialExecutor" ]; then | ||
# With the "Local" and "Sequential" executors it should all run in one container. | ||
airflow scheduler & | ||
fi | ||
exec airflow webserver | ||
;; | ||
worker|scheduler) | ||
# Give the webserver time to run db init. | ||
sleep 10 | ||
exec airflow "$@" | ||
;; | ||
flower) | ||
sleep 10 | ||
exec airflow "$@" | ||
;; | ||
version) | ||
exec airflow "$@" | ||
;; | ||
*) | ||
# The command is something like bash, not an airflow subcommand. Just run it in the right environment. | ||
exec "$@" | ||
;; | ||
esac |