|
| 1 | +parameters: |
| 2 | + DoARM64: false |
| 3 | + DoPGOARM64: false |
| 4 | + |
1 | 5 | jobs: |
2 | | -- job: Start_ARM64VM |
3 | | - displayName: 'Ensure ARM64 VM is running' |
4 | | - dependsOn: [] |
| 6 | +# Only include the job if we need the VM, which means ARM64 PGO. |
| 7 | +- ${{ if eq(parameters.DoPGOARM64, 'true') }}: |
| 8 | + - job: Start_ARM64VM |
| 9 | + displayName: 'Ensure ARM64 VM is running' |
| 10 | + dependsOn: [] |
| 11 | + |
| 12 | + steps: |
| 13 | + - task: AzureCLI@2 |
| 14 | + displayName: 'Start pythonarm64 and set auto-shutdown to (UTC now - 1h)' |
| 15 | + inputs: |
| 16 | + azureSubscription: "Steve's VM" # WIF service connection name |
| 17 | + scriptType: pscore |
| 18 | + scriptLocation: inlineScript |
| 19 | + inlineScript: | |
| 20 | + $ErrorActionPreference = 'Stop' |
| 21 | +
|
| 22 | + $rg = 'cpythonbuild' |
| 23 | + $vm = 'pythonarm64' |
| 24 | +
|
| 25 | + # Compute UTC time minus 1 hour, format HHmm (e.g. 1830) |
| 26 | + $shutdownTime = (Get-Date).ToUniversalTime().AddHours(-1).ToString('HHmm') |
| 27 | + Write-Host "Setting auto-shutdown time to: $shutdownTime UTC" |
| 28 | +
|
| 29 | + # Configure daily auto-shutdown in 23 hours |
| 30 | + az vm auto-shutdown -g $rg -n $vm --time $shutdownTime |
5 | 31 |
|
6 | | - steps: |
7 | | - - task: AzureCLI@2 |
8 | | - displayName: 'Start pythonarm64 and set auto-shutdown to (UTC now - 1h)' |
9 | | - inputs: |
10 | | - azureSubscription: "Steve's VM" # WIF service connection name |
11 | | - scriptType: pscore |
12 | | - scriptLocation: inlineScript |
13 | | - inlineScript: | |
14 | | - $ErrorActionPreference = 'Stop' |
15 | | - |
16 | | - $rg = 'cpythonbuild' |
17 | | - $vm = 'pythonarm64' |
18 | | - |
19 | | - # Compute UTC time minus 1 hour, format HHmm (e.g. 1830) |
20 | | - $shutdownTime = (Get-Date).ToUniversalTime().AddHours(-1).ToString('HHmm') |
21 | | - Write-Host "Setting auto-shutdown time (UTC HHmm) to: $shutdownTime" |
22 | | - |
23 | | - # Configure daily auto-shutdown in 23 hours |
24 | | - az vm auto-shutdown -g $rg -n $vm --time $shutdownTime |
25 | | - |
26 | | - # Start VM, but don't fail if it's already running |
27 | | - az vm start -g $rg -n $vm |
| 32 | + # Start VM, but don't fail if it's already running |
| 33 | + az vm start -g $rg -n $vm |
0 commit comments