-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Dockerfile with starting scripts
- Loading branch information
1 parent
fa850e1
commit ee1d455
Showing
5 changed files
with
68 additions
and
3 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
16 changes: 16 additions & 0 deletions
16
packaging/docker_compose/local_executor/cwl_airflow/scripts/start_apiserver.sh
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
|
||
echo "Set parameters from the environment variables or apply defaults" | ||
: "${MYSQL_USER:=airflow}" | ||
: "${MYSQL_PASSWORD:=airflow}" | ||
: "${MYSQL_DATABASE:=airflow}" | ||
|
||
echo "Wait until required database and tables are ready" | ||
until mysql -h mysql -u ${MYSQL_USER} -p${MYSQL_PASSWORD} -e "select * from ${MYSQL_DATABASE}.dag_run" | ||
do | ||
echo "Sleep 1 sec" | ||
sleep 1; | ||
done | ||
|
||
echo "Start cwl-airflow api" | ||
cwl-airflow api "$@" |
19 changes: 19 additions & 0 deletions
19
packaging/docker_compose/local_executor/cwl_airflow/scripts/start_scheduler.sh
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
echo "Set parameters from the environment variables or apply defaults" | ||
: "${MYSQL_USER:=airflow}" | ||
: "${MYSQL_PASSWORD:=airflow}" | ||
: "${MYSQL_DATABASE:=airflow}" | ||
|
||
echo "Wait until required database is ready" | ||
until mysql -h mysql -u ${MYSQL_USER} -p${MYSQL_PASSWORD} -e "USE ${MYSQL_DATABASE}" | ||
do | ||
echo "Sleep 1 sec" | ||
sleep 1; | ||
done | ||
|
||
echo "Run initial configuration for CWL-Airflow" | ||
cwl-airflow init --upgrade | ||
|
||
echo "Start airflow scheduler" | ||
airflow scheduler "$@" |
27 changes: 27 additions & 0 deletions
27
packaging/docker_compose/local_executor/cwl_airflow/scripts/start_webserver.sh
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
|
||
echo "Set parameters from the environment variables or apply defaults" | ||
: "${AIRFLOW_HOME:=airflow}" | ||
: "${MYSQL_USER:=airflow}" | ||
: "${MYSQL_PASSWORD:=airflow}" | ||
: "${MYSQL_DATABASE:=airflow}" | ||
|
||
echo "Wait until required database and tables are ready" | ||
until mysql -h mysql -u ${MYSQL_USER} -p${MYSQL_PASSWORD} -e "select * from ${MYSQL_DATABASE}.dag_run" | ||
do | ||
echo "Sleep 1 sec" | ||
sleep 1; | ||
done | ||
|
||
echo "Wait until required files are ready" | ||
until [ -e ${AIRFLOW_HOME}/webserver_config.py ] | ||
do | ||
echo "Sleep 1 sec" | ||
sleep 1; | ||
done | ||
|
||
echo "Disable authentication in Airflow UI" | ||
sed -i'.backup' -e 's/^# AUTH_ROLE_PUBLIC.*/AUTH_ROLE_PUBLIC = "Admin"/g' ${AIRFLOW_HOME}/webserver_config.py | ||
|
||
echo "Start airflow webserver" | ||
airflow webserver "$@" |
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