Unverified Commit e8057c00 authored by wenjun liu's avatar wenjun liu Committed by GitHub
Browse files

[CI] Avoid concurrent docker pull in intel XPU CI runners to prevent rate limit issues (#38594)


Signed-off-by: default avatarwendyliu235 <wenjun.liu@intel.com>
parent 74303896
...@@ -239,13 +239,29 @@ fi ...@@ -239,13 +239,29 @@ fi
# --- Docker housekeeping --- # --- Docker housekeeping ---
cleanup_docker cleanup_docker
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin "$REGISTRY"
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 936637512419.dkr.ecr.us-east-1.amazonaws.com
# --- Build or pull test image --- # --- Build or pull test image ---
if [[ -n "${IMAGE_TAG_XPU:-}" ]]; then IMAGE="${IMAGE_TAG_XPU:-${image_name}}"
echo "Using prebuilt XPU image: ${IMAGE_TAG_XPU}"
docker pull "${IMAGE_TAG_XPU}" echo "Using image: ${IMAGE}"
if docker image inspect "${IMAGE}" >/dev/null 2>&1; then
echo "Image already exists locally, skipping pull"
else else
echo "Using prebuilt XPU image: ${image_name}" echo "Image not found locally, waiting for lock..."
docker pull "${image_name}"
flock /tmp/docker-pull.lock bash -c "
if docker image inspect '${IMAGE}' >/dev/null 2>&1; then
echo 'Image already pulled by another runner'
else
echo 'Pulling image...'
timeout 900 docker pull '${IMAGE}'
fi
"
echo "Pull step completed"
fi fi
remove_docker_container() { remove_docker_container() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment