Skip to content

Commit fe45252

Browse files
feat: add retry mechanism and manifest verification to GPU image validation
1 parent ae01468 commit fe45252

1 file changed

Lines changed: 31 additions & 4 deletions

File tree

.github/workflows/docker-publish.yml

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,7 @@ jobs:
503503
# ========================================
504504
verify-images:
505505
needs: [build-gpu, cleanup-unwanted-images]
506+
if: ${{ needs.build-gpu.result == 'success' }}
506507
runs-on: ubuntu-latest
507508

508509
permissions:
@@ -513,18 +514,44 @@ jobs:
513514
id: version
514515
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
515516

517+
- name: Set up Docker Buildx
518+
uses: docker/setup-buildx-action@v3
519+
516520
- name: Prepare lowercase image name
517521
id: image-name
518522
run: |
519523
# Convert to lowercase for Docker compatibility
520524
LOWERCASE_IMAGE_NAME=$(echo "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}" | tr '[:upper:]' '[:lower:]')
521525
echo "IMAGE_NAME_LOWER=${LOWERCASE_IMAGE_NAME}" >> $GITHUB_OUTPUT
522526
523-
- name: Verify GPU image
527+
- name: Verify GPU image (with retry)
524528
run: |
525-
echo "Verifying GPU image for version ${{ steps.version.outputs.VERSION }}..."
526-
docker pull ${{ steps.image-name.outputs.IMAGE_NAME_LOWER }}:${{ steps.version.outputs.VERSION }}-gpu
527-
docker pull ${{ steps.image-name.outputs.IMAGE_NAME_LOWER }}:latest-gpu
529+
set -e
530+
IMAGE="${{ steps.image-name.outputs.IMAGE_NAME_LOWER }}"
531+
VERSION="${{ steps.version.outputs.VERSION }}"
532+
TAG1="$IMAGE:$VERSION-gpu"
533+
TAG2="$IMAGE:latest-gpu"
534+
echo "Verifying GPU image tags: $TAG1 and $TAG2"
535+
536+
for tag in "$TAG1" "$TAG2"; do
537+
echo "Checking availability for $tag"
538+
FOUND=0
539+
for i in $(seq 1 12); do
540+
if docker buildx imagetools inspect "$tag" > /dev/null 2>&1; then
541+
echo "Found manifest for $tag"
542+
FOUND=1
543+
break
544+
fi
545+
echo "Manifest not ready for $tag (attempt $i/12). Waiting 20s..."
546+
sleep 20
547+
done
548+
if [ "$FOUND" -ne 1 ]; then
549+
echo "Manifest still not available for $tag after waiting. Failing."
550+
exit 1
551+
fi
552+
echo "Pulling $tag"
553+
docker pull "$tag"
554+
done
528555
529556
- name: List available tags
530557
run: |

0 commit comments

Comments
 (0)