chore: add disk space cleanup steps to CI pipeline (Phase 3)#8279
Open
vhvb1989 wants to merge 3 commits into
Open
chore: add disk space cleanup steps to CI pipeline (Phase 3)#8279vhvb1989 wants to merge 3 commits into
vhvb1989 wants to merge 3 commits into
Conversation
Add a reusable cleanup-disk-space.yml step template and insert it at strategic points in the Linux CI jobs to address 71 'Free disk space on / is lower than 5%' warnings. Cleanup points in build-cli.yml: - After test run: clean Go cache, NuGet, and .NET temp artifacts - After release build: clean Go build cache - After Linux package build: clean Docker images/containers Cleanup points in cross-build-cli.yml: - After Linux ARM64 package build: clean Docker and Go cache All cleanup steps are Linux-only, use continueOnError to avoid breaking builds, and log disk usage before/after for observability. Resolves #7783 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a reusable Azure Pipelines step template to reclaim disk space on Linux build agents and wires it into the CLI build job templates to reduce “Free disk space on / is lower than 5%” warnings.
Changes:
- Added a reusable
cleanup-disk-space.ymlstep template with parameterized cleanup targets (Docker, Go cache, NuGet, .NET temp) and before/after disk usage logging. - Inserted cleanup steps into
build-cli.ymlat multiple points in the job to reduce transient disk pressure. - Inserted cleanup steps into
cross-build-cli.ymlafter Linux ARM64 package build.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| eng/pipelines/templates/steps/cleanup-disk-space.yml | New reusable cleanup template (Linux-only) for reclaiming disk space via targeted cache/prune steps. |
| eng/pipelines/templates/jobs/build-cli.yml | Adds multiple invocations of the cleanup template during the BuildCLI job. |
| eng/pipelines/templates/jobs/cross-build-cli.yml | Adds a cleanup invocation after the Linux ARM64 package build. |
- Remove CleanGoCache from post-test cleanup to preserve cache for release build - Add BuildLinuxPackages condition to Docker cleanup in build-cli.yml - Add BuildLinuxPackages condition to Docker+Go cleanup in cross-build-cli.yml Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Remove redundant 2>/dev/null || true from cleanup commands; rely on continueOnError - Update PR description to reflect post-test cleanup no longer includes Go cache Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
Author
|
/azp run azure-dev - cli |
|
Azure Pipelines could not run because the pipeline triggers exclude this branch/path. |
📋 Prioritization NoteThanks for the contribution! The linked issue isn't in the current milestone yet. |
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.
Summary
Add disk space cleanup steps to the CI pipeline to eliminate 71 "Free disk space on / is lower than 5%" warnings on Linux agents (~62% of all pipeline warnings).
Changes
New file
eng/pipelines/templates/steps/cleanup-disk-space.yml— Reusable cleanup step template with parameterized targets (Docker, Go cache, NuGet, .NET temp). All steps are Linux-only, usecontinueOnError: true, and logdf -h /before/after for observability.Modified files
eng/pipelines/templates/jobs/build-cli.yml— 3 cleanup insertions:BuildLinuxPackages)eng/pipelines/templates/jobs/cross-build-cli.yml— 1 cleanup insertion:BuildLinuxPackages)Design Decisions
continueOnError: true— cleanup failures never break the buildeq(variables['Agent.OS'], 'Linux')since warnings only affect Linux agents${{ if }}blocks ensure only requested cleanup operations are emitted in each invocationRelated Issues
Closes #7783
Parent: #4668
Full analysis: Azure/azure-dev-pr#1780