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

potiuk pushed a commit to branch v2-11-test
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/v2-11-test by this push:
     new f9ab7d0b8dc [v2-11-test] Fallback to no constraint builds for 
docker-context-files installation (#63051) (#63059)
f9ab7d0b8dc is described below

commit f9ab7d0b8dcd60c5735fa24e63672ffa4d62af9c
Author: Jarek Potiuk <[email protected]>
AuthorDate: Sat Mar 7 21:26:44 2026 +0100

    [v2-11-test] Fallback to no constraint builds for docker-context-files 
installation (#63051) (#63059)
    
    When building PROD from docker-context-files - i.e. when we run main
    build with providers built from sources, we should fall back to
    no constraints build when there is a conflict with constraints.
    
    This is a follow up after #62378
    (cherry picked from commit fef2e62d6b730a31f5050295d9d1193d63e92fe7)
---
 Dockerfile                                         | 23 +++++++++++++++++++---
 .../docker/install_from_docker_context_files.sh    | 23 +++++++++++++++++++---
 2 files changed, 40 insertions(+), 6 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index 1c865dafea3..d0c95d4aa80 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -711,11 +711,28 @@ function 
install_airflow_and_providers_from_docker_context_files(){
         echo "${COLOR_BLUE}Installing docker-context-files packages without 
constraints${COLOR_RESET}"
         echo
         set -x
-        ${PACKAGING_TOOL_CMD} install ${EXTRA_INSTALL_FLAGS} \
+        if ! ${PACKAGING_TOOL_CMD} install ${EXTRA_INSTALL_FLAGS} \
             ${ADDITIONAL_PIP_INSTALL_FLAGS} \
-            "${install_airflow_package[@]}" 
"${installing_providers_packages[@]}"
-        set +x
+            "${install_airflow_package[@]}" 
"${installing_providers_packages[@]}"; then
+            set +x
+            if [[ ${AIRFLOW_FALLBACK_NO_CONSTRAINTS_INSTALLATION} != "true" 
]]; then
+                echo
+                echo "${COLOR_RED}Failing because constraints installation 
failed and fallback is disabled.${COLOR_RESET}"
+                echo
+                exit 1
+            fi
+            echo
+            echo "${COLOR_YELLOW}Likely there are new dependencies conflicting 
with constraints.${COLOR_RESET}"
+            echo
+            echo "${COLOR_BLUE}Falling back to no-constraints 
installation.${COLOR_RESET}"
+            echo
+            set -x
+            ${PACKAGING_TOOL_CMD} install ${EXTRA_INSTALL_FLAGS} \
+                    ${ADDITIONAL_PIP_INSTALL_FLAGS} \
+                    "${install_airflow_package[@]}" 
"${installing_providers_packages[@]}"
+        fi
     fi
+    set +x
     common::install_packaging_tools
     pip check
 }
diff --git a/scripts/docker/install_from_docker_context_files.sh 
b/scripts/docker/install_from_docker_context_files.sh
index edcb50c82e0..5e416b30763 100644
--- a/scripts/docker/install_from_docker_context_files.sh
+++ b/scripts/docker/install_from_docker_context_files.sh
@@ -106,11 +106,28 @@ function 
install_airflow_and_providers_from_docker_context_files(){
         echo "${COLOR_BLUE}Installing docker-context-files packages without 
constraints${COLOR_RESET}"
         echo
         set -x
-        ${PACKAGING_TOOL_CMD} install ${EXTRA_INSTALL_FLAGS} \
+        if ! ${PACKAGING_TOOL_CMD} install ${EXTRA_INSTALL_FLAGS} \
             ${ADDITIONAL_PIP_INSTALL_FLAGS} \
-            "${install_airflow_package[@]}" 
"${installing_providers_packages[@]}"
-        set +x
+            "${install_airflow_package[@]}" 
"${installing_providers_packages[@]}"; then
+            set +x
+            if [[ ${AIRFLOW_FALLBACK_NO_CONSTRAINTS_INSTALLATION} != "true" 
]]; then
+                echo
+                echo "${COLOR_RED}Failing because constraints installation 
failed and fallback is disabled.${COLOR_RESET}"
+                echo
+                exit 1
+            fi
+            echo
+            echo "${COLOR_YELLOW}Likely there are new dependencies conflicting 
with constraints.${COLOR_RESET}"
+            echo
+            echo "${COLOR_BLUE}Falling back to no-constraints 
installation.${COLOR_RESET}"
+            echo
+            set -x
+            ${PACKAGING_TOOL_CMD} install ${EXTRA_INSTALL_FLAGS} \
+                    ${ADDITIONAL_PIP_INSTALL_FLAGS} \
+                    "${install_airflow_package[@]}" 
"${installing_providers_packages[@]}"
+        fi
     fi
+    set +x
     common::install_packaging_tools
     pip check
 }

Reply via email to