diff --git a/Dockerfile.ci b/Dockerfile.ci index 601aa781a8a29..2b1c38f371e56 100644 --- a/Dockerfile.ci +++ b/Dockerfile.ci @@ -1474,8 +1474,26 @@ function check_force_lowest_dependencies() { # --no-binary is needed in order to avoid libxml and xmlsec using different version of libxml2 # (binary lxml embeds its own libxml2, while xmlsec uses system one). # See https://bugs.launchpad.net/lxml/+bug/2110068 - uv sync --resolution lowest-direct --no-binary-package lxml --no-binary-package xmlsec --all-extras \ - --no-python-downloads --no-managed-python + + local sync_successful="false" + for attempt in 1 2 3; do + echo "Attempt ${attempt} of syncing to lowest dependencies" + set -x + if UV_LOCK_TIMEOUT=200 uv sync --resolution lowest-direct --no-binary-package lxml --no-binary-package xmlsec --all-extras \ + --no-python-downloads --no-managed-python; then + set +x + sync_successful="true" + break + fi + set +x + echo "Sleeping 30s" + sleep 30 + echo "Attempt ${attempt} failed. Retrying..." + done + if [[ "${sync_successful}" != "true" ]]; then + echo "${COLOR_RED}Failed to sync lowest dependencies after 3 attempts.${COLOR_RESET}" + exit 1 + fi else echo echo "${COLOR_BLUE}Forcing dependencies to lowest versions for Airflow.${COLOR_RESET}" diff --git a/scripts/docker/entrypoint_ci.sh b/scripts/docker/entrypoint_ci.sh index e7c55af3a2ee1..fe0cbf226205e 100755 --- a/scripts/docker/entrypoint_ci.sh +++ b/scripts/docker/entrypoint_ci.sh @@ -413,8 +413,26 @@ function check_force_lowest_dependencies() { # --no-binary is needed in order to avoid libxml and xmlsec using different version of libxml2 # (binary lxml embeds its own libxml2, while xmlsec uses system one). # See https://bugs.launchpad.net/lxml/+bug/2110068 - uv sync --resolution lowest-direct --no-binary-package lxml --no-binary-package xmlsec --all-extras \ - --no-python-downloads --no-managed-python + + local sync_successful="false" + for attempt in 1 2 3; do + echo "Attempt ${attempt} of syncing to lowest dependencies" + set -x + if UV_LOCK_TIMEOUT=200 uv sync --resolution lowest-direct --no-binary-package lxml --no-binary-package xmlsec --all-extras \ + --no-python-downloads --no-managed-python; then + set +x + sync_successful="true" + break + fi + set +x + echo "Sleeping 30s" + sleep 30 + echo "Attempt ${attempt} failed. Retrying..." + done + if [[ "${sync_successful}" != "true" ]]; then + echo "${COLOR_RED}Failed to sync lowest dependencies after 3 attempts.${COLOR_RESET}" + exit 1 + fi else echo echo "${COLOR_BLUE}Forcing dependencies to lowest versions for Airflow.${COLOR_RESET}"