From 05a04a079db29600e6fe382e3e2ab4bd50f34766 Mon Sep 17 00:00:00 2001 From: Piotr Jasiulewicz Date: Mon, 3 Feb 2020 11:09:28 +0100 Subject: [PATCH 1/2] Set unique celery worker names. --- script/entrypoint.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/script/entrypoint.sh b/script/entrypoint.sh index 06532713..5679d699 100755 --- a/script/entrypoint.sh +++ b/script/entrypoint.sh @@ -78,8 +78,14 @@ case "$1" in fi exec airflow webserver ;; - worker|scheduler) - # Give the webserver time to run initdb. + worker) + # To give the webserver time to run initdb. + sleep 10 + # Each celery worker needs a unique name otherwise only one will work. Adds microseconds as prefix. + exec airflow "$@" -cn "worker-$(($(date +%s%N)/1000000))" + ;; + scheduler) + # To give the webserver time to run initdb. sleep 10 exec airflow "$@" ;; From 7305ed033f54b37d0fe5208fc0672c3c1353fa2b Mon Sep 17 00:00:00 2001 From: Piotr Jasiulewicz Date: Mon, 3 Feb 2020 11:43:47 +0100 Subject: [PATCH 2/2] Fix typo. --- script/entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/entrypoint.sh b/script/entrypoint.sh index 5679d699..1a152845 100755 --- a/script/entrypoint.sh +++ b/script/entrypoint.sh @@ -81,7 +81,7 @@ case "$1" in worker) # To give the webserver time to run initdb. sleep 10 - # Each celery worker needs a unique name otherwise only one will work. Adds microseconds as prefix. + # Each celery worker needs a unique name otherwise only one will work. Adds microseconds as postfix. exec airflow "$@" -cn "worker-$(($(date +%s%N)/1000000))" ;; scheduler)