Skip to content

Commit

Permalink
Log more information about disk space and skip the MSVC builds on pub…
Browse files Browse the repository at this point in the history
…lic (#3090)

* Try and get more information as to disk space
* Only build MSVC on the internal build

The MSVC compiler is so heavy that the outputs are over 10.8GB
whereas the LLVM compiler is just under 10.1GB.

The public agent only starts with 12GB and after the checkout we are
left with 10.67GB which is smaller than the 10.8GB required. The LLVM
compiler just manages to pass under the bar with about 600MB spare.

If the SkiaSharp artifacts get any bigger, then we will need custom
machines for the public build.
  • Loading branch information
mattleibow authored Dec 2, 2024
1 parent 6a2982a commit 9d7e8b0
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 45 deletions.
32 changes: 32 additions & 0 deletions scripts/azure-templates-bootstrapper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,19 @@ jobs:
targetPath: ${{ additionalArtifact.path }}

steps:
- pwsh: if ($IsLinux -or $IsMacOS) { df -h } else { Get-Volume }
displayName: Get the volume information before the run
condition: always()

# prepare
- checkout: self
submodules: recursive
- template: /scripts/azure-templates-variables.yml@self

- pwsh: .\scripts\get-free-space.ps1
displayName: Get the volume information after the checkout
condition: always()

# # checkout required skia PR
# - pwsh: .\scripts\checkout-skia.ps1 -GitHubToken $(GitHub.Token.PublicAccess)
# displayName: Checkout required skia PR
Expand All @@ -101,6 +109,10 @@ jobs:
- pwsh: .\scripts\get-build-type.ps1 -ExternalsBuildId '${{ parameters.buildExternals }}'
displayName: Determine build type

- pwsh: .\scripts\get-free-space.ps1
displayName: Get the volume information before the provisioning
condition: always()

# provisioning steps
- ${{ if ne(parameters.buildAgent.provisioningSteps, '') }}:
- ${{ parameters.buildAgent.provisioningSteps }}
Expand Down Expand Up @@ -273,6 +285,10 @@ jobs:
retryCountOnTaskFailure: 3
condition: and(succeeded(), eq(variables['DOWNLOAD_EXTERNALS'], ''))

- pwsh: .\scripts\get-free-space.ps1
displayName: Get the volume information before downloading artifacts
condition: always()

# download artifacts
- template: /scripts/azure-templates-download-artifacts.yml@self
parameters:
Expand All @@ -285,12 +301,20 @@ jobs:
artifacts:
- name: ${{ parameters.name }}

- pwsh: .\scripts\get-free-space.ps1
displayName: Get the volume information after downloading artifacts
condition: always()

# pre-build steps
- ${{ if ne(parameters.buildAgent.preBuildSteps, '') }}:
- ${{ parameters.buildAgent.preBuildSteps }}
- ${{ if ne(length(parameters.preBuildSteps), 0) }}:
- ${{ parameters.preBuildSteps }}

- pwsh: .\scripts\get-free-space.ps1
displayName: Get the volume information before the build
condition: always()

# actual build
- ${{ if ne(parameters.skipSteps, 'true') }}:
- ${{ if eq(parameters.docker, '') }}:
Expand Down Expand Up @@ -359,8 +383,16 @@ jobs:
retryCountOnTaskFailure: ${{ parameters.retryCount }}
condition: and(succeeded(), eq(variables['DOWNLOAD_EXTERNALS'], ''))
- pwsh: .\scripts\get-free-space.ps1
displayName: Get the volume information after the build
condition: always()

# post-build steps
- ${{ parameters.postBuildSteps }}

- ${{ if eq(parameters.buildPipelineType, 'tests') }}:
- template: /scripts/azure-templates-github-status.yml@self

- pwsh: .\scripts\get-free-space.ps1
displayName: Get the volume information after the entire run
condition: always()
90 changes: 46 additions & 44 deletions scripts/azure-templates-stages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,39 +145,40 @@ stages:
buildAgent: ${{ parameters.buildAgentWindowsNative }}
target: externals-windows
additionalArgs: --buildarch=arm64
- template: /scripts/azure-templates-bootstrapper.yml@self # Build Native Win32|x86 (Win + MSVC)
parameters:
name: native_win32_x86_msvc_windows
displayName: Win32 x86 [MSVC]
sdl: ${{ parameters.sdl }}
buildExternals: ${{ parameters.buildExternals }}
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentWindowsNative }}
target: externals-windows
additionalArgs: --buildarch=x86 --llvm="msvc"
installLlvm: false
- template: /scripts/azure-templates-bootstrapper.yml@self # Build Native Win32|x64 (Win + MSVC)
parameters:
name: native_win32_x64_msvc_windows
displayName: Win32 x64 [MSVC]
sdl: ${{ parameters.sdl }}
buildExternals: ${{ parameters.buildExternals }}
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentWindowsNative }}
target: externals-windows
additionalArgs: --buildarch=x64 --llvm="msvc"
installLlvm: false
- template: /scripts/azure-templates-bootstrapper.yml@self # Build Native Win32|arm64 (Win + MSVC)
parameters:
name: native_win32_arm64_msvc_windows
displayName: Win32 arm64 [MSVC]
sdl: ${{ parameters.sdl }}
buildExternals: ${{ parameters.buildExternals }}
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentWindowsNative }}
target: externals-windows
additionalArgs: --buildarch=arm64 --llvm="msvc"
installLlvm: false
- ${{ if eq(variables['System.TeamProject'], 'devdiv') }}:
- template: /scripts/azure-templates-bootstrapper.yml@self # Build Native Win32|x86 (Win + MSVC)
parameters:
name: native_win32_x86_msvc_windows
displayName: Win32 x86 [MSVC]
sdl: ${{ parameters.sdl }}
buildExternals: ${{ parameters.buildExternals }}
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentWindowsNative }}
target: externals-windows
additionalArgs: --buildarch=x86 --llvm="msvc"
installLlvm: false
- template: /scripts/azure-templates-bootstrapper.yml@self # Build Native Win32|x64 (Win + MSVC)
parameters:
name: native_win32_x64_msvc_windows
displayName: Win32 x64 [MSVC]
sdl: ${{ parameters.sdl }}
buildExternals: ${{ parameters.buildExternals }}
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentWindowsNative }}
target: externals-windows
additionalArgs: --buildarch=x64 --llvm="msvc"
installLlvm: false
- template: /scripts/azure-templates-bootstrapper.yml@self # Build Native Win32|arm64 (Win + MSVC)
parameters:
name: native_win32_arm64_msvc_windows
displayName: Win32 arm64 [MSVC]
sdl: ${{ parameters.sdl }}
buildExternals: ${{ parameters.buildExternals }}
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentWindowsNative }}
target: externals-windows
additionalArgs: --buildarch=arm64 --llvm="msvc"
installLlvm: false
- template: /scripts/azure-templates-bootstrapper.yml@self # Build Native WinUI|x86 (Win)
parameters:
name: native_winui_x86_windows
Expand Down Expand Up @@ -527,17 +528,18 @@ stages:
matrixArtifacts:
- name: native_wasm
jobs: $(nativeWasmJobs)
- template: /scripts/azure-templates-merger.yml@self # Merge Native MSVC Artifacts
parameters:
name: native_msvc
displayName: Merge Native MSVC Artifacts
sdl: ${{ parameters.sdl }}
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentHost }}
requiredArtifacts:
- name: native_win32_x86_msvc_windows
- name: native_win32_x64_msvc_windows
- name: native_win32_arm64_msvc_windows
- ${{ if eq(variables['System.TeamProject'], 'devdiv') }}:
- template: /scripts/azure-templates-merger.yml@self # Merge Native MSVC Artifacts
parameters:
name: native_msvc
displayName: Merge Native MSVC Artifacts
sdl: ${{ parameters.sdl }}
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentHost }}
requiredArtifacts:
- name: native_win32_x86_msvc_windows
- name: native_win32_x64_msvc_windows
- name: native_win32_arm64_msvc_windows

- ${{ if ne(parameters.buildPipelineType, 'build') }}:
- stage: managed
Expand Down
2 changes: 1 addition & 1 deletion scripts/get-free-space.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$ErrorActionPreference = 'Stop'

if ($IsLinux -or $IsMacOS) {
Write-Host "Not supported yet."
df -h
} else {
Get-Volume
}

0 comments on commit 9d7e8b0

Please sign in to comment.