-
-
Notifications
You must be signed in to change notification settings - Fork 214
feat: mirror fallbacks #1903
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
feat: mirror fallbacks #1903
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds resilient apt-get update functionality with automatic mirror fallback to handle unreliable package repository mirrors, and updates PostgreSQL package versions.
- Adds
apt_update_with_fallbackfunction that tries multiple Ubuntu mirror tiers (regional CDN → global pool → Australia mirror) with exponential backoff - Replaces direct
apt-get updatecalls with the fallback function in both surrogate and chroot bootstrap scripts - Updates PostgreSQL version strings to include
-apt-1suffix
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 9 comments.
| File | Description |
|---|---|
| ebssurrogate/scripts/surrogate-bootstrap-nix.sh | Adds mirror fallback function that retrieves region from EC2 metadata and implements retry logic across three mirror tiers; integrates fallback into package installation workflow |
| ebssurrogate/scripts/chroot-bootstrap-nix.sh | Adds similar mirror fallback function that detects region from sources.list; integrates fallback into chroot package installation and repository updates |
| ansible/vars.yml | Updates PostgreSQL version strings from 17.5.1.064-orioledb, 17.6.1.043, and 15.14.1.043 to add -apt-1 suffix |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Recent builds have run into mirror sync issues on package installation
Files Modified:
ebssurrogate/scripts/chroot-bootstrap-nix.sh - Added apt_update_with_fallback() function (lines 24-82) - Updated update_install_packages() to use fallback (line 91-94) - Updated second apt-get update to use fallback (line 126-129)
ebssurrogate/scripts/surrogate-bootstrap-nix.sh - Added apt_update_with_fallback() function with region detection (lines 20-93) - Updated install_packages() to use fallback at 3 critical points (lines 96-122)
Key Features Implemented:
3-Tier Fallback:
Tier 1: Regional CDN (.clouds.ports.ubuntu.com)
Tier 2: Global pool (ports.ubuntu.com)
5-minute timeout per mirror attempt
Automatic cleanup of partial downloads between attempts
Exponential backoff (5s, 10s)
Detailed logging showing which mirror succeeded
Graceful degradation if region detection fails
Expected Behavior:
95% of builds: Use regional CDN, no performance impact
During mirror sync: Automatically switch to global pool in ~10-15 seconds