[AMD] Fix CI and add retry logic for git clone timeout (#15663)

Co-authored-by: Bingxu Chen <bingxche@amd.com>
This commit is contained in:
yctseng0211
2026-01-05 12:37:52 -08:00
committed by GitHub
co-authored by Bingxu Chen
parent 1751c75b5d
commit c371df2f25
2 changed files with 40 additions and 3 deletions
+38 -1
View File
@@ -60,6 +60,41 @@ install_with_retry() {
return 1
}
# Helper function to git clone with retries
git_clone_with_retry() {
local repo_url="$1"
local dest_dir="${2:-}"
local branch_args="${3:-}"
local max_attempts=3
for attempt in $(seq 1 $max_attempts); do
echo "Git clone attempt $attempt/$max_attempts: $repo_url"
# prevent from partial clone
if [ -n "$dest_dir" ] && [ -d "$dest_dir" ]; then
rm -rf "$dest_dir"
fi
if git \
-c http.lowSpeedLimit=1000 \
-c http.lowSpeedTime=30 \
clone --depth 1 ${branch_args:+$branch_args} "$repo_url" "$dest_dir"; then
echo "Git clone succeeded."
return 0
fi
if [ $attempt -lt $max_attempts ]; then
echo "Git clone failed, retrying in 5 seconds..."
sleep 5
fi
done
echo "Git clone failed after $max_attempts attempts: $repo_url"
return 1
}
case "${GPU_ARCH}" in
mi35x)
echo "Runner uses ${GPU_ARCH}; will fetch mi35x image."
@@ -82,7 +117,9 @@ case "${GPU_ARCH}" in
;;
esac
docker exec -w / ci_sglang git clone https://github.com/merrymercy/human-eval.git
#docker exec -w / ci_sglang git clone https://github.com/merrymercy/human-eval.git
git_clone_with_retry https://github.com/merrymercy/human-eval.git human-eval
docker cp human-eval ci_sglang:/
install_with_retry docker exec -w /human-eval ci_sglang pip install --cache-dir=/sgl-data/pip-cache -e .
docker exec -w / ci_sglang mkdir -p /dummy-grok