Skip to content

Commit d233132

Browse files
committed
Fix template
1 parent ec9ce24 commit d233132

File tree

2 files changed

+34
-26
lines changed

2 files changed

+34
-26
lines changed

windows-release/azure-pipelines.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,9 @@ stages:
164164
vmImage: ${{ parameters.vmImage }}
165165
jobs:
166166
- template: start-arm64vm.yml
167-
- ${{ if eq(parameters.DoPGOARM64, 'true') }}:
167+
parameters:
168+
DoARM64: ${{ parameters.DoARM64 }}
169+
DoPGOARM64: ${{ parameters.DoPGOARM64 }}
168170
- template: stage-build.yml
169171
parameters:
170172
DoFreethreaded: ${{ parameters.DoFreethreaded }}

windows-release/start-arm64vm.yml

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,33 @@
1+
parameters:
2+
DoARM64: false
3+
DoPGOARM64: false
4+
15
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
531
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

Comments
 (0)