Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
ce48d2a
Rename to tools/scripts, comment what move_only_function_specializati…
StephanTLavavej Jan 20, 2022
8f46da6
Add tools/scripts/print_failures.py.
StephanTLavavej Jan 21, 2022
67639a9
Remove workaround for VSO-1460046.
StephanTLavavej Jan 20, 2022
17f3692
Remove compiler workaround in `subrange`.
StephanTLavavej Jan 20, 2022
c8cd10b
Remove VSO-1433873 workaround.
StephanTLavavej Jan 20, 2022
f1d7ab6
Fix C4365 sign conversion warnings in format's use of fill_n.
StephanTLavavej Jan 21, 2022
02212b1
Perma-workaround VSO-1464637 C4365 sign conversion warnings in format.
StephanTLavavej Jan 21, 2022
c0c93be
ranges::transform() can directly take string_view.
StephanTLavavej Jan 21, 2022
5b55161
Allow QUIC, renumber priorities.
StephanTLavavej Jan 21, 2022
89a3cb4
Add 'Microsoft.VisualStudio.Component.VC.Tools.ARM64EC'.
StephanTLavavej Jan 21, 2022
b8c1a89
Python 3.10.2.
StephanTLavavej Jan 21, 2022
36dc274
Also set the Azure CLI subscription.
StephanTLavavej Jan 21, 2022
50ee108
Use member enumeration and the `-in` containment operator.
StephanTLavavej Jan 22, 2022
e9fb2db
Add 'THHmm' to VMSS names.
StephanTLavavej Jan 23, 2022
3e58ff3
Fix VMSS diagnostics. (Need to update wiki.)
StephanTLavavej Jan 24, 2022
15f8d0e
Use Out-Null.
StephanTLavavej Jan 25, 2022
fbdf59b
Use 2022-datacenter-g2. (Need to update wiki.)
StephanTLavavej Jan 25, 2022
bce8764
New pool: VS 2022 17.1 Preview 4, ARM64EC, Server.
StephanTLavavej Jan 25, 2022
bdb6c2b
Mention VS 2022 17.1 Preview 4 in README.md.
StephanTLavavej Jan 22, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ Just try to follow these rules, so we can spend more time fixing bugs and implem

# How To Build With The Visual Studio IDE

1. Install Visual Studio 2022 17.1 Preview 2 or later.
1. Install Visual Studio 2022 17.1 Preview 4 or later.
* We recommend selecting "C++ CMake tools for Windows" in the VS Installer.
This will ensure that you're using supported versions of CMake and Ninja.
* Otherwise, install [CMake][] 3.21 or later, and [Ninja][] 1.10.2 or later.
Expand All @@ -155,7 +155,7 @@ Just try to follow these rules, so we can spend more time fixing bugs and implem

# How To Build With A Native Tools Command Prompt

1. Install Visual Studio 2022 17.1 Preview 2 or later.
1. Install Visual Studio 2022 17.1 Preview 4 or later.
* We recommend selecting "C++ CMake tools for Windows" in the VS Installer.
This will ensure that you're using supported versions of CMake and Ninja.
* Otherwise, install [CMake][] 3.21 or later, and [Ninja][] 1.10.2 or later.
Expand Down
113 changes: 61 additions & 52 deletions azure-devops/create-vmss.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,45 +21,18 @@ $ErrorActionPreference = 'Stop'
$Env:SuppressAzurePowerShellBreakingChangeWarnings = 'true'

$Location = 'westus2'
$Prefix = 'StlBuild-' + (Get-Date -Format 'yyyy-MM-dd')
$Prefix = 'StlBuild-' + (Get-Date -Format 'yyyy-MM-dd-THHmm')
$VMSize = 'Standard_D32ads_v5'
$ProtoVMName = 'PROTOTYPE'
$LiveVMPrefix = 'BUILD'
$ImagePublisher = 'MicrosoftWindowsDesktop'
$ImageOffer = 'windows-11'
$ImageSku = 'win11-21h2-ent'
$ImagePublisher = 'MicrosoftWindowsServer'
$ImageOffer = 'WindowsServer'
$ImageSku = '2022-datacenter-g2'

$ProgressActivity = 'Creating Scale Set'
$TotalProgress = 14
$CurrentProgress = 1

<#
.SYNOPSIS
Returns whether there's a name collision in the resource group.

.DESCRIPTION
Find-ResourceGroupNameCollision takes a list of resources, and checks if $Test
collides names with any of the resources.

.PARAMETER Test
The name to test.

.PARAMETER Resources
The list of resources.
#>
function Find-ResourceGroupNameCollision {
[CmdletBinding()]
Param([string]$Test, $Resources)

foreach ($resource in $Resources) {
if ($resource.ResourceGroupName -eq $Test) {
return $true
}
}

return $false
}

