Skip to content

Commit b4f869b

Browse files
authored
Switch agent queues used on Windows builds (#6627)
1 parent abfdb43 commit b4f869b

File tree

8 files changed

+55
-17
lines changed

8 files changed

+55
-17
lines changed

.azure/pipelines/jobs/default-build.yml

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727
# A map of custom variables
2828
# matrix: { string: { string: string } }
2929
# A map of matrix configurations and variables. https://docs.microsoft.com/en-us/vsts/pipelines/yaml-schema?view=vsts#matrix
30-
# demands: string | [ string ]
31-
# A list of agent demands. https://docs.microsoft.com/en-us/vsts/pipelines/yaml-schema?view=vsts#demands
3230
# dependsOn: string | [ string ]
3331
# For fan-out/fan-in. https://docs.microsoft.com/en-us/vsts/pipelines/yaml-schema?view=vsts#phase
3432
# codeSign: boolean
@@ -45,7 +43,6 @@ parameters:
4543
poolName: ''
4644
buildArgs: ''
4745
configuration: 'Release'
48-
demands: []
4946
beforeBuild: []
5047
afterBuild: []
5148
codeSign: false
@@ -71,6 +68,7 @@ jobs:
7168
maxParallel: 8
7269
matrix: ${{ parameters.matrix }}
7370
# Map friendly OS names to the right queue
71+
# See https://github.com/dotnet/arcade/blob/master/Documentation/ChoosingAMachinePool.md
7472
pool:
7573
${{ if ne(parameters.poolName, '') }}:
7674
name: ${{ parameters.poolName }}
@@ -81,24 +79,25 @@ jobs:
8179
name: Hosted Ubuntu 1604
8280
vmImage: ubuntu-16.04
8381
${{ if and(eq(parameters.poolName, ''), eq(parameters.agentOs, 'Windows')) }}:
84-
${{ if ne(parameters.codeSign, 'true') }}:
85-
name: Hosted VS2017
86-
vmImage: vs2017-win2016
87-
${{ if eq(parameters.codeSign, 'true') }}:
88-
name: DotNetCore-Windows
82+
${{ if eq(variables['System.TeamProject'], 'internal') }}:
83+
name: dotnet-internal-temp
84+
${{ if ne(variables['System.TeamProject'], 'internal') }}:
85+
name: dotnet-external-temp
8986
variables:
9087
AgentOsName: ${{ parameters.agentOs }}
9188
ASPNETCORE_TEST_LOG_MAXPATH: "200" # Keep test log file name length low enough for artifact zipping
92-
DOTNET_HOME: $(Agent.WorkFolder)/.dotnet
89+
DOTNET_HOME: $(Agent.BuildDirectory)/.dotnet
90+
BuildScript: ${{ parameters.buildScript }}
9391
BuildScriptArgs: ${{ parameters.buildArgs }}
9492
BuildConfiguration: ${{ parameters.configuration }}
9593
BuildDirectory: ${{ parameters.buildDirectory }}
96-
VSTS_OVERWRITE_TEMP: false # Workaround for https://github.com/dotnet/core-eng/issues/2812
97-
${{ if eq(parameters.codeSign, 'true') }}:
94+
${{ if eq(parameters.agentOs, 'Windows') }}:
95+
JAVA_HOME: $(Agent.BuildDirectory)\.tools\jdk
96+
${{ if or(ne(parameters.codeSign, 'true'), ne(variables['System.TeamProject'], 'internal')) }}:
97+
_SignType:
98+
${{ if and(eq(parameters.codeSign, 'true'), eq(variables['System.TeamProject'], 'internal')) }}:
9899
TeamName: AspNetCore
99100
_SignType: real
100-
${{ if ne(parameters.codeSign, 'true') }}:
101-
_SignType:
102101
${{ insert }}: ${{ parameters.variables }}
103102
steps:
104103
- checkout: self
@@ -107,13 +106,17 @@ jobs:
107106
displayName: Install Node 10.x
108107
inputs:
109108
versionSpec: 10.x
110-
- ${{ if and(eq(parameters.agentOs, 'Windows'), eq(parameters.codeSign, 'true')) }}:
109+
- ${{ if eq(parameters.agentOs, 'Windows') }}:
110+
- powershell: ./eng/scripts/InstallJdk.ps1 '11.0.1'
111+
displayName: Install JDK 11
112+
- ${{ if and(eq(variables['System.TeamProject'], 'internal'), eq(parameters.agentOs, 'Windows'), eq(parameters.codeSign, 'true')) }}:
111113
- task: MicroBuildSigningPlugin@1
112114
displayName: Install MicroBuild Signing plugin
113115
condition: and(succeeded(), in(variables['_SignType'], 'test', 'real'))
114116
inputs:
115117
signType: $(_SignType)
116118
zipSources: false
119+
feedSource: https://dnceng.pkgs.visualstudio.com/_packaging/MicroBuildToolset/nuget/v3/index.json
117120
- ${{ parameters.beforeBuild }}
118121
- ${{ if eq(parameters.agentOs, 'Windows') }}:
119122
- script: .\$(BuildDirectory)\build.cmd -ci /p:SignType=$(_SignType) /p:Configuration=$(BuildConfiguration) $(BuildScriptArgs)
@@ -124,6 +127,7 @@ jobs:
124127
- task: PublishTestResults@2
125128
displayName: Publish test results
126129
condition: always()
130+
continueOnError: true
127131
inputs:
128132
testRunTitle: $(AgentOsName)-$(BuildConfiguration)
129133
testRunner: vstest
@@ -133,6 +137,7 @@ jobs:
133137
- task: PublishBuildArtifacts@1
134138
displayName: Upload artifacts
135139
condition: eq(variables['system.pullrequest.isfork'], false)
140+
continueOnError: true
136141
inputs:
137142
${{ if eq(parameters.buildDirectory, '') }}:
138143
pathtoPublish: ${{ parameters.artifacts.path }}
@@ -145,7 +150,7 @@ jobs:
145150
artifactType: Container
146151
parallel: true
147152
- ${{ parameters.afterBuild }}
148-
- ${{ if and(eq(parameters.agentOs, 'Windows'), eq(parameters.codeSign, 'true')) }}:
153+
- ${{ if and(eq(variables['System.TeamProject'], 'internal'), eq(parameters.agentOs, 'Windows')) }}:
149154
- task: MicroBuildCleanup@1
150155
displayName: Cleanup MicroBuild tasks
151156
condition: always()

eng/scripts/InstallJdk.ps1

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
param(
3+
[Parameter(Mandatory = $true)]
4+
$JdkVersion
5+
)
6+
7+
$ErrorActionPreference = 'Stop'
8+
$ProgressPreference = 'SilentlyContinue' # Workaround PowerShell/PowerShell#2138
9+
10+
Set-StrictMode -Version 1
11+
12+
if (-not $env:JAVA_HOME) {
13+
throw 'You must set the JAVA_HOME environment variable to the destination of the JDK.'
14+
}
15+
16+
$repoRoot = Resolve-Path "$PSScriptRoot/../.."
17+
$tempDir = "$repoRoot/obj"
18+
mkdir $tempDir -ea Ignore | out-null
19+
Write-Host "Starting download of JDK ${JdkVersion}"
20+
Invoke-WebRequest -UseBasicParsing -Uri "https://netcorenativeassets.blob.core.windows.net/resource-packages/external/windows/java/jdk-${JdkVersion}_windows-x64_bin.zip" -Out "$tempDir/jdk.zip"
21+
Write-Host "Done downloading JDK ${JdkVersion}"
22+
Expand-Archive "$tempDir/jdk.zip" -d "$tempDir/jdk/"
23+
Write-Host "Expanded JDK to $tempDir"
24+
mkdir (split-path -parent $env:JAVA_HOME) -ea ignore | out-null
25+
Write-Host "Installing JDK to $env:JAVA_HOME"
26+
Move-Item "$tempDir/jdk/jdk-${jdkVersion}" $env:JAVA_HOME
27+
Write-Host "Done installing JDK to $env:JAVA_HOME"

eng/scripts/common.psm1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ function Get-RemoteFile([string]$RemotePath, [string]$LocalPath) {
6262
while ($retries -gt 0) {
6363
$retries -= 1
6464
try {
65+
$ProgressPreference = 'SilentlyContinue' # Workaround PowerShell/PowerShell#2138
6566
Invoke-WebRequest -UseBasicParsing -Uri $RemotePath -OutFile $LocalPath
6667
return
6768
}

run.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ function Get-RemoteFile([string]$RemotePath, [string]$LocalPath) {
172172
while ($retries -gt 0) {
173173
$retries -= 1
174174
try {
175+
$ProgressPreference = 'SilentlyContinue' # Workaround PowerShell/PowerShell#2138
175176
Invoke-WebRequest -UseBasicParsing -Uri $RemotePath -OutFile $LocalPath
176177
return
177178
}

scripts/common.psm1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ function Ensure-Hub() {
141141

142142
mkdir -Path $tmpDir -ErrorAction Ignore | Out-Null
143143

144+
$ProgressPreference = 'SilentlyContinue' # Workaround PowerShell/PowerShell#2138
144145
Invoke-WebRequest -OutFile $zipLocation -Uri $source
145146

146147
Expand-Archive -Path $zipLocation -DestinationPath $zipDir -Force

src/Middleware/WebSockets/setup-wstest.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ $WsTest = Join-Path $ScriptsDir "wstest.exe"
1414
$VCPythonMsi = Join-Path $VendorDir "VCForPython27.msi"
1515
if(!(Test-Path $VCPythonMsi)) {
1616
Write-Host "Downloading VCForPython27.msi"
17+
$ProgressPreference = 'SilentlyContinue' # Workaround PowerShell/PowerShell#2138
1718
Invoke-WebRequest -Uri https://download.microsoft.com/download/7/9/6/796EF2E4-801B-4FC4-AB28-B59FBF6D907B/VCForPython27.msi -OutFile "$VCPythonMsi"
1819
}
1920
else {
@@ -49,4 +50,4 @@ virtualenv $VirtualEnvDir
4950
# Install autobahn into the virtualenv
5051
& "$ScriptsDir\pip" install autobahntestsuite
5152

52-
Write-Host "Using wstest from: '$WsTest'"
53+
Write-Host "Using wstest from: '$WsTest'"

src/Servers/IIS/tools/SetupTestEnvironment.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ function Shutdown-Dumps()
9494
{
9595
$downloadedFile = [System.IO.Path]::GetTempFileName();
9696
$downloadedFile = "$downloadedFile.exe";
97+
$ProgressPreference = 'SilentlyContinue' # Workaround PowerShell/PowerShell#2138
9798
Invoke-WebRequest -Uri "https://go.microsoft.com/fwlink/p/?linkid=870807" -OutFile $downloadedFile;
9899
& $downloadedFile /features OptionId.WindowsDesktopDebuggers /norestart /q;
99100
}
@@ -132,4 +133,4 @@ if ($Mode -eq "Shutdown")
132133
Shutdown-Dumps;
133134
}
134135

135-
Exit 0;
136+
Exit 0;

test/Cli.FunctionalTests/run-tests.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ try {
139139
$cliUrl = "$AssetRootUrl/Sdk/$sdkVersion/dotnet-sdk-$sdkVersion-$HostRid$archiveExt"
140140
$cliArchiveFile = "$PSScriptRoot/obj/dotnet$archiveExt"
141141
Write-Host "Downloading $cliUrl"
142+
$ProgressPreference = 'SilentlyContinue' # Workaround PowerShell/PowerShell#2138
142143
Invoke-WebRequest -UseBasicParsing "${cliUrl}${AccessTokenSuffix}" -OutFile $cliArchiveFile
143144
if ($archiveExt -eq '.zip') {
144145
Expand-Archive $cliArchiveFile -DestinationPath $dotnetRoot

0 commit comments

Comments
 (0)