diff --git a/eng/pipelines/coreclr/templates/run-performance-job.yml b/eng/pipelines/coreclr/templates/run-performance-job.yml index d8a1fa595c6cc7..ada5747efd79af 100644 --- a/eng/pipelines/coreclr/templates/run-performance-job.yml +++ b/eng/pipelines/coreclr/templates/run-performance-job.yml @@ -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 }} diff --git a/eng/pipelines/coreclr/templates/run-scenarios-job.yml b/eng/pipelines/coreclr/templates/run-scenarios-job.yml index 8e9f29666efd24..54b421b5d38260 100644 --- a/eng/pipelines/coreclr/templates/run-scenarios-job.yml +++ b/eng/pipelines/coreclr/templates/run-scenarios-job.yml @@ -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 }} diff --git a/eng/testing/performance/performance-setup.ps1 b/eng/testing/performance/performance-setup.ps1 index 99cbf657b87286..cde1373b24f8e6 100644 --- a/eng/testing/performance/performance-setup.ps1 +++ b/eng/testing/performance/performance-setup.ps1 @@ -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") @@ -120,6 +121,12 @@ 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" diff --git a/eng/testing/performance/performance-setup.sh b/eng/testing/performance/performance-setup.sh index 155c381b628550..506c76de2da82d 100755 --- a/eng/testing/performance/performance-setup.sh +++ b/eng/testing/performance/performance-setup.sh @@ -37,6 +37,7 @@ javascript_engine="v8" iosmono=false iosllvmbuild="" maui_version="" +use_local_commit_time=false only_sanity=false dotnet_versions="" @@ -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 @@ -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 ;; @@ -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