summaryrefslogtreecommitdiff
path: root/eng/common/performance/perfhelixpublish.proj
blob: e5826b532370baf9f9019fd536ebe58f5e2cebaf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<Project Sdk="Microsoft.DotNet.Helix.Sdk" DefaultTargets="Test">

  <PropertyGroup Condition="'$(AGENT_OS)' == 'Windows_NT'">
    <WorkItemCommand>%HELIX_CORRELATION_PAYLOAD%\performance\scripts\benchmarks_ci.py --csproj %HELIX_CORRELATION_PAYLOAD%\performance\$(TargetCsproj)</WorkItemCommand>
    <CliArguments>--dotnet-versions %DOTNET_VERSION% --cli-source-info args --cli-branch %PERFLAB_BRANCH% --cli-commit-sha %PERFLAB_HASH% --cli-repository https://github.com/%PERFLAB_REPO% --cli-source-timestamp %PERFLAB_BUILDTIMESTAMP%</CliArguments>
    <Python>py -3</Python>
    <CoreRun>%HELIX_CORRELATION_PAYLOAD%\Core_Root\CoreRun.exe</CoreRun>
    <BaselineCoreRun>%HELIX_CORRELATION_PAYLOAD%\Baseline_Core_Root\CoreRun.exe</BaselineCoreRun>
    <HelixPreCommands>$(HelixPreCommands);call %HELIX_CORRELATION_PAYLOAD%\performance\tools\machine-setup.cmd</HelixPreCommands>
    <ArtifactsDirectory>%HELIX_CORRELATION_PAYLOAD%\artifacts\BenchmarkDotNet.Artifacts</ArtifactsDirectory>
    <BaselineArtifactsDirectory>%HELIX_CORRELATION_PAYLOAD%\artifacts\BenchmarkDotNet.Artifacts_Baseline</BaselineArtifactsDirectory>
    <ResultsComparer>%HELIX_CORRELATION_PAYLOAD%\performance\src\tools\ResultsComparer\ResultsComparer.csproj</ResultsComparer>
    <DotnetExe>%HELIX_CORRELATION_PAYLOAD%\performance\tools\dotnet\$(Architecture)\dotnet.exe</DotnetExe>
    <Percent>%25%25</Percent>
    <XMLResults>%HELIX_WORKITEM_ROOT%\testResults.xml</XMLResults>
  </PropertyGroup>

  <PropertyGroup Condition="'$(AGENT_OS)' != 'Windows_NT' and '$(RunFromPerfRepo)' == 'false'">
    <BaseDirectory>$HELIX_CORRELATION_PAYLOAD</BaseDirectory>
    <PerformanceDirectory>$(BaseDirectory)/performance</PerformanceDirectory>
  </PropertyGroup>

  <PropertyGroup Condition="'$(AGENT_OS)' != 'Windows_NT' and '$(RunFromPerfRepo)' == 'true'">
    <BaseDirectory>$HELIX_WORKITEM_PAYLOAD</BaseDirectory>
    <PerformanceDirectory>$(BaseDirectory)</PerformanceDirectory>
  </PropertyGroup>

  <PropertyGroup Condition="'$(AGENT_OS)' != 'Windows_NT'">
    <WorkItemCommand>$(PerformanceDirectory)/scripts/benchmarks_ci.py --csproj $(PerformanceDirectory)/$(TargetCsproj)</WorkItemCommand>
    <CliArguments>--dotnet-versions $DOTNET_VERSION --cli-source-info args --cli-branch $PERFLAB_BRANCH --cli-commit-sha $PERFLAB_HASH --cli-repository https://github.com/$PERFLAB_REPO --cli-source-timestamp $PERFLAB_BUILDTIMESTAMP</CliArguments>
    <Python>python3</Python>
    <CoreRun>$(BaseDirectory)/Core_Root/corerun</CoreRun>
    <BaselineCoreRun>$(BaseDirectory)/Baseline_Core_Root/corerun</BaselineCoreRun>
    <HelixPreCommands>$(HelixPreCommands);chmod +x $(PerformanceDirectory)/tools/machine-setup.sh;. $(PerformanceDirectory)/tools/machine-setup.sh</HelixPreCommands>
    <ArtifactsDirectory>$(BaseDirectory)/artifacts/BenchmarkDotNet.Artifacts</ArtifactsDirectory>
    <BaselineArtifactsDirectory>$(BaseDirectory)/artifacts/BenchmarkDotNet.Artifacts_Baseline</BaselineArtifactsDirectory>
    <ResultsComparer>$(PerformanceDirectory)/src/tools/ResultsComparer/ResultsComparer.csproj</ResultsComparer>
    <DotnetExe>$(PerformanceDirectory)/tools/dotnet/$(Architecture)/dotnet</DotnetExe>
    <Percent>%25</Percent>
    <XMLResults>$HELIX_WORKITEM_ROOT/testResults.xml</XMLResults>
  </PropertyGroup>

  <PropertyGroup Condition="'$(UseCoreRun)' == 'true'">
    <CoreRunArgument>--corerun $(CoreRun)</CoreRunArgument>
  </PropertyGroup>

  <PropertyGroup Condition="'$(UseBaselineCoreRun)' == 'true'">
    <BaselineCoreRunArgument>--corerun $(BaselineCoreRun)</BaselineCoreRunArgument>
  </PropertyGroup>

  <PropertyGroup Condition="'$(WorkItemCommand)' != ''">
    <WorkItemCommand>$(Python) $(WorkItemCommand) --incremental no --architecture $(Architecture) -f $(_Framework) $(PerfLabArguments)</WorkItemCommand>
  </PropertyGroup>

  <PropertyGroup Condition="'$(_Framework)' != 'net461'">
    <WorkItemCommand>$(WorkItemCommand) $(CliArguments)</WorkItemCommand>
  </PropertyGroup>

  <ItemGroup>
    <HelixCorrelationPayload Include="$(CorrelationPayloadDirectory)">
      <PayloadDirectory>%(Identity)</PayloadDirectory>
    </HelixCorrelationPayload>
  </ItemGroup>

  <PropertyGroup>
    <PartitionCount>5</PartitionCount>
  </PropertyGroup>
  <ItemGroup>
    <Partition Include="$(BuildConfig).Partition0" Index="0" />
    <Partition Include="$(BuildConfig).Partition1" Index="1" />
    <Partition Include="$(BuildConfig).Partition2" Index="2" />
    <Partition Include="$(BuildConfig).Partition3" Index="3" />
    <Partition Include="$(BuildConfig).Partition4" Index="4" />
  </ItemGroup>

  <PropertyGroup Condition="'$(Compare)' == 'true'">
    <FailOnTestFailure>false</FailOnTestFailure>
  </PropertyGroup>

  <!-- 
    Partition the Microbenchmarks project, but nothing else
  -->
  <ItemGroup Condition="$(TargetCsproj.Contains('MicroBenchmarks.csproj'))">
    <HelixWorkItem Include="@(Partition)">
      <PayloadDirectory>$(WorkItemDirectory)</PayloadDirectory>
      <PreCommands Condition="'$(Compare)' == 'true'">$(WorkItemCommand) --bdn-artifacts $(BaselineArtifactsDirectory) --bdn-arguments="--anyCategories $(BDNCategories) $(ExtraBenchmarkDotNetArguments) $(BaselineCoreRunArgument) --partition-count $(PartitionCount) --partition-index %(HelixWorkItem.Index)"</PreCommands>
      <Command>$(WorkItemCommand) --bdn-artifacts $(ArtifactsDirectory) --bdn-arguments="--anyCategories $(BDNCategories) $(ExtraBenchmarkDotNetArguments) $(CoreRunArgument) --partition-count $(PartitionCount) --partition-index %(HelixWorkItem.Index)"</Command>
      <PostCommands Condition="'$(Compare)' == 'true'">$(DotnetExe) run -f $(_Framework) -p $(ResultsComparer) --base $(BaselineArtifactsDirectory) --diff $(ArtifactsDirectory) --threshold 2$(Percent) --xml $(XMLResults);$(FinalCommand)</PostCommands>
      <Timeout>4:00</Timeout>
    </HelixWorkItem>
  </ItemGroup>

  <ItemGroup Condition="!$(TargetCsproj.Contains('MicroBenchmarks.csproj'))">
    <HelixWorkItem Include="$(BuildConfig).WorkItem">
      <PayloadDirectory>$(WorkItemDirectory)</PayloadDirectory>
      <PreCommands Condition="'$(Compare)' == 'true'">$(WorkItemCommand) --bdn-artifacts $(BaselineArtifactsDirectory) --bdn-arguments="--anyCategories $(BDNCategories) $(ExtraBenchmarkDotNetArguments) $(BaselineCoreRunArgument)"</PreCommands>
      <Command>$(WorkItemCommand) --bdn-artifacts $(ArtifactsDirectory) --bdn-arguments="--anyCategories $(BDNCategories) $(ExtraBenchmarkDotNetArguments) $(CoreRunArgument)"</Command>
      <PostCommands Condition="'$(Compare)' == 'true'">$(DotnetExe) run -f $(_Framework) -p $(ResultsComparer) --base $(BaselineArtifactsDirectory) --diff $(ArtifactsDirectory) --threshold 2$(Percent) --xml $(XMLResults)</PostCommands>
      <Timeout>4:00</Timeout>
    </HelixWorkItem>
  </ItemGroup>
</Project>