[release/13.3] Add Ubuntu apt mirror override for CLI E2E images#16793
Open
danegsta wants to merge 4 commits intomicrosoft:release/13.3from
Open
[release/13.3] Add Ubuntu apt mirror override for CLI E2E images#16793danegsta wants to merge 4 commits intomicrosoft:release/13.3from
danegsta wants to merge 4 commits intomicrosoft:release/13.3from
Conversation
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>
Contributor
There was a problem hiding this comment.
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 deb822ubuntu.sourcesfile whenUBUNTU_APT_MIRRORis provided. - Updates CLI E2E Dockerfiles to accept
UBUNTU_APT_MIRRORand invoke the shared configuration helper prior toapt-getusage. - Wires
ASPIRE_E2E_UBUNTU_APT_MIRRORthrough test container build args (including shared polyglot/podman base image builds) and sets sensible Linux CI defaults inrun-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). |
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 16793Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 16793" |
Member
|
Chatted with @danegsta offline about this one. This is infra-only change so we will only merge if needed due to Prs being blocked. |
Member
|
Why are the Cli.EndToEnd tests still failing on this PR? I thought that's what this was supposed to fix. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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_MIRRORand use a shared helper to write a deb822ubuntu.sourcesfile, rather than patching existing apt configuration withsed.This also wires
ASPIRE_E2E_UBUNTU_APT_MIRRORthrough 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, usingazure.archive.ubuntu.comfor x64 andazure.ports.ubuntu.comfor arm64, to reduce failures when the default Ubuntu package servers are overloaded.Validation:
./restore.shgit --no-pager diff --check upstream/release/13.3...HEADsh -n tests/Shared/Docker/configure-ubuntu-apt-mirror.shdotnet 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
<remarks />and<code />elements on your triple slash comments?aspire.devissue: