Skip to content

Commit

Permalink
Merge pull request #1363 from microsoft/master
Browse files Browse the repository at this point in the history
Update VMs for Patch Tuesday May 2023 (microsoft#31358)
  • Loading branch information
Jimmy-Hu authored May 14, 2023
2 parents 6c22d50 + 7f52dea commit 31876ed
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 30 deletions.
2 changes: 1 addition & 1 deletion scripts/azure-pipelines/android/create-image.ps1
Original file line number Diff line number Diff line change
@@ -1 +1 @@
../linux/create-image.ps1 -Prefix "And-" -ProvisionScript (Get-ChildItem .\provision-image.sh).fullname
& "$PSScriptRoot/../linux/create-image.ps1" -Prefix "And-" -ProvisionScript "$PSScriptRoot/provision-image.sh"
2 changes: 1 addition & 1 deletion scripts/azure-pipelines/android/create-vmss.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ Param(
[parameter(Mandatory=$true)]
[string]$ImageName
)
../linux/create-vmss.ps1 -ImageName $ImageName -Prefix "PrAnd-"
& "$PSScriptRoot/../linux/create-vmss.ps1" -ImageName $ImageName -Prefix "PrAnd-" -AddAndroidContainerRegistryPermissions
17 changes: 0 additions & 17 deletions scripts/azure-pipelines/android/setup-managed-identity.ps1

This file was deleted.

6 changes: 3 additions & 3 deletions scripts/azure-pipelines/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# SPDX-License-Identifier: MIT
#
variables:
windows-pool: 'PrWin-2023-04-12'
linux-pool: 'PrLin-2023-04-12'
android-pool: 'PrAnd-2023-05-09'
linux-pool: 'PrLin-2023-05-09'
windows-pool: 'PrWin-2023-05-09'
osx-pool: 'PrOsx-2022-02-04'
android-pool: 'PrAnd-2023-04-17'
linux-docker-image: 'andcontainerregistry.azurecr.io/vcpkg-android:2023-04-20'

parameters:
Expand Down
20 changes: 17 additions & 3 deletions scripts/azure-pipelines/linux/create-vmss.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ Param(
[parameter(Mandatory=$true)]
[string]$ImageName,
[parameter(Mandatory=$false)]
[string]$Prefix = "PrLin-"
[string]$Prefix = "PrLin-",
[switch]$AddAndroidContainerRegistryPermissions
)

$Location = 'eastasia'
Expand Down Expand Up @@ -65,7 +66,8 @@ $Vmss = New-AzVmssConfig `
-UpgradePolicyMode Manual `
-EvictionPolicy Delete `
-Priority Spot `
-MaxPrice -1
-MaxPrice -1 `
-IdentityType SystemAssigned

$NicName = $ResourceGroupName + 'NIC'
New-AzNetworkInterface `
Expand Down Expand Up @@ -103,11 +105,23 @@ $Vmss = Set-AzVmssBootDiagnostic `
-VirtualMachineScaleSet $Vmss `
-Enabled $true

New-AzVmss `
$VmssCreated = New-AzVmss `
-ResourceGroupName $ResourceGroupName `
-Name $VmssName `
-VirtualMachineScaleSet $Vmss

if ($AddAndroidContainerRegistryPermissions) {
$spID = $VmssCreated.Identity.PrincipalId

$acrGroup = "And-Registry"
$acrName = "AndContainerRegistry"

$resourceID = (Get-AzContainerRegistry -ResourceGroupName $acrGroup -Name $acrName).Id

# needs admin privileges
New-AzRoleAssignment -ObjectId $spID -Scope $resourceID -RoleDefinitionName AcrPull
}

Write-Host "Location: $Location"
Write-Host "Resource group name: $ResourceGroupName"
Write-Host 'Finished!'
21 changes: 21 additions & 0 deletions scripts/azure-pipelines/patch-tuesday-checklist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## First time machine setup:
* [ ] Install Azure PowerShell: https://docs.microsoft.com/en-us/powershell/azure/install-az-ps

## Each Patch Tuesday:
* [ ] Check for depends:vm-update PRs and make relevant changes if possible.
* [ ] Check for Service 360 alerts about vulnerable software we are installing in the VMs and
update that. (Most often PowerShell needs to be updated to the current 7.2.x release)
* [ ] Run android/create-image.ps1
* [ ] Run linux/create-image.ps1
* [ ] Run windows/create-image.ps1
* [ ] Run android/create-vmss.ps1
* [ ] Run linux/create-vmss.ps1
* [ ] Run windows/create-vmss.ps1
* [ ] Create new pools for all 3 of these in Azure DevOps: https://dev.azure.com/vcpkg/public/_settings/agentqueues
* Android: 4 agents
* Linux: 4 agents
* Windows: 22 agents
* [ ] Update azure-pipelines.yml to point to the new pools.
* [ ] Submit PR with those changes.
* [ ] Submit a full CI rebuild with those changes: https://dev.azure.com/vcpkg/public/_build?definitionId=29
refs/pull/NUMBER/head
2 changes: 1 addition & 1 deletion scripts/azure-pipelines/windows/deploy-pwsh.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@

# REPLACE WITH UTILITY-PREFIX.ps1

$PwshUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.3.3/PowerShell-7.3.3-win-x64.msi'
$PwshUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.3.4/PowerShell-7.3.4-win-x64.msi'
InstallMSI -Url $PwshUrl -Name 'PowerShell Core'
8 changes: 4 additions & 4 deletions scripts/vcpkgTools.xml
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,11 @@
<archiveName>ninja-freebsd-1.8.2.zip</archiveName>
</tool>
<tool name="powershell-core" os="windows">
<version>7.2.8</version>
<version>7.2.11</version>
<exeRelativePath>pwsh.exe</exeRelativePath>
<url>https://github.com/PowerShell/PowerShell/releases/download/v7.2.8/PowerShell-7.2.8-win-x86.zip</url>
<sha512>b91ad901837099b34f689ae654b238a1171141adce8be6fc52f48373a7e79117072e84ab38e427c1ac66647dd86a19f1c6c6cba2b8e365d656c65c8447069c72</sha512>
<archiveName>PowerShell-7.2.8-win-x86.zip</archiveName>
<url>https://github.com/PowerShell/PowerShell/releases/download/v7.2.11/PowerShell-7.2.11-win-x86.zip</url>
<sha512>e9581122101ad161ad628a6feb63e61d3ef8f064a3f325465e8a1a4a6cfc1affbc9bf63146efae0aa65ff9ea5c93018af2c413dc0940f0d162edef805659ec84</sha512>
<archiveName>PowerShell-7.2.11-win-x86.zip</archiveName>
</tool>
<tool name="node" os="windows">
<version>16.15.1</version>
Expand Down

0 comments on commit 31876ed

Please sign in to comment.