fix(ci): unbreak Linux agents (no Docker Hub, emulated tests on 24.04-min) - #895
Open
Ahmed Muhsin (ahmedmuhsin) wants to merge 6 commits into
Open
fix(ci): unbreak Linux agents (no Docker Hub, emulated tests on 24.04-min)#895Ahmed Muhsin (ahmedmuhsin) wants to merge 6 commits into
Ahmed Muhsin (ahmedmuhsin) wants to merge 6 commits into
Conversation
Docker integration tests have failed on dev every night since 2026-08-15 at 'Build and package test apps': docker: Get https://registry-1.docker.io/v2/: context deadline exceeded. The agents can no longer reach Docker Hub, and build-apps.ps1 pulled ubuntu:22.04 purely to run mksquashfs. No code change caused this; dev has not moved since 08-12. Run mksquashfs on the agent instead, and install squashfs-tools in the job. This also drops the apt-get that ran inside the container. The Docker path is kept as a fallback for machines without squashfs-tools (e.g. Windows dev boxes) and now points at the MCR mirror rather than Docker Hub. Everything else in dockertests already used MCR (azurite, mesh); ubuntu:22.04 was the only Docker Hub dependency.
The 22.04 image boots ~92% full on / (6.5G free), which is why dotnet test kept filling the disk and killing agents (exit 134, reported as a cancelled job). The workaround was to rm -rf Android/Haskell/Swift/CodeQL at job start. 1es-ubuntu-24.04-min starts at 15% used (62G free), so that cleanup is no longer needed here. -min ships no Maven and no Node, so install both. The PreInstalled JDK step is dropped (/usr/lib/jvm is empty on -min, and the matrix JDK is downloaded a few steps later anyway), and packaging runs with -skipNuget because the nuget CLI needs mono: these tests read the worker from target/, never the .nupkg. Docker integration tests stay on 22.04: that job resolves JDKs 8/11/17/21 via PreInstalled and uses UsePythonVersion, which -min cannot satisfy without a much larger change.
added 4 commits
August 19, 2026 17:43
The script cloned https://github.com/ahmedmuhsin/azure-maven-plugins (a personal fork) at branch sdk-types and ran mvn clean install, publishing the result into the local ~/.m2 repository that subsequent worker builds resolve from. That is untrusted build code landing in the build environment (CWE-829). Nothing references it: no pipeline, script, or doc mentions installMavenPluginLocally, so it is not reachable from CI and removing it changes no build behaviour. The sibling installAdditionsLocally.ps1 shows the intended convention, cloning the official Azure/azure-functions-java-additions repo.
Same reasoning as the Linux job: setup-tests-pipeline.ps1 copies the worker from target/, so the .nupkg these tests build is never read. Only build-artifacts.yml publishes packages. Drops the NuGet tool installer that existed to serve the pack step; 'Authenticate NuGet to CFS' and the dotnet test restore do not depend on it, as the Linux job already demonstrates.
Removes the last disk-cleanup step. On the docker legs that step cost 75-119s each (~100s avg, roughly 12% of a 10-16 min leg, ~6.7 min of agent time per build) purely to make room on an image that ships 67G of toolsets these tests never use. -min starts at 15% used, so nothing needs deleting. Adapting to the leaner image: install Maven, squashfs-tools and python3-venv up front; download the matrix JDK and install it with JavaToolInstaller LocalDirectory, since /usr/lib/jvm is empty on -min and PreInstalled resolves nothing; and replace UsePythonVersion (no Python in the -min tool cache) with the system python3, which satisfies the test kit's requires-python >= 3.8. pip installs into a venv because the system interpreter on 24.04 is externally managed (PEP 668). The docker daemon is present on -min, so the tests themselves are unaffected.
Temurin for 8, Microsoft OpenJDK from 11 up, matching production and the emulated jobs. Worth recording because the previous PreInstalled lookup read JAVA_HOME_<n>_X64 from the agent image, which supplied Temurin for every version, so the 11+ legs had quietly diverged from what we ship.
Copilot started reviewing on behalf of
Ahmed Muhsin (ahmedmuhsin)
August 21, 2026 15:01
View session
There was a problem hiding this comment.
Pull request overview
This PR updates CI templates and build scripts to restore reliability of Linux CI agents by removing a Docker Hub dependency during test-app packaging, reducing disk pressure on hosted agents by moving jobs to a leaner Ubuntu image, and skipping unnecessary NuGet packaging in emulated test legs.
Changes:
- Update Linux job templates to use
1es-ubuntu-24.04-minand explicitly install missing toolchain components (e.g., Maven/Node/Python venv) while removing disk-cleanup steps. - Skip NuGet packaging in emulated test jobs by passing
-skipNugettopackage-pipeline.ps1and removing the NuGet tool installer steps. - Prefer host
mksquashfsfor Docker test app packaging, with a Docker fallback pointing to the MCR Ubuntu mirror; remove an unused/unsafe Maven plugin install script.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
installMavenPluginLocally.ps1 |
Removes an unused script that cloned and built a personal forked Maven plugin repo. |
eng/ci/templates/jobs/run-emulated-tests-windows.yml |
Drops NuGet tool install and skips NuGet packaging in the emulated Windows job. |
eng/ci/templates/jobs/run-emulated-tests-linux.yml |
Moves emulated Linux tests to 1es-ubuntu-24.04-min, installs Maven/Node, removes disk cleanup, and skips NuGet packaging. |
eng/ci/templates/jobs/run-docker-tests-linux.yml |
Updates Docker integration test job to 1es-ubuntu-24.04-min, installs required build tools, downloads JDKs, and uses a Python venv for pip-based tooling. |
dockertests/build-apps.ps1 |
Uses host mksquashfs when available to avoid Docker Hub pulls; Docker fallback uses MCR mirror. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Copilot started reviewing on behalf of
Ahmed Muhsin (ahmedmuhsin)
August 21, 2026 15:43
View session
Swapnil Nagar (swapnil-nagar)
approved these changes
Aug 21, 2026
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.
Fixes for the Linux CI agents, plus a related build-script cleanup. Supersedes #893.
1. Test apps can no longer be packaged via Docker Hub
The Docker integration tests failed on
devevery night from 2026-08-15 (builds 298300, 298418, 298540, 298743). All four legs failed at Build and package test apps:No code change caused this:
devhad not moved since 08-12, and 08-11 through 08-14 were green. The agents can no longer pull from Docker Hub.build-apps.ps1pulledubuntu:22.04only to getmksquashfs, then ranapt-get install squashfs-toolsinside that container — two dependencies on public network access.Fix: run
mksquashfson the agent and installsquashfs-toolsin the job, which removes the image pull and the in-containerapt-gettogether. The Docker path stays as a fallback for machines withoutsquashfs-tools(Windows dev boxes) and now points at the MCR mirror. Everything else underdockertests/already used MCR (azure-storage/azurite,azure-functions/mesh);ubuntu:22.04was the last Docker Hub reference in the suite.2. Both Linux jobs move to
1es-ubuntu-24.04-min1es-ubuntu-22.04boots ~92% full on/(67G used of 73G), almost all of it toolsets these jobs never touch: Android SDK and Haskell under/usr/local(~24G),/var/libincluding cached docker images (~12G), Swift and miniconda under/usr/share(~9.5G), CodeQL and PyPy in the tool cache (~6.7G). With that little headroomdotnet testfilled the disk, the agent aborted with exit 134, and ADO reported the job as cancelled rather than failed.#883 worked around it by
rm -rf-ing those toolsets at job start. That held, but it deletes paths out from under a hosted image, so it breaks silently whenever they move — and it cost real time: on the docker legs alone the cleanup step ran 75–119s each, roughly 12% of a 10–16 minute leg.1es-ubuntu-24.04-minstarts at 15% used (62G free) — more headroom than the cleanup produced (34G), with nothing to delete. Both Linux jobs now use it and the cleanup steps are gone from the repo entirely.The tradeoff is that
-minships very little, so each job installs what it needs:-minapt-get install -y mavennpm install -g azurite)NodeTool@0squashfs-tools(forbuild-apps.ps1)apt-get install -y squashfs-tools/usr/lib/jvmempty, soJavaToolInstallerPreInstalledresolves nothingLocalDirectoryUsePythonVersioncannot resolvepython3(test kit needs>=3.8), with a venv because 24.04's system interpreter is externally managed (PEP 668)nugetCLI cannot run-skipNuget, see below-skipNugetAnything added to these jobs from now on has to install what it needs.
Note on JDK vendors. The docker legs previously used
jdkSourceOption: 'PreInstalled', which resolvesJAVA_HOME_<n>_X64from the agent image — that supplied Temurin for every version, so 11+ had quietly diverged from what we ship. They now download pinned JDKs: Temurin for 8, Microsoft OpenJDK for 11/17/21, matching production and the emulated jobs. Versions come fromjava-versions.yml, so they no longer drift when the agent image is refreshed.Plain
1es-ubuntu-24.04is not an option — it does not exist in the pool (Image 1es-ubuntu-24.04 doesn't exist in pool 1es-pool-azfunc-public).3. Emulated tests stop building a NuGet package
Both emulated jobs ran
package-pipeline.ps1without-skipNuget, building a.nupkgneither of them reads:setup-tests-pipeline.ps1copies the worker out oftarget/, and onlybuild-artifacts.ymlpublishes packages.On Linux this became a hard failure, because the
nugetCLI needs mono and-mindoes not ship it. On Windows it was only wasted work. Both now pass-skipNugetand drop the NuGet tool installer that existed to serve the pack step;Authenticate NuGet to CFSand thedotnet testrestore do not depend on it.4. Remove
installMavenPluginLocally.ps1The script cloned
https://github.com/ahmedmuhsin/azure-maven-plugins(a personal fork) at branchsdk-typesand ranmvn clean install, publishing the result into the local~/.m2repository that later worker builds resolve from. That puts untrusted build code into the build environment (CWE-829).Nothing references it — no pipeline, script, or doc mentions
installMavenPluginLocally— so it is not reachable from CI and removing it changes no build behaviour. The siblinginstallAdditionsLocally.ps1shows the intended convention, cloning the officialAzure/azure-functions-java-additions.Validation
-min(9.8–13.7 min), disk steady at 62G free with no cleanup step.-minwith downloaded JDKs and the venv-based Python, and got faster: 14.6/13.1/10.7/16.0 min → 13.5/9.8/10.2/10.9 min. Single sample, so treat the magnitude as directional, but every leg improved despite adding a JDK download.official-build.ymlandpublic-build.ymlconsume these job templates, so the fixes apply to both pipelines.CI and local build scripts only, no product change.
Follow-up (not in this PR)
integration-tests.ymlstill runs its E2E Linux job on1es-ubuntu-22.04and still packs a NuGet package. It is unaffected by either problem here — it never invokes docker, and mono is present on 22.04 — so it is left alone. Moving it to-minwould need the same Maven, JDK, and-skipNugettreatment.