diff --git a/.opt-prof.yml b/.opt-prof.yml new file mode 100644 index 00000000000..35a5a5382d8 --- /dev/null +++ b/.opt-prof.yml @@ -0,0 +1,84 @@ +# Runs OptProf for MSBuild binaries based on an insertion build + +trigger: none # Prevents this pipeline from triggering on check-ins +pr: none # don't run this on PR as well, this should only trigger off on MSBuild runs +schedules: + - cron: "0 9 * * Wed,Sat" + displayName: Weekly OptProf Run + branches: + include: + - main + always: true + +resources: + pipelines: + - pipeline: ComponentBuildUnderTest + source: MSBuild\MSBuild # The name of the pipeline that produces the artifact + trigger: + branches: + - vs* + - pipeline: DartLab + project: DevDiv + source: DartLab + branch: main + - pipeline: DartLab.OptProf + source: DartLab.OptProf + branch: main + repositories: + - repository: DartLabTemplates + type: git + name: DartLab.Templates + ref: refs/heads/main + - repository: DartLabOptProfTemplates + type: git + name: DartLab.OptProf + ref: refs/heads/main + +stages: +- template: \templates\stages\visual-studio\single-runsettings.yml@DartLabOptProfTemplates + parameters: + ##### Required ##### + runSettingsURI: $(Pipeline.Workspace)\ComponentBuildUnderTest\VSSetup\Insertion\OptProf\Training.runsettings + visualStudioBootstrapperURI: $(VisualStudio.InstallationUnderTest.BootstrapperURL) + ##### Optional ##### + name: OptProfProfilingWorkflow + displayName: OptProf Profiling Workflow + optOptimizationInputsDropName: $(OptimizationInputsDropName) + testLabPoolName: VS-Platform # The test lab pool to run your tests in + testMachineImageName: Windows-10-Enterprise-20H2 + visualStudioSigning: Test + variables: + - name: branchName # The branch in the VS repo the bootstrapper was based on + value: $[replace(variables['resources.pipeline.ComponentBuildUnderTest.sourceBranch'],'refs/heads/','')] + - name: OptimizationInputsDropName # The naming convention of the OptimizationInputsDrop + value: OptimizationData/DotNet-msbuild-Trusted/$(branchName)/$(resources.pipeline.ComponentBuildUnderTest.runName)/$(Build.BuildId)/$(System.StageAttempt) + ##### Step Hooks ##### + preTestMachineConfigurationStepList: + - download: ComponentBuildUnderTest + artifact: MicroBuildOutputs + patterns: '**\BootstrapperInfo.json' + displayName: Download Bootstrapper Information + - download: ComponentBuildUnderTest + artifact: VSSetup + patterns: '**\*.runsettings' + displayName: Download OptProf Information + - powershell: | + try { + $bootstrapperInfoJson = Get-Content -Raw -Path '$(Pipeline.Workspace)\ComponentBuildUnderTest\MicroBuildOutputs\BootstrapperInfo.json' | ConvertFrom-Json + $vsBranch = $bootstrapperInfoJson[0].VSBranch + Write-Host "VSBootstrapperBranch: $vsBranch" + Set-AzurePipelinesVariable 'VSBootstrapperBranch' $vsBranch + } + catch { + Write-Host $_ + Write-Error "Failed to set VSBootstrapperBranch pipeline variable" + throw + } + displayName: Set 'VSBootstrapperBranch' variable + - task: PowerShell@2 + displayName: Set 'VisualStudio.InstallationUnderTest.BootstrapperURL' variable + inputs: + filePath: $(DartLab.Path)\Scripts\VisualStudio\Bootstrapper\Get-BootstrapperURL.ps1 + arguments: -BootstrapperInfoJsonURI '$(Pipeline.Workspace)\ComponentBuildUnderTest\MicroBuildOutputs\BootstrapperInfo.json' -VSBranch '$(VSBootstrapperBranch)' -OutVariableName 'VisualStudio.InstallationUnderTest.BootstrapperURL' + preDeployAndRunTestsStepList: + - download: ComponentBuildUnderTest \ No newline at end of file diff --git a/.vsts-dotnet.yml b/.vsts-dotnet.yml index 0fa764dc175..6a9a501c26b 100644 --- a/.vsts-dotnet.yml +++ b/.vsts-dotnet.yml @@ -158,6 +158,7 @@ stages: -task VisualStudio.BuildIbcTrainingSettings /p:VisualStudioDropName=$(VisualStudio.DropName) /p:BootstrapperInfoPath=$(Build.StagingDirectory)\MicroBuild\Output\BootstrapperInfo.json + /p:VisualStudioIbcTrainingSettingsPath=$(Build.SourcesDirectory)\eng\config\OptProf.runsettings displayName: 'OptProf - Build IBC training settings' condition: succeeded() diff --git a/eng/config/OptProf.runsettings b/eng/config/OptProf.runsettings new file mode 100644 index 00000000000..3c5f7566a46 --- /dev/null +++ b/eng/config/OptProf.runsettings @@ -0,0 +1,92 @@ + + + + C:\Test\Results + X86 + 1 + 10 + 21600000 + False + False + False + False + False + .NETFramework,Version=v4.0 + STA + %SystemDrive%\Test + False + + + + + + + + + C:\Test\Dumps + + + + + + true + + + + Warning + + + + + + + + + + + + + + + C:\OptProf + C:\Profiles + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file