Skip to content

fix(ci): add Linux host disk cleanup for CI builds#22917

Open
agneszitte wants to merge 3 commits intomasterfrom
dev/agzi/ci-linux-host-cleanup
Open

fix(ci): add Linux host disk cleanup for CI builds#22917
agneszitte wants to merge 3 commits intomasterfrom
dev/agzi/ci-linux-host-cleanup

Conversation

@agneszitte
Copy link
Copy Markdown
Contributor

@agneszitte agneszitte commented Mar 29, 2026

What

Adds a Linux host disk cleanup step to all Linux CI jobs to reclaim disk space by removing unused pre-installed software.

Why

Linux CI agents accumulate ~20–30 GB of pre-installed software (Cargo, Rust, Swift, Edge, GHC, Mono, Android SDK, CodeQL, snapd) that is not needed for builds. This cleanup step runs at the start of each Linux job to ensure sufficient disk space.

Details

  • Adds a reusable AzDO template (host-cleanup-linux.yml) with inline cleanup script
  • Cleanup is conditional on Linux (condition: eq(variables['Agent.OS'], 'Linux'))
  • Uses sudo -n (non-interactive) probe to work safely in both host and container environments
  • All removals are best-effort (|| true) with timeout guards on snap/apt-get commands
  • Uses DEBIAN_FRONTEND=noninteractive for apt-get to prevent dpkg prompts

Part of org-wide CI disk cleanup initiative.
Related to https://github.com/unoplatform/uno.rider/pull/480

Copilot AI review requested due to automatic review settings March 29, 2026 17:49
@github-actions github-actions bot added the area/build Categorizes an issue or PR as relevant to build infrastructure label Mar 29, 2026
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 updates the Linux CI host cleanup template and rolls it out to additional Linux-based Azure Pipelines jobs to proactively reclaim disk space on Microsoft-hosted agents and reduce “disk full” build/test failures.

Changes:

  • Updated build/ci/templates/host-cleanup-linux.yml to a more aggressive/canonical cleanup routine, including before/after df -h / reporting and additional removable toolchain paths.
  • Added the Linux host cleanup template to multiple Linux CI jobs (Setup stage jobs and several Skia/Android/WASM test/build jobs) that previously didn’t run it.

Reviewed changes

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

Show a summary per file
File Description
build/ci/templates/host-cleanup-linux.yml Expands cleanup actions (more paths, safer snap/apt commands) and adds disk usage reporting.
build/ci/.azure-devops-stages.yml Runs Linux host cleanup early in the Setup stage jobs on Linux agents.
build/ci/tests/.azure-devops-tests-webassembly-skia.yml Adds host cleanup before WASM runtime test setup/download steps.
build/ci/tests/.azure-devops-tests-webassembly-skia-build.yml Adds host cleanup before WASM build prerequisites.
build/ci/tests/.azure-devops-tests-linux-skia.yml Adds host cleanup to Linux Skia screenshot/runtime test jobs.
build/ci/tests/.azure-devops-tests-android-skia.yml Adds host cleanup before Android Skia runtime test setup (KVM/emulator flow).
build/ci/tests/.azure-devops-tests-android-skia-build.yml Adds host cleanup before Android Skia build prerequisites.
build/ci/tests/.azure-devops-tests-android-nativeaot-skia.yml Adds host cleanup before Android NativeAOT runtime test setup.
build/ci/tests/.azure-devops-tests-android-nativeaot-skia-build.yml Adds host cleanup before Android NativeAOT build prerequisites.
build/ci/tests/.azure-devops-tests-android-coreclr-skia.yml Adds host cleanup before Android CoreCLR runtime test setup.
build/ci/tests/.azure-devops-tests-android-coreclr-skia-build.yml Adds host cleanup before Android CoreCLR build prerequisites.
build/ci/tests/.azure-devops-tests-android-native.yml Adds host cleanup before Android native UI test setup.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@unodevops
Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-22917/wasm-skia-net9/index.html

- Use conditional sudo for container compatibility
- Use apt-get purge instead of apt remove
- Use rm -rf consistently
- Add || true on all sudo lines for best-effort cleanup
@agneszitte agneszitte changed the title ci: add Linux host disk cleanup for CI builds fix(ci): add Linux host disk cleanup for CI builds Mar 29, 2026
@agneszitte agneszitte requested a review from Copilot March 29, 2026 18:52
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

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@unodevops
Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-22917/wasm-skia-net9/index.html

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

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@unodevops
Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-22917/wasm-skia-net9/index.html

Copy link
Copy Markdown
Contributor

@ajpinedam ajpinedam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. The comment about the timeout seems valid.

Copy link
Copy Markdown
Contributor

@kazo0 kazo0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/build Categorizes an issue or PR as relevant to build infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants