Skip to content

Commit c26faba

Browse files
committed
Only 12 hours, and better messages
1 parent d233132 commit c26faba

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

windows-release/start-arm64vm.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ jobs:
1010
dependsOn: []
1111

1212
steps:
13+
- checkout: none
14+
1315
- task: AzureCLI@2
1416
displayName: 'Start pythonarm64 and set auto-shutdown to (UTC now - 1h)'
1517
inputs:
@@ -22,12 +24,23 @@ jobs:
2224
$rg = 'cpythonbuild'
2325
$vm = 'pythonarm64'
2426
25-
# Compute UTC time minus 1 hour, format HHmm (e.g. 1830)
26-
$shutdownTime = (Get-Date).ToUniversalTime().AddHours(-1).ToString('HHmm')
27+
# Compute UTC time minus 12 hours, format HHmm (e.g. 1830)
28+
$shutdownTime = (Get-Date).ToUniversalTime().AddHours(-12).ToString('HHmm')
2729
Write-Host "Setting auto-shutdown time to: $shutdownTime UTC"
2830
29-
# Configure daily auto-shutdown in 23 hours
30-
az vm auto-shutdown -g $rg -n $vm --time $shutdownTime
31+
# Configure daily auto-shutdown in 12 hours
32+
az vm auto-shutdown -g $rg -n $vm --time $shutdownTime | Out-Null
33+
if ($?) {
34+
Write-Host "Successfully configured auto-shutdown for ARM64 VM in 12 hours."
35+
} else {
36+
Write-Host "##[warning]Failed to configure ARM64 VM auto-shutdown."
37+
}
3138
3239
# Start VM, but don't fail if it's already running
33-
az vm start -g $rg -n $vm
40+
az vm start -g $rg -n $vm | Out-Null
41+
$u = "https://dev.azure.com/Python/cpython/_settings/agentqueues?queueId=24&view=agents"
42+
if ($?) {
43+
Write-Host "Successfully started ARM64 VM. Check $u for running status."
44+
} else {
45+
Write-Host "##[warning]Failed to start ARM64 VM. Check $u in case it is already active, or ping Steve."
46+
}

0 commit comments

Comments
 (0)