Skip to content

[release/13.3] Add Ubuntu apt mirror override for CLI E2E images#16793

Open
danegsta wants to merge 4 commits intomicrosoft:release/13.3from
danegsta:backport/pr-16753-to-release/13.3-manual
Open

[release/13.3] Add Ubuntu apt mirror override for CLI E2E images#16793
danegsta wants to merge 4 commits intomicrosoft:release/13.3from
danegsta:backport/pr-16753-to-release/13.3-manual

Conversation

@danegsta
Copy link
Copy Markdown
Member

@danegsta danegsta commented May 5, 2026

Backport of #16753 to release/13.3

/cc @danegsta

Description

Manual backport of #16753 after the automated backport failed on a three-way merge conflict in tests/Shared/Docker/Dockerfile.e2e.

Adds a declarative Ubuntu APT mirror override for the CLI E2E test Dockerfiles. The Dockerfiles now accept UBUNTU_APT_MIRROR and use a shared helper to write a deb822 ubuntu.sources file, rather than patching existing apt configuration with sed.

This also wires ASPIRE_E2E_UBUNTU_APT_MIRROR through the CLI E2E Docker build configuration, including the shared polyglot and Podman base image builds. Linux CI test jobs default to Azure-hosted Ubuntu mirrors, using azure.archive.ubuntu.com for x64 and azure.ports.ubuntu.com for arm64, to reduce failures when the default Ubuntu package servers are overloaded.

Validation:

  • ./restore.sh
  • git --no-pager diff --check upstream/release/13.3...HEAD
  • sh -n tests/Shared/Docker/configure-ubuntu-apt-mirror.sh
  • dotnet test --project tests/Aspire.Cli.EndToEnd.Tests/Aspire.Cli.EndToEnd.Tests.csproj --no-launch-profile -- --filter-class "*.CliInstallStrategyTests" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"
  • docker run --rm -v "$PWD/tests/Shared/Docker/configure-ubuntu-apt-mirror.sh:/tmp/configure-ubuntu-apt-mirror.sh:ro" ubuntu:24.04 sh -c 'sh /tmp/configure-ubuntu-apt-mirror.sh http://azure.archive.ubuntu.com/ubuntu/ && grep -F "URIs: http://azure.archive.ubuntu.com/ubuntu" /etc/apt/sources.list.d/ubuntu.sources && grep -F "noble-security" /etc/apt/sources.list.d/ubuntu.sources'

Fixes # (issue)

Customer Impact

Release-branch CLI E2E validation can fail when the default Ubuntu package servers are overloaded, which can delay validation of servicing fixes.

Testing

Restore, focused CLI install strategy tests, shell syntax validation, diff whitespace checks, and an Ubuntu container smoke test for the mirror configuration helper.

Risk

Low. The change is scoped to CLI E2E test Docker image setup and CI build arguments, with no public API or shipped runtime behavior changes.

Regression?

Unknown - the source PR does not identify a product regression; this is a CI reliability mitigation.

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?

danegsta and others added 4 commits May 5, 2026 10:45
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 5, 2026 18:24
@danegsta danegsta requested review from eerhardt and radical as code owners May 5, 2026 18:24
Copy link
Copy Markdown
Contributor

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 backports #16753 to release/13.3, adding a configurable Ubuntu APT mirror override for the CLI E2E Docker images to improve CI reliability when default Ubuntu package servers are overloaded.

Changes:

  • Introduces tests/Shared/Docker/configure-ubuntu-apt-mirror.sh, which writes a deb822 ubuntu.sources file when UBUNTU_APT_MIRROR is provided.
  • Updates CLI E2E Dockerfiles to accept UBUNTU_APT_MIRROR and invoke the shared configuration helper prior to apt-get usage.
  • Wires ASPIRE_E2E_UBUNTU_APT_MIRROR through test container build args (including shared polyglot/podman base image builds) and sets sensible Linux CI defaults in run-tests.yml, with unit tests covering build-arg propagation.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/Shared/Docker/Dockerfile.e2e-polyglot-java Adds UBUNTU_APT_MIRROR arg + runs mirror configuration before installing Java.
tests/Shared/Docker/Dockerfile.e2e-polyglot-base Adds mirror arg + config in both build and runtime stages for polyglot base image.
tests/Shared/Docker/Dockerfile.e2e-podman Adds mirror arg + config before installing Podman dependencies.
tests/Shared/Docker/Dockerfile.e2e Adds mirror arg + config in build and runtime stages before apt operations.
tests/Shared/Docker/configure-ubuntu-apt-mirror.sh New helper script to declaratively write /etc/apt/sources.list.d/ubuntu.sources.
tests/Shared/CliInstallStrategy.cs Adds env/build-arg constants + propagates mirror env var into container build args.
tests/Aspire.Cli.EndToEnd.Tests/Helpers/CliInstallStrategyTests.cs Adds tests validating build-arg propagation behavior.
tests/Aspire.Cli.EndToEnd.Tests/Helpers/CliE2ETestHelpers.cs Passes mirror build arg to shared base-image docker build invocations.
.github/workflows/run-tests.yml Sets ASPIRE_E2E_UBUNTU_APT_MIRROR defaults for Linux CI (x64 vs ARM64).

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 16793

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 16793"

@joperezr
Copy link
Copy Markdown
Member

joperezr commented May 5, 2026

Chatted with @danegsta offline about this one. This is infra-only change so we will only merge if needed due to Prs being blocked.

@eerhardt
Copy link
Copy Markdown
Member

eerhardt commented May 6, 2026

Why are the Cli.EndToEnd tests still failing on this PR? I thought that's what this was supposed to fix.

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.

4 participants