This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 05c870abd1 Allow increasing delay in breeze start-airflow (#32938)
05c870abd1 is described below

commit 05c870abd1b2a5246aedcbe8e5572ce893455d7c
Author: Aritra Basu <[email protected]>
AuthorDate: Sun Jul 30 03:49:27 2023 +0530

    Allow increasing delay in breeze start-airflow (#32938)
    
    * Allow increasing delay in breeze start-airflow
    
    When running breeze start-airflow there is a 60
    second duration where breeze tries to compile assets
    in certain cases it can take longer than this (upto 2-3x)
    to complete the compilation.
    
    The commit adds a env variable ASSET_COMPILATION_WAIT_MULTIPLIER
    to allow extending the timeout without having to go into the
    script and manually changing the number.
---
 BREEZE.rst                      | 7 +++++++
 Dockerfile.ci                   | 7 +++++--
 scripts/docker/entrypoint_ci.sh | 7 +++++--
 3 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/BREEZE.rst b/BREEZE.rst
index 367146259f..f060b84ee2 100644
--- a/BREEZE.rst
+++ b/BREEZE.rst
@@ -834,6 +834,13 @@ When running ``breeze start-airflow``, the following 
output might be observed:
 
     Error 1 returned
 
+This timeout can be increased by setting ``ASSET_COMPILATION_WAIT_MULTIPLIER`` 
a reasonable number
+could be 3-4.
+
+.. code-block:: bash
+
+  export ASSET_COMPILATION_WAIT_MULTIPLIER=3
+
 This error is actually caused by the following error during the asset 
compilation which resulted in
 ETIMEOUT when ``npm`` command is trying to install required packages:
 
diff --git a/Dockerfile.ci b/Dockerfile.ci
index 9a0e300901..6c3e4b79de 100644
--- a/Dockerfile.ci
+++ b/Dockerfile.ci
@@ -659,6 +659,8 @@ export AIRFLOW_HOME=${AIRFLOW_HOME:=${HOME}}
 
 : "${AIRFLOW_SOURCES:?"ERROR: AIRFLOW_SOURCES not set !!!!"}"
 
+ASSET_COMPILATION_WAIT_MULTIPLIER=${ASSET_COMPILATION_WAIT_MULTIPLIER:=1}
+
 function wait_for_asset_compilation() {
     if [[ -f "${AIRFLOW_SOURCES}/.build/www/.asset_compile.lock" ]]; then
         echo
@@ -671,7 +673,7 @@ function wait_for_asset_compilation() {
             fi
             sleep 1
             ((counter=counter+1))
-            if [[ ${counter} == "30" ]]; then
+            if [[ ${counter} == 30*$ASSET_COMPILATION_WAIT_MULTIPLIER ]]; then
                 echo
                 echo "${COLOR_YELLOW}The asset compilation is taking too 
long.${COLOR_YELLOW}"
                 echo """
@@ -680,9 +682,10 @@ If it does not complete soon, you might want to stop it 
and remove file lock:
    * run 'rm ${AIRFLOW_SOURCES}/.build/www/.asset_compile.lock'
 """
             fi
-            if [[ ${counter} == "60" ]]; then
+            if [[ ${counter} == 60*$ASSET_COMPILATION_WAIT_MULTIPLIER ]]; then
                 echo
                 echo "${COLOR_RED}The asset compilation is taking too long. 
Exiting.${COLOR_RED}"
+                echo "${COLOR_RED}refer to BREEZE.rst for resolution 
steps.${COLOR_RED}"
                 echo
                 exit 1
             fi
diff --git a/scripts/docker/entrypoint_ci.sh b/scripts/docker/entrypoint_ci.sh
index 237c97a300..e4cf2b989c 100755
--- a/scripts/docker/entrypoint_ci.sh
+++ b/scripts/docker/entrypoint_ci.sh
@@ -46,6 +46,8 @@ export AIRFLOW_HOME=${AIRFLOW_HOME:=${HOME}}
 
 : "${AIRFLOW_SOURCES:?"ERROR: AIRFLOW_SOURCES not set !!!!"}"
 
+ASSET_COMPILATION_WAIT_MULTIPLIER=${ASSET_COMPILATION_WAIT_MULTIPLIER:=1}
+
 function wait_for_asset_compilation() {
     if [[ -f "${AIRFLOW_SOURCES}/.build/www/.asset_compile.lock" ]]; then
         echo
@@ -58,7 +60,7 @@ function wait_for_asset_compilation() {
             fi
             sleep 1
             ((counter=counter+1))
-            if [[ ${counter} == "30" ]]; then
+            if [[ ${counter} == 30*$ASSET_COMPILATION_WAIT_MULTIPLIER ]]; then
                 echo
                 echo "${COLOR_YELLOW}The asset compilation is taking too 
long.${COLOR_YELLOW}"
                 echo """
@@ -67,9 +69,10 @@ If it does not complete soon, you might want to stop it and 
remove file lock:
    * run 'rm ${AIRFLOW_SOURCES}/.build/www/.asset_compile.lock'
 """
             fi
-            if [[ ${counter} == "60" ]]; then
+            if [[ ${counter} == 60*$ASSET_COMPILATION_WAIT_MULTIPLIER ]]; then
                 echo
                 echo "${COLOR_RED}The asset compilation is taking too long. 
Exiting.${COLOR_RED}"
+                echo "${COLOR_RED}refer to BREEZE.rst for resolution 
steps.${COLOR_RED}"
                 echo
                 exit 1
             fi

Reply via email to