Skip to content

Commit 7672270

Browse files
authored
Infrastructure tweaks for unified build (#54081)
* Infrastructure tweaks for unified build - Use arcade standard prepareMachine to decide whether to kill running processes. Unified build invokes eng/build.ps1 with -ci, as would a user running the build locally. It should not blanket kill the host processes. Pass -prepareMachine in YML files - if OnlyBuildRepoTasks is passed, don't write a warning that nothing will get built. * Revert submodules
1 parent ed1e304 commit 7672270

9 files changed

+55
-39
lines changed

.azure/pipelines/ci.yml

+32-24
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ stages:
200200
steps:
201201
- script: ./eng/build.cmd
202202
-ci
203+
-prepareMachine
203204
-arch x64
204205
-all
205206
$(_BuildArgs)
@@ -250,6 +251,7 @@ stages:
250251
# The sign settings have been configured to
251252
- script: ./eng/build.cmd
252253
-ci
254+
-prepareMachine
253255
-arch x64
254256
-pack
255257
-all
@@ -262,6 +264,7 @@ stages:
262264
# This is going to actually build x86 native assets.
263265
- script: ./eng/build.cmd
264266
-ci
267+
-prepareMachine
265268
-noBuildRepoTasks
266269
-arch x86
267270
-pack
@@ -277,6 +280,7 @@ stages:
277280
# Build the arm64 shared framework
278281
- script: ./eng/build.cmd
279282
-ci
283+
-prepareMachine
280284
-noBuildRepoTasks
281285
-arch arm64
282286
-sign
@@ -292,6 +296,7 @@ stages:
292296

293297
- script: .\src\SiteExtensions\build.cmd
294298
-ci
299+
-prepareMachine
295300
-noBuildRepoTasks
296301
-pack
297302
-noBuildDeps
@@ -305,6 +310,7 @@ stages:
305310
# previous steps. Sign check is disabled because it is run in a separate step below, after installers are built.
306311
- script: ./eng/build.cmd
307312
-ci
313+
-prepareMachine
308314
-noBuildRepoTasks
309315
-noBuildNative
310316
-noBuild
@@ -317,6 +323,7 @@ stages:
317323
# Windows installers bundle x86/x64/arm64 assets
318324
- script: ./eng/build.cmd
319325
-ci
326+
-prepareMachine
320327
-noBuildRepoTasks
321328
-sign
322329
-buildInstallers
@@ -330,6 +337,7 @@ stages:
330337
# Windows installers bundle and sharedfx msi for arm64
331338
- script: ./eng/build.cmd
332339
-ci
340+
-prepareMachine
333341
-noBuildRepoTasks
334342
-arch arm64
335343
-sign
@@ -436,28 +444,28 @@ stages:
436444
$(_InternalRuntimeDownloadArgs)
437445
displayName: Run build.sh
438446
- script: ./eng/build.sh
439-
--ci
440-
--nobl
441-
--arch x64
442-
--build-installers
443-
--no-build-deps
447+
--ci
448+
--nobl
449+
--arch x64
450+
--build-installers
451+
--no-build-deps
444452
--no-build-nodejs
445-
-p:OnlyPackPlatformSpecificPackages=true
446-
-p:BuildRuntimeArchive=false
453+
-p:OnlyPackPlatformSpecificPackages=true
454+
-p:BuildRuntimeArchive=false
447455
-p:LinuxInstallerType=deb
448456
$(_BuildArgs)
449457
$(_InternalRuntimeDownloadArgs)
450458
displayName: Build Debian installers
451459
target: debpkg
452460
- script: ./eng/build.sh
453-
--ci
454-
--nobl
455-
--arch x64
456-
--build-installers
457-
--no-build-deps
461+
--ci
462+
--nobl
463+
--arch x64
464+
--build-installers
465+
--no-build-deps
458466
--no-build-nodejs
459-
-p:OnlyPackPlatformSpecificPackages=true
460-
-p:BuildRuntimeArchive=false
467+
-p:OnlyPackPlatformSpecificPackages=true
468+
-p:BuildRuntimeArchive=false
461469
-p:LinuxInstallerType=rpm
462470
-p:AssetManifestFileName=aspnetcore-Linux_x64.xml
463471
$(_BuildArgs)
@@ -525,14 +533,14 @@ stages:
525533
$(_InternalRuntimeDownloadArgs)
526534
displayName: Run build.sh
527535
- script: ./eng/build.sh
528-
--ci
529-
--nobl
530-
--arch arm64
531-
--build-installers
532-
--no-build-deps
536+
--ci
537+
--nobl
538+
--arch arm64
539+
--build-installers
540+
--no-build-deps
533541
--no-build-nodejs
534-
-p:OnlyPackPlatformSpecificPackages=true
535-
-p:BuildRuntimeArchive=false
542+
-p:OnlyPackPlatformSpecificPackages=true
543+
-p:BuildRuntimeArchive=false
536544
-p:LinuxInstallerType=rpm
537545
-p:AssetManifestFileName=aspnetcore-Linux_arm64.xml
538546
$(_BuildArgs)
@@ -729,11 +737,11 @@ stages:
729737
timeoutInMinutes: 240
730738
steps:
731739
# Build the shared framework
732-
- script: ./eng/build.cmd -ci -nobl -all -pack -arch x64
740+
- script: ./eng/build.cmd -ci -prepareMachine -nobl -all -pack -arch x64
733741
/p:CrossgenOutput=false /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log $(_InternalRuntimeDownloadArgs)
734742
displayName: Build shared fx
735743
# -noBuildRepoTasks -noBuildNative -noBuild to avoid repeating work done in the previous step.
736-
- script: ./eng/build.cmd -ci -nobl -all -noBuildRepoTasks -noBuildNative -noBuild -test
744+
- script: ./eng/build.cmd -ci -prepareMachine -nobl -all -noBuildRepoTasks -noBuildNative -noBuild -test
737745
-projects eng\helix\helix.proj /p:IsHelixPRCheck=true /p:IsHelixJob=true
738746
/p:CrossgenOutput=false /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log $(_InternalRuntimeDownloadArgs)
739747
displayName: Run build.cmd helix target
@@ -764,7 +772,7 @@ stages:
764772
- ${{ if eq(variables.enableSourceIndex, 'true') }}:
765773
- template: /eng/common/templates/job/source-index-stage1.yml
766774
parameters:
767-
sourceIndexBuildCommand: ./eng/build.cmd -Configuration Release -ci -noBuildJava -binaryLog /p:OnlyPackPlatformSpecificPackages=true
775+
sourceIndexBuildCommand: ./eng/build.cmd -Configuration Release -ci -prepareMachine -noBuildJava -binaryLog /p:OnlyPackPlatformSpecificPackages=true
768776
binlogPath: artifacts/log/Release/Build.binlog
769777
presteps:
770778
- task: NodeTool@0

.azure/pipelines/devBuilds.yml

+4
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ stages:
2424
steps:
2525
- script: ./eng/build.cmd
2626
-ci
27+
-prepareMachine
2728
-arch x64
2829
/bl:$(Build.SourcesDirectory)/artifacts/log/build.components.x64.binlog
2930
displayName: Build x64
@@ -46,6 +47,7 @@ stages:
4647
steps:
4748
- script: ./eng/build.cmd
4849
-ci
50+
-prepareMachine
4951
-arch x64
5052
/bl:$(Build.SourcesDirectory)/artifacts/log/build.servers.x64.binlog
5153
displayName: Build x64
@@ -68,6 +70,7 @@ stages:
6870
steps:
6971
- script: ./eng/build.cmd
7072
-ci
73+
-prepareMachine
7174
-arch x64
7275
/bl:$(Build.SourcesDirectory)/artifacts/log/build.projectTemplates.x64.binlog
7376
displayName: Build x64
@@ -90,6 +93,7 @@ stages:
9093
steps:
9194
- script: ./eng/build.cmd
9295
-ci
96+
-prepareMachine
9397
-arch x64
9498
/bl:$(Build.SourcesDirectory)/artifacts/log/build.all.x64.binlog
9599
displayName: Build x64

.azure/pipelines/helix-matrix.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ jobs:
3232
timeoutInMinutes: 480
3333
steps:
3434
# Build the shared framework
35-
- script: ./eng/build.cmd -ci -nobl -all -pack -arch x64
35+
- script: ./eng/build.cmd -ci -prepareMachine -nobl -all -pack -arch x64
3636
/p:CrossgenOutput=false /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log
3737
displayName: Build shared fx
3838
# -noBuildRepoTasks -noBuildNative -noBuild to avoid repeating work done in the previous step.
39-
- script: .\eng\build.cmd -ci -nobl -all -noBuildRepoTasks -noBuildNative -noBuild -test
39+
- script: .\eng\build.cmd -ci -prepareMachine -nobl -all -noBuildRepoTasks -noBuildNative -noBuild -test
4040
-projects eng\helix\helix.proj /p:IsHelixJob=true
4141
/p:CrossgenOutput=false /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log
4242
displayName: Run build.cmd helix target

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ jobs:
256256
${{ step.env }}
257257
- ${{ if eq(parameters.steps, '')}}:
258258
- ${{ if eq(parameters.agentOs, 'Windows') }}:
259-
- script: $(BuildDirectory)\build.cmd -ci -nobl -Configuration $(BuildConfiguration) $(BuildScriptArgs)
259+
- script: $(BuildDirectory)\build.cmd -ci -prepareMachine -nobl -Configuration $(BuildConfiguration) $(BuildScriptArgs)
260260
/p:DotNetSignType=$(_SignType)
261261
displayName: Run build.cmd
262262
env:

.azure/pipelines/quarantined-pr.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ jobs:
5353
timeoutInMinutes: 120
5454
steps:
5555
# Build the shared framework
56-
- script: ./eng/build.cmd -ci -nobl -all -noBuildJava -pack -arch x64
56+
- script: ./eng/build.cmd -ci -prepareMachine -nobl -all -noBuildJava -pack -arch x64
5757
/p:CrossgenOutput=false /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log
5858
displayName: Build shared fx
5959
# -noBuildRepoTasks -noBuildNative -noBuild to avoid repeating work done in the previous step.
60-
- script: ./eng/build.cmd -ci -nobl -all -noBuildRepoTasks -noBuildNative -noBuild -noBuildJava -test
60+
- script: ./eng/build.cmd -ci -prepareMachine -nobl -all -noBuildRepoTasks -noBuildNative -noBuild -noBuildJava -test
6161
-projects eng\helix\helix.proj /p:IsHelixPRCheck=true /p:RunQuarantinedTests=true /p:IsHelixJob=true
6262
/p:CrossgenOutput=false /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log
6363
displayName: Run build.cmd helix target
@@ -80,9 +80,9 @@ jobs:
8080
isAzDOTestingJob: true
8181
enablePublishTestResults: false
8282
steps:
83-
- script: ./eng/build.cmd -ci -nobl -all -noBuildJava -pack
83+
- script: ./eng/build.cmd -ci -prepareMachine -nobl -all -noBuildJava -pack
8484
displayName: Build
85-
- script: ./eng/build.cmd -ci -nobl -all -noBuildRepoTasks -noBuildNative -NoBuild -noBuildJava -test
85+
- script: ./eng/build.cmd -ci -prepareMachine -nobl -all -noBuildRepoTasks -noBuildNative -NoBuild -noBuildJava -test
8686
/p:RunQuarantinedTests=true /p:SkipHelixReadyTests=true
8787
displayName: Run Quarantined Tests
8888
continueOnError: true

.azure/pipelines/quarantined-tests.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ jobs:
2727
timeoutInMinutes: 480
2828
steps:
2929
# Build the shared framework
30-
- script: ./eng/build.cmd -ci -nobl -all -noBuildJava -pack -arch x64
30+
- script: ./eng/build.cmd -ci -prepareMachine -nobl -all -noBuildJava -pack -arch x64
3131
/p:CrossgenOutput=false /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log
3232
displayName: Build shared fx
3333
# -noBuildRepoTasks -noBuildNative -noBuild to avoid repeating work done in the previous step.
34-
- script: ./eng/build.cmd -ci -nobl -all -noBuildRepoTasks -noBuildNative -noBuild -noBuildJava -test
34+
- script: ./eng/build.cmd -ci -prepareMachine -nobl -all -noBuildRepoTasks -noBuildNative -noBuild -noBuildJava -test
3535
-projects eng\helix\helix.proj /p:RunQuarantinedTests=true /p:IsHelixJob=true
3636
/p:CrossgenOutput=false /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log
3737
displayName: Run build.cmd helix target

.azure/pipelines/richnav.yml

+4
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ stages:
3333
steps:
3434
- script: ./eng/build.cmd
3535
-ci
36+
-prepareMachine
3637
-arch x64
3738
-buildNative
3839
/p:EnableRichCodeNavigation=false
@@ -41,6 +42,7 @@ stages:
4142

4243
- script: ./eng/build.cmd
4344
-ci
45+
-prepareMachine
4446
-arch x64
4547
-all
4648
-noBuildNative
@@ -52,6 +54,7 @@ stages:
5254
# This is going to actually build x86 native assets.
5355
- script: ./eng/build.cmd
5456
-ci
57+
-prepareMachine
5558
-arch x86
5659
-all
5760
-noBuildJava
@@ -65,6 +68,7 @@ stages:
6568
# Build the arm64 shared framework
6669
- script: ./eng/build.cmd
6770
-ci
71+
-prepareMachine
6872
-arch arm64
6973
-noBuildJava
7074
-noBuildNodeJS

.azure/pipelines/stress.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
agentOs: Windows
2727
isAzDOTestingJob: true
2828
steps:
29-
- script: .\src\Servers\Kestrel\stress\build.cmd -ci -c Release
29+
- script: .\src\Servers\Kestrel\stress\build.cmd -ci -prepareMachine -c Release
3030
displayName: Build Repo
3131
- script: .\.dotnet\dotnet.exe run --project .\src\Servers\Kestrel\stress\HttpStress.csproj -c Release -aspnetlog
3232
displayName: Run stress

eng/build.ps1

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ build projects, run tests, and generate code.
1212
.PARAMETER CI
1313
Sets up CI specific settings and variables.
1414
15+
.PARAMETER PrepareMachine
16+
In CI, Turns on machine preparation/clean up code that changes the machine state (e.g. kills build processes).
17+
1518
.PARAMETER Restore
1619
Run restore.
1720
@@ -124,6 +127,7 @@ Online version: https://github.com/dotnet/aspnetcore/blob/main/docs/BuildFromSou
124127
[CmdletBinding(PositionalBinding = $false, DefaultParameterSetName='Groups')]
125128
param(
126129
[switch]$CI,
130+
[switch]$PrepareMachine,
127131

128132
# Build lifecycle options
129133
[switch]$Restore,
@@ -209,7 +213,7 @@ if ($Projects) {
209213
}
210214
}
211215
# When adding new sub-group build flags, add them to this check.
212-
elseif (-not ($All -or $BuildNative -or $BuildManaged -or $BuildNodeJS -or $BuildInstallers -or $BuildJava)) {
216+
elseif (-not ($All -or $BuildNative -or $BuildManaged -or $BuildNodeJS -or $BuildInstallers -or $BuildJava -or $OnlyBuildRepoTasks)) {
213217
Write-Warning "No default group of projects was specified, so building the managed and native projects and their dependencies. Run ``build.cmd -help`` for more details."
214218

215219
# The goal of this is to pick a sensible default for `build.cmd` with zero arguments.
@@ -479,10 +483,6 @@ finally {
479483
Stop-Job -Name DumpProcesses
480484
Remove-Job -Name DumpProcesses
481485
}
482-
483-
if ($ci) {
484-
& "$PSScriptRoot/scripts/KillProcesses.ps1"
485-
}
486486
}
487487

488488
ExitWithExitCode $exit_code

0 commit comments

Comments
 (0)