Skip to content

Conversation

@samrose
Copy link
Collaborator

@samrose samrose commented Nov 10, 2025

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

@samrose samrose requested a review from Copilot November 10, 2025 17:01
Copy link

Copilot AI left a 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_fallback function that tries multiple Ubuntu mirror tiers (regional CDN → global pool → Australia mirror) with exponential backoff
  • Replaces direct apt-get update calls with the fallback function in both surrogate and chroot bootstrap scripts
  • Updates PostgreSQL version strings to include -apt-1 suffix

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.

@samrose samrose requested a review from doublethink November 10, 2025 21:40
@samrose samrose marked this pull request as ready for review November 10, 2025 21:44
@samrose samrose requested review from a team as code owners November 10, 2025 21:44
@samrose samrose enabled auto-merge November 10, 2025 22:10
@samrose samrose added this pull request to the merge queue Nov 11, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Nov 11, 2025
@samrose samrose added this pull request to the merge queue Nov 11, 2025
Merged via the queue into develop with commit f7bb8b0 Nov 11, 2025
14 checks passed
@samrose samrose deleted the fix/mirror-sync branch November 11, 2025 02:25
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.

5 participants