-
Notifications
You must be signed in to change notification settings - Fork 520
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): workaround to retry
error decoding response body
from uv (…
…#3889) This PR uses a shell wrapper to check if the `error decoding response body` error message is in the uv stderr and retry if so. It is just a workaround for astral-sh/uv#2586 and astral-sh/uv#3514 and hope the upstream can fix it. Note that this PR does nothing with cibuildwheel. It's unclear how to retry with certain errors under its complex logic (feature requested in pypa/cibuildwheel#1846). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Chores** - Standardized installation process for TensorFlow, Torch, and other dependencies across workflows by using `uv_with_retry.sh` script to ensure reliable installations. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
- Loading branch information
1 parent
82e685d
commit 0ded21a
Showing
5 changed files
with
40 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
# This script is used to retry the uv command if the error "error decoding response body" is encountered. | ||
# See also: | ||
# https://github.com/astral-sh/uv/issues/2586 | ||
# https://github.com/astral-sh/uv/issues/3456 | ||
# https://github.com/astral-sh/uv/issues/3514 | ||
# https://github.com/astral-sh/uv/issues/4402 | ||
tmpstderr=$(mktemp) | ||
max_retry=3 | ||
while true; do | ||
uv "$@" 2> >(tee -a "${tmpstderr}" >&2) | ||
exit_code=$? | ||
# exit if ok | ||
if [ $exit_code -eq 0 ]; then | ||
rm -f "${tmpstderr}" | ||
exit 0 | ||
fi | ||
# check if "error decoding response body" is in the stderr | ||
if grep -q "error decoding response body" "${tmpstderr}"; then | ||
echo "Retrying uv in 1 s..." | ||
max_retry=$((max_retry - 1)) | ||
if [ $max_retry -eq 0 ]; then | ||
echo "Max retry reached, exiting..." | ||
rm -f "${tmpstderr}" | ||
exit 1 | ||
fi | ||
sleep 1 | ||
else | ||
rm -f "${tmpstderr}" | ||
exit $exit_code | ||
fi | ||
done |