<#
.SYNOPSIS
Attempts to find a name that does not collide with any resources in the resource group.
Expand All @@ -76,10 +49,10 @@ function Find-ResourceGroupName {
[CmdletBinding()]
Param([string] $Prefix)

$resources = Get-AzResourceGroup
$existingNames = (Get-AzResourceGroup).ResourceGroupName
$result = $Prefix
$suffix = 0
while (Find-ResourceGroupNameCollision -Test $result -Resources $resources) {
while ($result -in $existingNames) {
$suffix++
$result = "$Prefix-$suffix"
}
Expand Down Expand Up @@ -170,7 +143,8 @@ Write-Progress `
-Status 'Setting the subscription context' `
-PercentComplete (100 / $TotalProgress * $CurrentProgress++)

$IgnoredAzureContext = Set-AzContext -SubscriptionName CPP_STL_GitHub
Set-AzContext -SubscriptionName CPP_STL_GitHub | Out-Null
az account set --subscription CPP_STL_GitHub

####################################################################################################
Write-Progress `
Expand All @@ -180,7 +154,7 @@ Write-Progress `

$ResourceGroupName = Find-ResourceGroupName $Prefix
$AdminPW = New-Password
$IgnoredResourceGroup = New-AzResourceGroup -Name $ResourceGroupName -Location $Location
New-AzResourceGroup -Name $ResourceGroupName -Location $Location | Out-Null
$AdminPWSecure = ConvertTo-SecureString $AdminPW -AsPlainText -Force
$Credential = New-Object System.Management.Automation.PSCredential ('AdminUser', $AdminPWSecure)

Expand All @@ -196,19 +170,31 @@ $allowHttp = New-AzNetworkSecurityRuleConfig `
-Access Allow `
-Protocol Tcp `
-Direction Outbound `
-Priority 1008 `
-Priority 1000 `
-SourceAddressPrefix * `
-SourcePortRange * `
-DestinationAddressPrefix * `
-DestinationPortRange @(80, 443)

$allowQuic = New-AzNetworkSecurityRuleConfig `
-Name AllowQUIC `
-Description 'Allow QUIC' `
-Access Allow `
-Protocol Udp `
-Direction Outbound `
-Priority 1010 `
-SourceAddressPrefix * `
-SourcePortRange * `
-DestinationAddressPrefix * `
-DestinationPortRange 443

$allowDns = New-AzNetworkSecurityRuleConfig `
-Name AllowDNS `
-Description 'Allow DNS' `
-Access Allow `
-Protocol * `
-Direction Outbound `
-Priority 1009 `
-Priority 1020 `
-SourceAddressPrefix * `
-SourcePortRange * `
-DestinationAddressPrefix * `
Expand All @@ -220,7 +206,7 @@ $denyEverythingElse = New-AzNetworkSecurityRuleConfig `
-Access Deny `
-Protocol * `
-Direction Outbound `
-Priority 1010 `
-Priority 2000 `
-SourceAddressPrefix * `
-SourcePortRange * `
-DestinationAddressPrefix * `
Expand All @@ -231,7 +217,7 @@ $NetworkSecurityGroup = New-AzNetworkSecurityGroup `
-Name $NetworkSecurityGroupName `
-ResourceGroupName $ResourceGroupName `
-Location $Location `
-SecurityRules @($allowHttp, $allowDns, $denyEverythingElse)
-SecurityRules @($allowHttp, $allowQuic, $allowDns, $denyEverythingElse)

$SubnetName = $ResourceGroupName + '-Subnet'
$Subnet = New-AzVirtualNetworkSubnetConfig `
Expand Down Expand Up @@ -277,10 +263,10 @@ $VM = Set-AzVMSourceImage `
-Version latest

$VM = Set-AzVMBootDiagnostic -VM $VM -Disable
$IgnoredAzureOperationResponse = New-AzVm `
New-AzVm `
-ResourceGroupName $ResourceGroupName `
-Location $Location `
-VM $VM
-VM $VM | Out-Null

####################################################################################################
Write-Progress `
Expand All @@ -303,7 +289,7 @@ Write-Progress `
-Status 'Restarting VM' `
-PercentComplete (100 / $TotalProgress * $CurrentProgress++)

$IgnoredComputeLongRunningOperation = Restart-AzVM -ResourceGroupName $ResourceGroupName -Name $ProtoVMName
Restart-AzVM -ResourceGroupName $ResourceGroupName -Name $ProtoVMName | Out-Null

####################################################################################################
Write-Progress `
Expand All @@ -321,11 +307,11 @@ Write-Progress `
-Status 'Running provisioning script sysprep.ps1 in VM' `
-PercentComplete (100 / $TotalProgress * $CurrentProgress++)

$IgnoredRunCommandResult = Invoke-AzVMRunCommand `
Invoke-AzVMRunCommand `
-ResourceGroupName $ResourceGroupName `
-VMName $ProtoVMName `
-CommandId 'RunPowerShellScript' `
-ScriptPath "$PSScriptRoot\sysprep.ps1"
-ScriptPath "$PSScriptRoot\sysprep.ps1" | Out-Null

####################################################################################################
Write-Progress `
Expand All @@ -341,15 +327,15 @@ Write-Progress `
-Status 'Converting VM to Image' `
-PercentComplete (100 / $TotalProgress * $CurrentProgress++)

$IgnoredComputeLongRunningOperation = Stop-AzVM `
Stop-AzVM `
-ResourceGroupName $ResourceGroupName `
-Name $ProtoVMName `
-Force
-Force | Out-Null

$IgnoredComputeLongRunningOperation = Set-AzVM `
Set-AzVM `
-ResourceGroupName $ResourceGroupName `
-Name $ProtoVMName `
-Generalized
-Generalized | Out-Null

$VM = Get-AzVM -ResourceGroupName $ResourceGroupName -Name $ProtoVMName
$PrototypeOSDiskName = $VM.StorageProfile.OsDisk.Name
Expand All @@ -362,11 +348,11 @@ Write-Progress `
-Status 'Deleting unused VM and disk' `
-PercentComplete (100 / $TotalProgress * $CurrentProgress++)

$IgnoredComputeLongRunningOperation = Remove-AzVM -Id $VM.ID -Force
$IgnoredOperationStatusResponse = Remove-AzDisk `
Remove-AzVM -Id $VM.ID -Force | Out-Null
Remove-AzDisk `
-ResourceGroupName $ResourceGroupName `
-DiskName $PrototypeOSDiskName `
-Force
-Force | Out-Null

####################################################################################################
Write-Progress `
Expand Down Expand Up @@ -420,11 +406,34 @@ Write-Progress `
-Status 'Enabling VMSS diagnostic logs' `
-PercentComplete (100 / $TotalProgress * $CurrentProgress++)

$StorageAccountName = 'stlvmssdiaglogssa'

$ExpirationDate = (Get-Date -AsUTC).AddYears(1).ToString('yyyy-MM-ddTHH:mmZ')

$StorageAccountSASToken = $(az storage account generate-sas `
--account-name $StorageAccountName `
--expiry $ExpirationDate `
--permissions acuw `
--resource-types co `
--services bt `
--https-only `
--output tsv `
2> $null)

$DiagnosticsDefaultConfig = $(az vmss diagnostics get-default-config --is-windows-os 2> $null). `
Replace('__DIAGNOSTIC_STORAGE_ACCOUNT__', $StorageAccountName). `
Replace('__VM_OR_VMSS_RESOURCE_ID__', $Vmss.Id)

Out-File -FilePath "$PSScriptRoot\vmss-config.json" -InputObject $DiagnosticsDefaultConfig

$DiagnosticsProtectedSettings = "{'storageAccountName': '$StorageAccountName', "
$DiagnosticsProtectedSettings += "'storageAccountSasToken': '?$StorageAccountSASToken'}"

az vmss diagnostics set `
--resource-group $ResourceGroupName `
--vmss-name $VmssName `
--settings "$PSScriptRoot\vmss-config.json" `
--protected-settings "$PSScriptRoot\vmss-protected.json" `
--protected-settings "$DiagnosticsProtectedSettings" `
--output none

####################################################################################################
Expand Down
3 changes: 2 additions & 1 deletion azure-devops/provision-image.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ $Workloads = @(
'Microsoft.VisualStudio.Component.VC.Runtimes.x86.x64.Spectre',
'Microsoft.VisualStudio.Component.VC.Tools.ARM',
'Microsoft.VisualStudio.Component.VC.Tools.ARM64',
'Microsoft.VisualStudio.Component.VC.Tools.ARM64EC',
'Microsoft.VisualStudio.Component.VC.Tools.x86.x64',
# TRANSITION, LLVM-51128 (Clang 12 targeting ARM64 is incompatible with WinSDK 10.0.20348.0)
'Microsoft.VisualStudio.Component.Windows10SDK.19041'
Expand All @@ -141,7 +142,7 @@ $Workloads = @(
$ReleaseInPath = 'Preview'
$Sku = 'Enterprise'
$VisualStudioBootstrapperUrl = 'https://aka.ms/vs/17/pre/vs_enterprise.exe'
$PythonUrl = 'https://www.python.org/ftp/python/3.10.1/python-3.10.1-amd64.exe'
$PythonUrl = 'https://www.python.org/ftp/python/3.10.2/python-3.10.2-amd64.exe'

$CudaUrl = `
'https://developer.download.nvidia.com/compute/cuda/10.1/Prod/local_installers/cuda_10.1.243_426.00_win10.exe'
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ variables:
tmpDir: 'D:\Temp'
buildOutputLocation: 'D:\build'

pool: 'StlBuild-2022-01-13-2'
pool: 'StlBuild-2022-01-25-T1318'

stages:
- stage: Code_Format
Expand Down
Loading