| 1 |
Param( |
| 2 |
[string] $SourceDirectory=$env:BUILD_SOURCESDIRECTORY, |
| 3 |
[string] $CoreRootDirectory, |
| 4 |
[string] $BaselineCoreRootDirectory, |
| 5 |
[string] $Architecture="x64", |
| 6 |
[string] $Framework="netcoreapp5.0", |
| 7 |
[string] $CompilationMode="Tiered", |
| 8 |
[string] $Repository=$env:BUILD_REPOSITORY_NAME, |
| 9 |
[string] $Branch=$env:BUILD_SOURCEBRANCH, |
| 10 |
[string] $CommitSha=$env:BUILD_SOURCEVERSION, |
| 11 |
[string] $BuildNumber=$env:BUILD_BUILDNUMBER, |
| 12 |
[string] $RunCategories="Libraries Runtime", |
| 13 |
[string] $Csproj="src\benchmarks\micro\MicroBenchmarks.csproj", |
| 14 |
[string] $Kind="micro", |
| 15 |
[switch] $Internal, |
| 16 |
[switch] $Compare, |
| 17 |
[string] $Configurations="CompilationMode=$CompilationMode RunKind=$Kind" |
| 18 |
) |
| 19 |
|
| 20 |
$RunFromPerformanceRepo = ($Repository -eq "dotnet/performance") -or ($Repository -eq "dotnet-performance") |
| 21 |
$UseCoreRun = ($CoreRootDirectory -ne [string]::Empty) |
| 22 |
$UseBaselineCoreRun = ($BaselineCoreRootDirectory -ne [string]::Empty) |
| 23 |
|
| 24 |
$PayloadDirectory = (Join-Path $SourceDirectory "Payload") |
| 25 |
$PerformanceDirectory = (Join-Path $PayloadDirectory "performance") |
| 26 |
$WorkItemDirectory = (Join-Path $SourceDirectory "workitem") |
| 27 |
$ExtraBenchmarkDotNetArguments = "--iterationCount 1 --warmupCount 0 --invocationCount 1 --unrollFactor 1 --strategy ColdStart --stopOnFirstError true" |
| 28 |
$Creator = $env:BUILD_DEFINITIONNAME |
| 29 |
$PerfLabArguments = "" |
| 30 |
$HelixSourcePrefix = "pr" |
| 31 |
|
| 32 |
$Queue = "Windows.10.Amd64.ClientRS4.DevEx.15.8.Open" |
| 33 |
|
| 34 |
if ($Framework.StartsWith("netcoreapp")) { |
| 35 |
$Queue = "Windows.10.Amd64.ClientRS5.Open" |
| 36 |
} |
| 37 |
|
| 38 |
if ($Compare) { |
| 39 |
$Queue = "Windows.10.Amd64.19H1.Tiger.Perf.Open" |
| 40 |
$PerfLabArguments = "" |
| 41 |
$ExtraBenchmarkDotNetArguments = "" |
| 42 |
} |
| 43 |
|
| 44 |
if ($Internal) { |
| 45 |
$Queue = "Windows.10.Amd64.19H1.Tiger.Perf" |
| 46 |
$PerfLabArguments = "--upload-to-perflab-container" |
| 47 |
$ExtraBenchmarkDotNetArguments = "" |
| 48 |
$Creator = "" |
| 49 |
$HelixSourcePrefix = "official" |
| 50 |
} |
| 51 |
|
| 52 |
# FIX ME: This is a workaround until we get this from the actual pipeline |
| 53 |
$CommonSetupArguments="--channel master --queue $Queue --build-number $BuildNumber --build-configs $Configurations --architecture $Architecture" |
| 54 |
$SetupArguments = "--repository https://github.com/$Repository --branch $Branch --get-perf-hash --commit-sha $CommitSha $CommonSetupArguments" |
| 55 |
|
| 56 |
if ($RunFromPerformanceRepo) { |
| 57 |
$SetupArguments = "--perf-hash $CommitSha $CommonSetupArguments" |
| 58 |
|
| 59 |
robocopy $SourceDirectory $PerformanceDirectory /E /XD $PayloadDirectory $SourceDirectory\artifacts $SourceDirectory\.git |
| 60 |
} |
| 61 |
else { |
| 62 |
git clone --branch master --depth 1 --quiet https://github.com/dotnet/performance $PerformanceDirectory |
| 63 |
} |
| 64 |
|
| 65 |
if ($UseCoreRun) { |
| 66 |
$NewCoreRoot = (Join-Path $PayloadDirectory "Core_Root") |
| 67 |
Move-Item -Path $CoreRootDirectory -Destination $NewCoreRoot |
| 68 |
} |
| 69 |
if ($UseBaselineCoreRun) { |
| 70 |
$NewBaselineCoreRoot = (Join-Path $PayloadDirectory "Baseline_Core_Root") |
| 71 |
Move-Item -Path $BaselineCoreRootDirectory -Destination $NewBaselineCoreRoot |
| 72 |
} |
| 73 |
|
| 74 |
$DocsDir = (Join-Path $PerformanceDirectory "docs") |
| 75 |
robocopy $DocsDir $WorkItemDirectory |
| 76 |
|
| 77 |
# Set variables that we will need to have in future steps |
| 78 |
$ci = $true |
| 79 |
|
| 80 |
. "$PSScriptRoot\..\pipeline-logging-functions.ps1" |
| 81 |
|
| 82 |
# Directories |
| 83 |
Write-PipelineSetVariable -Name 'PayloadDirectory' -Value "$PayloadDirectory" -IsMultiJobVariable $false |
| 84 |
Write-PipelineSetVariable -Name 'PerformanceDirectory' -Value "$PerformanceDirectory" -IsMultiJobVariable $false |
| 85 |
Write-PipelineSetVariable -Name 'WorkItemDirectory' -Value "$WorkItemDirectory" -IsMultiJobVariable $false |
| 86 |
|
| 87 |
# Script Arguments |
| 88 |
Write-PipelineSetVariable -Name 'Python' -Value "py -3" -IsMultiJobVariable $false |
| 89 |
Write-PipelineSetVariable -Name 'ExtraBenchmarkDotNetArguments' -Value "$ExtraBenchmarkDotNetArguments" -IsMultiJobVariable $false |
| 90 |
Write-PipelineSetVariable -Name 'SetupArguments' -Value "$SetupArguments" -IsMultiJobVariable $false |
| 91 |
Write-PipelineSetVariable -Name 'PerfLabArguments' -Value "$PerfLabArguments" -IsMultiJobVariable $false |
| 92 |
Write-PipelineSetVariable -Name 'BDNCategories' -Value "$RunCategories" -IsMultiJobVariable $false |
| 93 |
Write-PipelineSetVariable -Name 'TargetCsproj' -Value "$Csproj" -IsMultiJobVariable $false |
| 94 |
Write-PipelineSetVariable -Name 'Kind' -Value "$Kind" -IsMultiJobVariable $false |
| 95 |
Write-PipelineSetVariable -Name 'Architecture' -Value "$Architecture" -IsMultiJobVariable $false |
| 96 |
Write-PipelineSetVariable -Name 'UseCoreRun' -Value "$UseCoreRun" -IsMultiJobVariable $false |
| 97 |
Write-PipelineSetVariable -Name 'UseBaselineCoreRun' -Value "$UseBaselineCoreRun" -IsMultiJobVariable $false |
| 98 |
Write-PipelineSetVariable -Name 'RunFromPerfRepo' -Value "$RunFromPerformanceRepo" -IsMultiJobVariable $false |
| 99 |
Write-PipelineSetVariable -Name 'Compare' -Value "$Compare" -IsMultiJobVariable $false |
| 100 |
|
| 101 |
# Helix Arguments |
| 102 |
Write-PipelineSetVariable -Name 'Creator' -Value "$Creator" -IsMultiJobVariable $false |
| 103 |
Write-PipelineSetVariable -Name 'Queue' -Value "$Queue" -IsMultiJobVariable $false |
| 104 |
Write-PipelineSetVariable -Name 'HelixSourcePrefix' -Value "$HelixSourcePrefix" -IsMultiJobVariable $false |
| 105 |
Write-PipelineSetVariable -Name '_BuildConfig' -Value "$Architecture.$Kind.$Framework" -IsMultiJobVariable $false |
| 106 |
|
| 107 |
exit 0 |