From f4d0fda2cb5aa9925f3b08c56fc883664cf3872d Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Fri, 17 Apr 2026 13:56:11 +0200 Subject: [PATCH] Harden retry behavior in docker and links workflows (#24261) --- .github/workflows/docker.yml | 40 ++++++++++++++++++++++++++---------- .github/workflows/links.yml | 2 ++ 2 files changed, 31 insertions(+), 11 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index f4116d20da..7322ee2a0d 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -118,24 +118,42 @@ jobs: uses: docker/setup-buildx-action@v4 - name: Login to Docker Hub - uses: docker/login-action@v4 + uses: ultralytics/actions/retry@main + env: + DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} + run: | + if ! out=$(printf '%s' "$DOCKERHUB_TOKEN" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin 2>&1); then + printf '%s\n' "$out" >&2 + exit 1 + fi + echo "Logged in to docker.io" - name: Login to GHCR - uses: docker/login-action@v4 + uses: ultralytics/actions/retry@main + env: + GHCR_USERNAME: ${{ github.repository_owner }} + GHCR_TOKEN: ${{ secrets._GITHUB_TOKEN }} with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets._GITHUB_TOKEN }} + run: | + if ! out=$(printf '%s' "$GHCR_TOKEN" | docker login ghcr.io -u "$GHCR_USERNAME" --password-stdin 2>&1); then + printf '%s\n' "$out" >&2 + exit 1 + fi + echo "Logged in to ghcr.io" - name: Login to NVIDIA NGC - uses: docker/login-action@v4 + uses: ultralytics/actions/retry@main + env: + NVIDIA_NGC_API_KEY: ${{ secrets.NVIDIA_NGC_API_KEY }} with: - registry: nvcr.io - username: $oauthtoken - password: ${{ secrets.NVIDIA_NGC_API_KEY }} + run: | + if ! out=$(printf '%s' "$NVIDIA_NGC_API_KEY" | docker login nvcr.io -u '$oauthtoken' --password-stdin 2>&1); then + printf '%s\n' "$out" >&2 + exit 1 + fi + echo "Logged in to nvcr.io" - name: Retrieve Ultralytics version id: get_version diff --git a/.github/workflows/links.yml b/.github/workflows/links.yml index 23645a6559..2cf1059f3e 100644 --- a/.github/workflows/links.yml +++ b/.github/workflows/links.yml @@ -35,6 +35,7 @@ jobs: timeout_minutes: 60 retry_delay_seconds: 1800 retries: 2 + backoff: fixed run: | lychee \ --scheme https \ @@ -70,6 +71,7 @@ jobs: timeout_minutes: 60 retry_delay_seconds: 1800 retries: 2 + backoff: fixed run: | lychee \ --scheme https \