This is an automated email from the ASF dual-hosted git repository.
rahulvats pushed a commit to branch v3-1-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit 1b7cde4f2a4acb497954fdeada4033cf4c571af6
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Sat Mar 7 21:21:11 2026 +0100
[v3-1-test] Fallback to no constraint builds for docker-context-files
installation (#63051) (#63057)
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)
Co-authored-by: Jarek Potiuk <[email protected]>
---
Dockerfile | 22 ++++++++++++++++++++--
.../docker/install_from_docker_context_files.sh | 22 ++++++++++++++++++++--
2 files changed, 40 insertions(+), 4 deletions(-)
diff --git a/Dockerfile b/Dockerfile
index 4a37dba420d..4ae1247f4ad 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -993,10 +993,28 @@ function
install_airflow_and_providers_from_docker_context_files(){
fi
set -x
- ${PACKAGING_TOOL_CMD} install ${EXTRA_INSTALL_FLAGS} \
+ if ! ${PACKAGING_TOOL_CMD} install ${EXTRA_INSTALL_FLAGS} \
${ADDITIONAL_PIP_INSTALL_FLAGS} \
"${flags[@]}" \
- "${install_airflow_distribution[@]}"
"${install_airflow_core_distribution[@]}" "${airflow_distributions[@]}"
+ "${install_airflow_distribution[@]}"
"${install_airflow_core_distribution[@]}" "${airflow_distributions[@]}"; 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_distribution[@]}"
"${install_airflow_core_distribution[@]}" \
+ "${airflow_distributions[@]}"
+ fi
set +x
common::install_packaging_tools
# We use pip check here to make sure that whatever `uv` installs, is also
"correct" according to `pip`
diff --git a/scripts/docker/install_from_docker_context_files.sh
b/scripts/docker/install_from_docker_context_files.sh
index 987582f35b6..0dc4262aa1a 100644
--- a/scripts/docker/install_from_docker_context_files.sh
+++ b/scripts/docker/install_from_docker_context_files.sh
@@ -116,10 +116,28 @@ function
install_airflow_and_providers_from_docker_context_files(){
fi
set -x
- ${PACKAGING_TOOL_CMD} install ${EXTRA_INSTALL_FLAGS} \
+ if ! ${PACKAGING_TOOL_CMD} install ${EXTRA_INSTALL_FLAGS} \
${ADDITIONAL_PIP_INSTALL_FLAGS} \
"${flags[@]}" \
- "${install_airflow_distribution[@]}"
"${install_airflow_core_distribution[@]}" "${airflow_distributions[@]}"
+ "${install_airflow_distribution[@]}"
"${install_airflow_core_distribution[@]}" "${airflow_distributions[@]}"; 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_distribution[@]}"
"${install_airflow_core_distribution[@]}" \
+ "${airflow_distributions[@]}"
+ fi
set +x
common::install_packaging_tools
# We use pip check here to make sure that whatever `uv` installs, is also
"correct" according to `pip`