|
| 1 | +# This pipeline does a clean build of the BuildXL repo with remoting enabled |
| 2 | +# The BuildXL version to download from drop and use for the build (e.g., 0.1.0-20221026.0) |
| 3 | +# should be specified via the queue-time variable $(BuildXLPackageVersion) |
| 4 | +trigger: none # This pipeline is explicitly scheduled |
| 5 | + |
| 6 | +variables: |
| 7 | + - group: "BuildXL Common variables" |
| 8 | + - group: "BuildXL Secrets" |
| 9 | + - name: Domino.DogfoodPackagePath |
| 10 | + value: $(System.DefaultWorkingDirectory)\$(Build.BuildId)\Dogfood |
| 11 | + - name: BuildXL.RepoDirectory |
| 12 | + value: $(Build.Repository.LocalPath) |
| 13 | + - name: BuildXL.LogsDirectory |
| 14 | + value: $(BuildXL.RepoDirectory)\Out\Logs |
| 15 | + - name: BuildXLRemotingArgs |
| 16 | + value: /numRemoteAgentLeases:64 /remotingThresholdMultiplier:1.25 |
| 17 | + - name: AnyBuildExtraArgs |
| 18 | + value: --ClientApplicationId~~$(BuildXLPipelinesAppId)~~--ClientSecretEnvironmentVariable~~AnyBuildServicePrincipalPasswd~~--NoCheckForUpdates |
| 19 | + - name: PatArgs |
| 20 | + value: -OneEsPat $(PAT-TseBuild-AzureDevOps-1esSharedAssets-Package-Read) -CbPat $(PAT-TseBuild-AzureDevOps-CloudBuild-Packaging-Read) -MsEngGitPat $(PAT-TseBuild-AzureDevOps-MsEng-ReadCode) -VstsPat $(PAT-TseBuild-AzureDevOps-mseng-buildcache) |
| 21 | + - name: DogfoodDropName |
| 22 | + value: buildxl.dogfood.$(BuildXLPackageVersion) |
| 23 | + - name: BxlScriptArgs |
| 24 | + value: -SharedCacheMode Disable -Use Dev -DevRoot $(Domino.DogfoodPackagePath)\release\win-x64 -EnableProcessRemoting |
| 25 | + - name: BuildXLArgs |
| 26 | + value: /q:ReleaseDotNet6 /server- /p:[Sdk.BuildXL]microsoftInternal=1 /p:BUILDXL_FINGERPRINT_SALT=* /p:BuildXLWorkerAttachTimeoutMin=5 /logOutput:FullOutputOnWarningOrError /p:RetryXunitTests=1 /processRetries:3 /traceinfo:valdation=ReleasePipelineRemoting /enableIncrementalFrontEnd- /p:xunitSemaphoreCount=12 /p:BUILDXL_ANYBUILD_EXTRA_ARGS=$(AnyBuildExtraArgs) |
| 27 | + |
| 28 | +pool: |
| 29 | + name: BuildXL-DevOpsAgents-PME |
| 30 | + |
| 31 | +jobs: |
| 32 | +- job: Distributed_Remoting |
| 33 | + displayName: Clean build with remoting |
| 34 | + steps: |
| 35 | + - checkout: self |
| 36 | + fetchDepth: 1 |
| 37 | + |
| 38 | + - template: ../common/set-artifacts-pat.yml |
| 39 | + parameters: |
| 40 | + AzDevPAT: $(PAT-TseBuild-AzureDevOps-MsEng) |
| 41 | + |
| 42 | + - template: ./az-login.yml |
| 43 | + - template: ../common/journaling.yml |
| 44 | + - template: ../common/set-msvc-version.yml |
| 45 | + |
| 46 | + - task: ms-vscs-artifact.build-tasks.artifactDropDownloadTask-1.artifactDropDownloadTask@1 |
| 47 | + displayName: 'Download $(DogfoodDropName) from drop' |
| 48 | + inputs: |
| 49 | + dropServiceURI: 'https://mseng.artifacts.visualstudio.com/DefaultCollection' |
| 50 | + buildNumber: '$(DogfoodDropName)' |
| 51 | + destinationPath: '$(Domino.DogfoodPackagePath)' |
| 52 | + rootPaths: 'release/win-x64' |
| 53 | + |
| 54 | + - powershell: 'Remove-Item -Force -Recurse "$env:LOCALAPPDATA\Microsoft\AnyBuild" -ea SilentlyContinue' |
| 55 | + displayName: 'Remove Existing AnyBuild' |
| 56 | + |
| 57 | + - task: PowerShell@2 |
| 58 | + inputs: |
| 59 | + targetType: filePath |
| 60 | + filePath: 'RunBxlWithPAT.ps1' |
| 61 | + arguments: '$(PatArgs) $(BxlScriptArgs) $(BuildXLArgs) $(BuildXLRemotingArgs) /logsDirectory:$(BuildXL.LogsDirectory) /ado' |
| 62 | + workingDirectory: $(BuildXL.RepoDirectory) |
| 63 | + displayName: 'Run clean selfhost build with remoting enabled' |
| 64 | + env: |
| 65 | + SYSTEM_ACCESSTOKEN: $(System.AccessToken) |
| 66 | + AnyBuildServicePrincipalPasswd: $(AzureApp-BuildXL-Pipelines) |
| 67 | + |
| 68 | + - powershell: | |
| 69 | + $bxlWithRemotingLogDir = "$(BuildXL.LogsDirectory)" |
| 70 | + $statsContent = Get-Content -Path (Join-Path $bxlWithRemotingLogDir "BuildXL.stats") | Out-String |
| 71 | + $stats = ConvertFrom-StringData -StringData $statsContent |
| 72 | + $runRemoteCount = $stats.Get_Item("PipExecution.TotalRunRemoteProcesses") |
| 73 | + $runDistributedCount = $stats.Get_Item("PipExecution.ProcessesExecutedRemotely") |
| 74 | + $runLocalFallbackCount = $stats.Get_Item("PipExecution.TotalRemoteFallbackRetries") |
| 75 | + |
| 76 | + Write-Host "Run remote (AnyBuild): $runRemoteCount" |
| 77 | + Write-Host "Run on remote workers: $runDistributedCount" |
| 78 | + Write-Host "Run local due to fallback: $runLocalFallbackCount" |
| 79 | + |
| 80 | + $exitcode = 0 |
| 81 | +
|
| 82 | + if ($runRemoteCount -eq 0) |
| 83 | + { |
| 84 | + Write-Error "##[error]No process pip ran remotely. Please check AnyBuild.log." |
| 85 | + $exitcode = 1 |
| 86 | + } |
| 87 | + |
| 88 | + if ($runLocalFallbackCount -ne 0) |
| 89 | + { |
| 90 | + Write-Warning "##[warning]$runLocalFallbackCount remoted process pip(s) ran locally" |
| 91 | + } |
| 92 | + |
| 93 | + exit $exitcode |
| 94 | + displayName: 'Validate process remoting' |
| 95 | +
|
| 96 | + - task: PublishPipelineArtifact@1 |
| 97 | + displayName: 'Upload logs' |
| 98 | + inputs: |
| 99 | + targetPath: $(BuildXL.LogsDirectory) |
| 100 | + condition: always() |
0 commit comments