Skip to content

Add automated retry for network errors in install.sh and CI - #374

Merged
bonachea merged 6 commits into
BerkeleyLab:mainfrom
bonachea:ci-retry
Sep 28, 2026
Merged

bonachea merged 6 commits into
BerkeleyLab:mainfrom
bonachea:ci-retry

Conversation

@bonachea

Copy link
Copy Markdown
Member

Summary

The Caffeine CI Action includes fetching many prerequisites over the network, from both GitHub itself and also from Homebrew and the Ubuntu package servers. install.sh also clones the assert and julienne dependencies from GitHub. Most of these network operations are currently vulnerable to transient network faults, which periodically arise and usually fail the entire job, creating meaningless failure noise and wasting maintainer time and runner cycles.

This PR adds automated retry for most network operations that take place in both Caffeine CI Actions (e.g. to download build prerequisites), and within install.sh (when fetching assert and julienne, or running Homebrew), thereby improving CI/build resilience to transient network problems.

Examples

Before this PR

Here are some recent examples of job failures caused by network transients on otherwise correct code:

Homebrew failure in CI step:

https://github.com/BerkeleyLab/caffeine/actions/runs/29650246717/job/88095270587#step:6:27
image

Homebrew failure in install.sh:

https://github.com/BerkeleyLab/caffeine/actions/runs/29650246717/job/88095270698#step:16:133

image

Git fetch failures within fpm build:

https://github.com/BerkeleyLab/caffeine/actions/runs/31532814604/job/93916730519#step:16:1886
image

image

And many others:
https://github.com/BerkeleyLab/caffeine/actions/runs/34671967323/job/103494898136#step:21:2559
https://github.com/BerkeleyLab/caffeine/actions/runs/34799622918/job/103839489637#step:21:2530
https://github.com/BerkeleyLab/caffeine/actions/runs/31532814604/job/93916730698#step:16:2745
https://github.com/BerkeleyLab/caffeine/actions/runs/31630099427/job/94226514338#step:16:2751

After this PR

Example retries on a transient git clone failure, now handled (with a warning) by install.sh:

https://github.com/bonachea/caffeine/actions/runs/36297846900/job/108559968903#step:22:2009
image

https://github.com/bonachea/caffeine/actions/runs/36227503338/job/108364264635#step:30:372
image

Example retry on a transient brew update failure, in scripted CI step:
https://github.com/bonachea/caffeine/actions/runs/36213574257/job/108527369168#step:8:201
image

Related but orthogonal

GitHub's job setup step already includes some retry when cloning dependent actions, example:
https://github.com/bonachea/caffeine/actions/runs/36297838177/job/108559969245#step:1:33

image

FPM git fetches are not resilient to transient network errors,
they drop dead after a single failure with no retry.

Replace that with scripted git fetches with automatic retry.
@bonachea
bonachea requested a review from rouson September 27, 2026 17:59
@bonachea

Copy link
Copy Markdown
Member Author

Once merged, I plan to clone the new CI bits to our other projects using the same CI framework.

@rouson rouson left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread .github/workflows/build.yml
@bonachea
bonachea merged commit 80510b6 into BerkeleyLab:main Sep 28, 2026
63 checks passed
@bonachea
bonachea deleted the ci-retry branch September 28, 2026 17:28
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.

2 participants