Skip to content

Commit

Permalink
chore: log file sizes that are cached on the windows VHD (#5884)
Browse files Browse the repository at this point in the history
  • Loading branch information
timmy-wright authored Feb 20, 2025
1 parent 4e8f485 commit 93d49e8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,6 @@ stages:
-e SIG_GALLERY_NAME=${SIG_GALLERY_NAME} \
-e OS_TYPE="Windows" \
${AZURE_CONTAINER_IMAGE} make -f packer.mk backfill-cleanup
enabled: false
enabled: true
displayName: Backfill Clean Up Older Resources
condition: eq(variables.ENABLE_BACKFILL_CLEANUP, 'True')
21 changes: 21 additions & 0 deletions vhdbuilder/packer/windows/configure-windows-vhd.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,25 @@ function Get-FilesToCacheOnVHD
Download-File -URL $URL -Dest $dest
}
}


foreach ($dir in $map.Keys)
{
LogFilesInDirectory "$dir"
}
}

function LogFilesInDirectory
{
Param(
[string]
$Directory
)

Get-ChildItem -Path "$Directory" | ForEach-Object {
$sizeKB = [math]::Round($_.Length / 1KB, 2)
Write-Output "$( $_.Name ) - $sizeKB KB"
}
}

function Get-ToolsToVHD
Expand All @@ -345,6 +364,8 @@ function Get-ToolsToVHD
Download-File -URL "https://download.sysinternals.com/files/DU.zip" -Dest "$global:aksToolsDir\DU.zip"
Expand-Archive -Path "$global:aksToolsDir\DU.zip" -DestinationPath "$global:aksToolsDir\DU" -Force
Remove-Item -Path "$global:aksToolsDir\DU.zip" -Force

LogFilesInDirectory "$global:aksToolsDir\DU"
}

function Register-ExpandVolumeTask
Expand Down

0 comments on commit 93d49e8

Please sign in to comment.