forked from WebKit/WebKit
-
Notifications
You must be signed in to change notification settings - Fork 55
ci: apt mirror failover, retried LLVM install, no fail-fast between build variants #473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
robobun
wants to merge
1
commit into
main
Choose a base branch
from
farm/dd7dd178/ci-apt-mirror-failover-llvm-retries
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| #!/usr/bin/env bash | ||
| # Install LLVM from apt.llvm.org inside the Docker builds. Usage, from a | ||
| # Dockerfile RUN step: install-llvm.sh <major version> [all] | ||
| # | ||
| # This runs apt.llvm.org's own llvm.sh, it only adds the retries llvm.sh does | ||
| # not have. Every docker build (about 25 per CI run) fetches llvm.sh, probes the | ||
| # repo and the signing key with HEAD requests, downloads the key, then pulls | ||
| # about 30 debs, all from apt.llvm.org and none of it retried. One failed | ||
| # request fails the build, and during a burst of builds that happens to a few | ||
| # variants per run: the connection to apt.llvm.org fails, or llvm.sh exits with | ||
| # "GPG key not reachable", or a repo probe fails and llvm.sh misreports it as | ||
| # "Distribution 'ubuntu' ... is not supported by this script". | ||
| # | ||
| # So the whole install is one attempt, retried with a growing pause: fetch the | ||
| # key, fetch the script, run it. llvm.sh only runs add-apt-repository, apt-get | ||
| # update and apt-get install, which are idempotent, and it skips its own | ||
| # unretried key download because the key file is already there. The retry is | ||
| # a shell loop rather than curl --retry: curl --retry covers timeouts, a few | ||
| # HTTP codes and (with --retry-connrefused) ECONNREFUSED, but not the other | ||
| # connect failures seen here, and focal's curl has no --retry-all-errors. | ||
| set -euo pipefail | ||
|
|
||
| if [ $# -lt 1 ]; then | ||
| echo "usage: $0 <llvm major version> [all]" >&2 | ||
| exit 2 | ||
| fi | ||
|
|
||
| # Both files are a few KB. The time limits turn a stalled server into a failed | ||
| # attempt instead of a job that sits there until its 90 minute timeout. | ||
| fetch() { | ||
| curl -fsSL --connect-timeout 15 --max-time 60 "$1" -o "$2" | ||
| } | ||
|
|
||
| attempt() { | ||
| fetch https://apt.llvm.org/llvm-snapshot.gpg.key /etc/apt/trusted.gpg.d/apt.llvm.org.asc && | ||
| fetch https://apt.llvm.org/llvm.sh /tmp/llvm.sh && | ||
| bash /tmp/llvm.sh "$@" | ||
| } | ||
|
|
||
| for n in 1 2 3 4 5; do | ||
| if attempt "$@"; then | ||
| rm -f /tmp/llvm.sh | ||
| exit 0 | ||
| fi | ||
| echo "installing LLVM from apt.llvm.org failed (attempt $n of 5)" >&2 | ||
| if [ "$n" -lt 5 ]; then | ||
| sleep $((n * 5)) | ||
| fi | ||
| done | ||
| exit 1 | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.