Skip to content

Retry docker compose up to ride out Docker Hub pull flakes - #62

Merged
klagrida merged 1 commit into
mainfrom
retry-compose-ci-pulls
Jun 11, 2026
Merged

Retry docker compose up to ride out Docker Hub pull flakes#62
klagrida merged 1 commit into
mainfrom
retry-compose-ci-pulls

Conversation

@klagrida

Copy link
Copy Markdown
Contributor

Problem

Transient Docker Hub pulls (registry-1.docker.io ... context deadline exceeded) were failing compose jobs outright (e.g. analyst-ci this week) and needed a manual re-run. With #61 they now fail fast — but still fail.

Change

Wrap all 16 docker compose … up invocations across the 11 compose workflows in a bounded 3-attempt retry (15s backoff).

for i in 1 2 3; do
  if docker compose … up …; then break; fi
  if [ "$i" = 3 ]; then echo "still failing after $i attempts"; exit 1; fi
  echo "retrying …"; sleep 15
done

Correctness

  • The compose command sits in an if condition, so it's exempt from the runner's set -e — a failed attempt falls through to the retry instead of aborting the step.
  • The 3rd failure exit 1s, so a genuinely-broken run still fails (a naive for … && break loop would return the trailing sleep's 0 and silently mask failure — avoided here).
  • The first attempt runs the identical command, so a healthy job's behaviour is unchanged.

Verified: all 11 workflows parse; bash -n clean; retry semantics tested under bash -eo pipefail (success→0, total-failure→1, fail-then-succeed→0). Only up commands are wrapped — logs/down untouched.

🤖 Generated with Claude Code

Transient `registry-1.docker.io ... context deadline exceeded` pulls were
failing compose jobs outright (e.g. analyst-ci) and needed a manual re-run.
Wrap all 16 `docker compose ... up` invocations across the 11 compose
workflows in a bounded 3-attempt retry.

The command sits in an `if` condition so it's exempt from the runner's
`set -e` (a failed attempt falls through to the retry instead of aborting
the step); the 3rd failure `exit 1`s, so a genuinely-broken run still fails.
First attempt runs the identical command, so a healthy job is unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@klagrida
klagrida merged commit c9f40f7 into main Jun 11, 2026
15 checks passed
@klagrida
klagrida deleted the retry-compose-ci-pulls branch June 11, 2026 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant