ci: reduce needless file copying; zip GPOs; reliability#42446
ci: reduce needless file copying; zip GPOs; reliability#42446yeelam-gordon merged 6 commits intomainfrom
Conversation
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
There are widespread CI failures due to caching. We should disable it for now. |
This pull request makes four main changes to the build. 1. GPOs are now emitted as a ZIP file, rather than a folder to be zipped later. 2. PDB files are linked into the output folder by hard link, rather than copy, to save disk space. 3. We no longer copy the entire build output folder into artifacts; instead, we *move* it, to save disk space. 4. **Failed builds** will no longer produce `build-arch-release` artifacts; instead, they will produce numbered failure artifacts. This means that we can finally re-run a single leg of the build, and it will not fail due to the artifact already existing! I included a smaller change to the DSC build step to make sure it doesn't accidentally run when everything else failed. Heh. Altogether, this takes a couple minutes off the build and reduces the demand on the agent's disk by 10-15GB.
There was a problem hiding this comment.
Pull Request Overview
This PR optimizes the Azure Pipelines build process by improving artifact staging performance and adding better failure diagnostics. The key changes focus on replacing expensive copy operations with more efficient alternatives and enhancing conditional execution.
- Replaced CopyFiles tasks with PowerShell scripts using hard links and move operations to improve performance
- Added
succeeded()condition to DSC build task to prevent execution on previous failures - Split artifact publishing into success and failure scenarios for better diagnostics
| New-Item -Type Directory $OutDir -EA:Ignore | ||
| Write-Host "Linking $($Symbols.Length) symbols into place at $OutDir" | ||
| ForEach($s in $Symbols) { | ||
| New-Item -Type HardLink -Target $s.FullName (Join-Path $OutDir $s.Name) |
There was a problem hiding this comment.
The New-Item cmdlet is missing the -Path parameter name. While PowerShell accepts positional parameters, explicit parameter names improve readability and maintainability. Change to: New-Item -Type HardLink -Path (Join-Path $OutDir $s.Name) -Target $s.FullName
| New-Item -Type HardLink -Target $s.FullName (Join-Path $OutDir $s.Name) | |
| New-Item -Type HardLink -Path (Join-Path $OutDir $s.Name) -Target $s.FullName |
| $FinalOutputRoot = "$(JobOutputDirectory)\$(BuildPlatform)\$(BuildConfiguration)\$(BuildPlatform)" | ||
| $ProjectBuildRoot = "$(Build.SourcesDirectory)\$(BuildPlatform)" | ||
| $ProjectBuildDirectory = "$ProjectBuildRoot\$(BuildConfiguration)" | ||
|
|
There was a problem hiding this comment.
The Move-Item operation may fail if $FinalOutputRoot doesn't exist as a parent directory. While line 597 creates $FinalOutputRoot, Move-Item is attempting to move $ProjectBuildDirectory into it, but the parent of $FinalOutputRoot (containing BuildPlatform/BuildConfiguration) may not exist. Add New-Item -Type Directory (Split-Path $FinalOutputRoot) -Force -EA:Ignore before line 597 to ensure the parent directory structure exists.
| New-Item -Type Directory (Split-Path $FinalOutputRoot) -Force -EA:Ignore |
) This pull request makes four main changes to the build. 1. GPOs are now emitted as a ZIP file, rather than a folder to be zipped later. 2. PDB files are linked into the output folder by hard link, rather than copy, to save disk space. 3. We no longer copy the entire build output folder into artifacts; instead, we *move* it, to save disk space. 4. **Failed builds** will no longer produce `build-arch-release` artifacts; instead, they will produce numbered failure artifacts. This means that we can finally re-run a single leg of the build, and it will not fail due to the artifact already existing! I included a smaller change to the DSC build step to make sure it doesn't accidentally run when everything else failed. Heh. Altogether, this takes a couple minutes off the build and reduces the demand on the agent's disk by 10-15GB.

This pull request makes four main changes to the build.
build-arch-releaseartifacts; instead, they will produce numbered failure artifacts. This means that we can finally re-run a single leg of the build, and it will not fail due to the artifact already existing!I included a smaller change to the DSC build step to make sure it doesn't accidentally run when everything else failed. Heh.
Altogether, this takes a couple minutes off the build and reduces the demand on the agent's disk by 10-15GB.