Skip to content
4 changes: 2 additions & 2 deletions eng/pipelines/coreclr/templates/run-performance-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,11 @@ jobs:
_Framework: ${{ framework }}
steps:
- ${{ parameters.steps }}
- powershell: $(Build.SourcesDirectory)\eng\testing\performance\performance-setup.ps1 $(IsInternal)$(Interpreter) -Framework $(_Framework) -Kind ${{ parameters.runKind }} -LogicalMachine ${{ parameters.logicalMachine }} ${{ parameters.pgoRunType }} ${{ parameters.extraSetupParameters }}
- powershell: $(Build.SourcesDirectory)\eng\testing\performance\performance-setup.ps1 $(IsInternal)$(Interpreter) -Framework $(_Framework) -Kind ${{ parameters.runKind }} -LogicalMachine ${{ parameters.logicalMachine }} ${{ parameters.pgoRunType }} -UseLocalCommitTime ${{ parameters.extraSetupParameters }}
displayName: Performance Setup (Windows)
condition: and(succeeded(), eq(variables['Agent.Os'], 'Windows_NT'))
continueOnError: ${{ parameters.continueOnError }}
- script: $(Build.SourcesDirectory)/eng/testing/performance/performance-setup.sh $(IsInternal)$(Interpreter) --framework $(_Framework) --kind ${{ parameters.runKind }} --logicalmachine ${{ parameters.logicalMachine }} ${{ parameters.extraSetupParameters }}
- script: $(Build.SourcesDirectory)/eng/testing/performance/performance-setup.sh $(IsInternal)$(Interpreter) --framework $(_Framework) --kind ${{ parameters.runKind }} --logicalmachine ${{ parameters.logicalMachine }} --uselocalcommittime ${{ parameters.extraSetupParameters }}
displayName: Performance Setup (Unix)
condition: and(succeeded(), ne(variables['Agent.Os'], 'Windows_NT'))
continueOnError: ${{ parameters.continueOnError }}
Expand Down
4 changes: 2 additions & 2 deletions eng/pipelines/coreclr/templates/run-scenarios-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,11 @@ jobs:
steps:
- ${{ parameters.steps }}
# run performance-setup
- powershell: $(Build.SourcesDirectory)\eng\testing\performance\performance-setup.ps1 $(IsInternal) -Framework $(_Framework) -Kind ${{ parameters.runKind }} -LogicalMachine ${{ parameters.logicalMachine }} ${{ parameters.extraSetupParameters }} ${{ parameters.additionalSetupParameters }}
- powershell: $(Build.SourcesDirectory)\eng\testing\performance\performance-setup.ps1 $(IsInternal) -Framework $(_Framework) -Kind ${{ parameters.runKind }} -LogicalMachine ${{ parameters.logicalMachine }} -UseLocalCommitTime ${{ parameters.extraSetupParameters }} ${{ parameters.additionalSetupParameters }}
displayName: Performance Setup (Windows)
condition: and(succeeded(), eq(variables['Agent.Os'], 'Windows_NT'))
continueOnError: ${{ parameters.continueOnError }}
- script: $(Build.SourcesDirectory)/eng/testing/performance/performance-setup.sh $(IsInternal) --framework $(_Framework) --kind ${{ parameters.runKind }} --logicalmachine ${{ parameters.logicalMachine }} ${{ parameters.extraSetupParameters }} ${{ parameters.additionalSetupParameters }}
- script: $(Build.SourcesDirectory)/eng/testing/performance/performance-setup.sh $(IsInternal) --framework $(_Framework) --kind ${{ parameters.runKind }} --logicalmachine ${{ parameters.logicalMachine }} --uselocalcommittime ${{ parameters.extraSetupParameters }} ${{ parameters.additionalSetupParameters }}
displayName: Performance Setup (Linux/MAC)
condition: and(succeeded(), ne(variables['Agent.Os'], 'Windows_NT'))
continueOnError: ${{ parameters.continueOnError }}
Expand Down
11 changes: 9 additions & 2 deletions eng/testing/performance/performance-setup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ Param(
[switch] $DynamicPGO,
[switch] $FullPGO,
[switch] $iOSLlvmBuild,
[string] $MauiVersion
[string] $MauiVersion,
[switch] $UseLocalCommitTime
)

$RunFromPerformanceRepo = ($Repository -eq "dotnet/performance") -or ($Repository -eq "dotnet-performance")
Expand Down Expand Up @@ -120,13 +121,19 @@ elseif($FullPGO)
$SetupArguments = "$SetupArguments --full-pgo"
}

if($UseLocalCommitTime)
{
$LocalCommitTime = (git show -s --format=%ci $CommitSha)
$SetupArguments = "$SetupArguments --commit-time `"$LocalCommitTime`""
}

if ($RunFromPerformanceRepo) {
$SetupArguments = "--perf-hash $CommitSha $CommonSetupArguments"

robocopy $SourceDirectory $PerformanceDirectory /E /XD $PayloadDirectory $SourceDirectory\artifacts $SourceDirectory\.git
}
else {
git clone --branch main --depth 1 --quiet https://github.com/dotnet/performance $PerformanceDirectory
git clone --branch UseLocalCommitDate --depth 1 --quiet https://github.com/LoopedBard3/performance $PerformanceDirectory
}

if($MonoDotnet -ne "")
Expand Down
13 changes: 12 additions & 1 deletion eng/testing/performance/performance-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ javascript_engine="v8"
iosmono=false
iosllvmbuild=""
maui_version=""
use_local_commit_time=false
only_sanity=false
dotnet_versions=""

Expand Down Expand Up @@ -165,6 +166,10 @@ while (($# > 0)); do
maui_version=$2
shift 2
;;
--uselocalcommittime)
use_local_commit_time=true
shift 1
;;
--perffork)
perf_fork=$2
shift 2
Expand Down Expand Up @@ -206,6 +211,7 @@ while (($# > 0)); do
echo " --iosmono Set for ios Mono/Maui runs"
echo " --iosllvmbuild Set LLVM for iOS Mono/Maui runs"
echo " --mauiversion Set the maui version for Mono/Maui runs"
echo " --uselocalcommittime Pass local runtime commit time to the setup script"
echo ""
exit 1
;;
Expand Down Expand Up @@ -320,6 +326,11 @@ if [[ "$internal" != true ]]; then
setup_arguments="$setup_arguments --not-in-lab"
fi

if [[ "$use_local_commit_time" == true ]]; then
local_commit_time=$(git show -s --format=%ci $commit_sha)
setup_arguments="$setup_arguments --commit-time \"$local_commit_time\""
fi

if [[ "$run_from_perf_repo" == true ]]; then
payload_directory=
workitem_directory=$source_directory
Expand All @@ -329,7 +340,7 @@ else
if [[ -n "$perf_fork" ]]; then
git clone --branch $perf_fork_branch --depth 1 --quiet $perf_fork $performance_directory
else
git clone --branch main --depth 1 --quiet https://github.com/dotnet/performance.git $performance_directory
git clone --branch UseLocalCommitDate --depth 1 --quiet https://github.com/LoopedBard3/performance.git $performance_directory
fi
# uncomment to use BenchmarkDotNet sources instead of nuget packages
# git clone https://github.com/dotnet/BenchmarkDotNet.git $benchmark_directory
Expand Down