Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
138 commits
Select commit Hold shift + click to select a range
1e17728
Create a SuperPMI collection pipeline
BruceForstall Sep 10, 2020
15c4dc2
Only build Windows_NT_x64, disable test builds and runs
kunalspathak Sep 10, 2020
48ff794
TEMPORARY: disable normal PR triggered jobs
BruceForstall Sep 10, 2020
4b827f3
some template files for superpmi
kunalspathak Sep 10, 2020
2351e74
Little trial error# 1
kunalspathak Sep 11, 2020
668ee17
fix the superpmi-setup.ps1
kunalspathak Sep 11, 2020
6a5ff58
Disable CoreClrTestBuildHost, fix the project path in superpmi-send-t…
kunalspathak Sep 11, 2020
37e8734
Skip build, download, create core_root
kunalspathak Sep 11, 2020
659a42d
Just copy superpmi scripts, import pipeline-logging-functions
kunalspathak Sep 11, 2020
0a9fb92
add a dummy step
kunalspathak Sep 11, 2020
6cde75b
add missing space before message
kunalspathak Sep 11, 2020
c704c8e
Replace message with script
kunalspathak Sep 11, 2020
24a4127
Temporarily disable dependsOn
kunalspathak Sep 11, 2020
a255934
disable another dependsOn
kunalspathak Sep 11, 2020
29745be
Pass superpmi.proj file
kunalspathak Sep 11, 2020
9f310a3
logging around send-to-helix
kunalspathak Sep 11, 2020
e147f7d
fix superpmi.proj to include ItemGroup
kunalspathak Sep 11, 2020
566ac67
have placeholder.txt in WorkItem folder
kunalspathak Sep 11, 2020
1b329e1
fix workitem folder creation, script name
kunalspathak Sep 11, 2020
1df47fb
Re-enable build coreclr, libraries, download, core_root
kunalspathak Sep 11, 2020
944d0e5
fix superpmi.py path
kunalspathak Sep 11, 2020
893a288
clone jitutils, build and copy pmi.dll
kunalspathak Sep 11, 2020
c0be11a
Pass Core_Root as payload
kunalspathak Sep 11, 2020
c0efc11
Use hardcoded checked
kunalspathak Sep 11, 2020
4a34890
Use .dotnet from runtime repo
kunalspathak Sep 11, 2020
63b4847
Fix the pmi.dll location and add -output_mch_path
kunalspathak Sep 13, 2020
96e2f50
fix the output path
kunalspathak Sep 13, 2020
e824683
Try publishing SourcesDirectory
kunalspathak Sep 14, 2020
3a60c31
Upload to HELIX_WORKITEM_UPLOAD_ROOT
kunalspathak Sep 14, 2020
ae09edd
Include test in collection and partition core_root and test
kunalspathak Sep 14, 2020
ce5069b
Enable CoreClrTestBuildHost
kunalspathak Sep 14, 2020
b66ded2
Add dependsOn P1 test
kunalspathak Sep 14, 2020
a695623
Add DownloadFilesFromResults
kunalspathak Sep 14, 2020
23b875f
Properly copy the Tests
kunalspathak Sep 15, 2020
d5742dd
Workaround for https://github.com/dotnet/arcade/pull/6179
kunalspathak Sep 15, 2020
0df199e
Disable test run, SuperPMI just system.web.dll
kunalspathak Sep 15, 2020
1b602b1
Fix the mch path
kunalspathak Sep 16, 2020
0732905
Comment partition for test
kunalspathak Sep 16, 2020
e17335d
Remove commented code
kunalspathak Sep 17, 2020
a71b4fc
Increase timeout to 12 hours
kunalspathak Sep 17, 2020
dfde053
fast pass
kunalspathak Sep 17, 2020
b4ab9dc
Update the machine pool
kunalspathak Sep 17, 2020
178fe35
Add a dummy step
kunalspathak Sep 17, 2020
d6f8da8
Use SuperPMI_Min.zip that contains all the required files
kunalspathak Sep 17, 2020
da8a370
Another way of Extracting cab
kunalspathak Sep 17, 2020
42e0910
download in powershell, extract files separately
kunalspathak Sep 17, 2020
f9bf039
fix the zip path
kunalspathak Sep 17, 2020
74ab28b
Another logic of download zip
kunalspathak Sep 17, 2020
3c08321
fix path
kunalspathak Sep 17, 2020
10bf908
fix newdir path
kunalspathak Sep 17, 2020
7af08bc
more fixes
kunalspathak Sep 17, 2020
f6c74b4
fix extract step
kunalspathak Sep 17, 2020
42aa6de
add test python script and modify creator
kunalspathak Sep 17, 2020
ade6523
Map secret to env
kunalspathak Sep 17, 2020
3d7a26a
decrease timeout, fix superpmi path in proj, print unzipped contents
kunalspathak Sep 18, 2020
8e35c22
Add a step to download and dir artifacts
kunalspathak Sep 18, 2020
f09b5fe
Attempt to call super_pmi upload
kunalspathak Sep 18, 2020
e999395
list all contents
kunalspathak Sep 18, 2020
5bbec4b
Also dir SourcesDir\artifacts
kunalspathak Sep 18, 2020
05ee4bc
Use DownloadPipelineArtifact
kunalspathak Sep 18, 2020
65c4277
Use the right key
kunalspathak Sep 18, 2020
1b4b47e
Upload from helixresults
kunalspathak Sep 18, 2020
71e6960
cleanup run-superpmi-job.yml
kunalspathak Sep 18, 2020
265dd0d
Re-enable superpmi for CORE_ROOT
kunalspathak Sep 18, 2020
d776d42
fix the dependsOn
kunalspathak Sep 18, 2020
a97404c
Replace checked with $(BuildConfig)
kunalspathak Sep 18, 2020
66ef8e1
Replace checked with $(BuildConfig)
kunalspathak Sep 18, 2020
a73331f
change helix queue for windows and add for arm64
kunalspathak Sep 18, 2020
126c56c
Use FileSeparateChar in superpmi.proj
kunalspathak Sep 18, 2020
d90fb99
Add Linux x64
kunalspathak Sep 18, 2020
b552cb6
Fix the helix queue, property erroro
kunalspathak Sep 18, 2020
1c777ef
logging in shell
kunalspathak Sep 18, 2020
ebc84ff
Fix PayloadDir and CorrelationPayloadDir
kunalspathak Sep 19, 2020
a5164dc
Make timeout to 5 hours
kunalspathak Sep 19, 2020
7d2a5b7
Print workitem contents
kunalspathak Sep 19, 2020
882ffd4
fix WorkItemDirectory
kunalspathak Sep 19, 2020
42a4d65
Just copy pmi.dll
kunalspathak Sep 21, 2020
ef0f597
fix the pmi_assemblies path
kunalspathak Sep 21, 2020
3a9ebdf
disable reporter
kunalspathak Sep 21, 2020
37b8be4
pop put JitUtilsDirectory before deleting it
kunalspathak Sep 21, 2020
f21c60d
chmod for superpmi-setup.sh
kunalspathak Sep 21, 2020
712aeed
just copy pmi.dll for unix
kunalspathak Sep 21, 2020
5520771
fix the parameter to unix
kunalspathak Sep 21, 2020
fa7a00b
Add logging to understand -pmi_assemblies issue
kunalspathak Sep 21, 2020
ef8f32e
Add "binaries" folder where payload is present
kunalspathak Sep 22, 2020
bb18d27
remove precommand
kunalspathak Sep 22, 2020
fc0b1f1
Pass Core_Root as CorrelationPayload
kunalspathak Sep 22, 2020
dc882a4
Add back the workaround for https://github.com/dotnet/arcade/pull/6179
kunalspathak Sep 22, 2020
0f1a184
fix checked for Linux
kunalspathak Sep 22, 2020
b21a032
mkdir for linux
kunalspathak Sep 22, 2020
6cd3c45
fix path in HelixResultsDestinationDir
kunalspathak Sep 22, 2020
676edb4
Enable Windows x86/arm64
kunalspathak Sep 22, 2020
2032e44
fix the python path
kunalspathak Sep 22, 2020
12ecebc
First version of superpmi-setup.py
kunalspathak Sep 23, 2020
7833e9f
Attempt to use superpmi-setup.py
kunalspathak Sep 23, 2020
ebaf62a
Fix spelling of LibrariesArtifacts, set python path
kunalspathak Sep 23, 2020
7151b9b
TestArtifacts commented
kunalspathak Sep 23, 2020
c9a0d4a
superpmi-setup script for linux
kunalspathak Sep 23, 2020
d54858c
Enable Linux_x64
kunalspathak Sep 23, 2020
62bd023
Added pydocs
kunalspathak Sep 23, 2020
774ffda
Add option for exclude_directories
kunalspathak Sep 23, 2020
3370619
Moved all the logic to superpmi-setup.py
kunalspathak Sep 23, 2020
8e40713
Replace superpmi-setup.ps1 and superpmi-setup.sh with superpmi-setup.py
kunalspathak Sep 23, 2020
3b502f1
Fix up in superpmi-setup.py
kunalspathak Sep 23, 2020
a7277eb
fix display name
kunalspathak Sep 23, 2020
e4aa69b
add missing spacE
kunalspathak Sep 23, 2020
65c0e57
Use differnet conditional
kunalspathak Sep 23, 2020
03fa06d
ignore PermissionError while cleaning up temp folder
kunalspathak Sep 23, 2020
b92b571
fix workitem copy for linux
kunalspathak Sep 23, 2020
5b7f263
fix copy for unix
kunalspathak Sep 23, 2020
f148f2f
Publish logs
kunalspathak Sep 23, 2020
b7a7128
Print LibrariesArtifacts
kunalspathak Sep 23, 2020
14aa98c
remove space in front of publish logs desc
kunalspathak Sep 23, 2020
f2a3d7d
Add missing quotes for LibrariesArtifacts
kunalspathak Sep 24, 2020
4c6f804
Download x64 coreclr to make upload work
kunalspathak Sep 24, 2020
9728ff3
Enable Windows x86/arm64, Linux arm/arm64
kunalspathak Sep 24, 2020
fd8db24
Delete superpmi-setup.ps1, superpmi-setup.sh
kunalspathak Sep 24, 2020
00e4f1e
Fix space around LibrariesArtifacts
kunalspathak Sep 24, 2020
0e565c2
Download real coreclr x64
kunalspathak Sep 24, 2020
4415d08
ignore native dlls
kunalspathak Sep 24, 2020
33a8764
Make superpmi.py Python3.6 friendly
kunalspathak Sep 24, 2020
e71deee
Minor cleanup
kunalspathak Sep 24, 2020
1cb260c
Cleanup superpmi-send-to-helix to use helix-inner-step
kunalspathak Sep 24, 2020
fe7e8fc
Remove redundant steps
kunalspathak Sep 25, 2020
38aff91
Merge mch files
kunalspathak Sep 25, 2020
b9bca85
Pass osGroup
kunalspathak Sep 25, 2020
26bee59
Make superpmi-setup script takes tests_directory
kunalspathak Sep 25, 2020
e981022
Enable SPMI collection for P1
kunalspathak Sep 25, 2020
cca1003
General cleanup
kunalspathak Sep 25, 2020
f27d3cc
fix merge_mch pattern for OS
kunalspathak Sep 25, 2020
fd63f34
Log the SPMI collection output and put it in upload_root folder
kunalspathak Sep 25, 2020
1c64bad
Replace robocopy/rsync with shutil.copy2
kunalspathak Sep 26, 2020
2f4abfc
fix path of pmi.dll to be copied
kunalspathak Sep 26, 2020
f6a3e47
Include linux .so and file_exe files in copy_directories
kunalspathak Sep 26, 2020
a5312c0
Try publishing just .mch file
kunalspathak Sep 26, 2020
ece1619
Revert "Try publishing just .mch file"
kunalspathak Sep 27, 2020
22a2ead
Disable tests SPMI collection on 42053
kunalspathak Sep 27, 2020
04d3e40
Review feedback
kunalspathak Sep 30, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 102 additions & 0 deletions eng/common/superpmi/superpmi.proj
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
<Project Sdk="Microsoft.DotNet.Helix.Sdk" DefaultTargets="Test">

<PropertyGroup Condition="'$(AGENT_OS)' == 'Windows_NT'">
<FileSeparatorChar>\</FileSeparatorChar>
</PropertyGroup>
<PropertyGroup Condition="'$(AGENT_OS)' != 'Windows_NT'">
<FileSeparatorChar>/</FileSeparatorChar>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need this. You can use MSBuild::NormalizeDirectory or MSBuild::NormalizePath apis. We have a bunch of usages and examples in the runtime repo.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this APIs need to be used with full paths, it doesn't work with relative paths.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you do need it... because you're using it to calculate the commands you're going to run on helix.

</PropertyGroup>

<!-- The directory structure of pmiAssembliesPayload is
source\workitem\pmiAssembliesDirectory\<machine_specific_load_0>\binaries
source\workitem\pmiAssembliesDirectory\<machine_specific_load_1>\binaries
...
source\workitem\pmiAssembliesDirectory\<machine_specific_load_N>\binaries

PmiAssembliesPayload - Path that will be sent to helix machine to run collection on
PmiAssembliesDirectory - Path on helix machine itself where superpmi.py will discover the sent assemblies.
-->
<PropertyGroup Condition="'$(AGENT_OS)' == 'Windows_NT'">
<Python>%HELIX_PYTHONPATH%</Python>
<PmiAssembliesPayload>$(WorkItemDirectory)\pmiAssembliesDirectory</PmiAssembliesPayload>
<PmiAssembliesDirectory>%HELIX_WORKITEM_PAYLOAD%\binaries</PmiAssembliesDirectory>
<SuperPMIDirectory>%HELIX_CORRELATION_PAYLOAD%\superpmi</SuperPMIDirectory>
<OutputMchPath>%HELIX_WORKITEM_UPLOAD_ROOT%</OutputMchPath>
<!-- Workaround until https://github.com/dotnet/arcade/pull/6179 is not available -->
<HelixResultsDestinationDir>$(BUILD_SOURCESDIRECTORY)\artifacts\helixresults</HelixResultsDestinationDir>
<WorkItemCommand>$(SuperPMIDirectory)\superpmi.py collect --pmi -pmi_location $(SuperPMIDirectory)\pmi.dll </WorkItemCommand>
</PropertyGroup>
<PropertyGroup Condition="'$(AGENT_OS)' != 'Windows_NT'">
<Python>$HELIX_PYTHONPATH</Python>
<PmiAssembliesPayload>$(WorkItemDirectory)/pmiAssembliesDirectory</PmiAssembliesPayload>
<PmiAssembliesDirectory>$HELIX_WORKITEM_PAYLOAD/binaries</PmiAssembliesDirectory>
<SuperPMIDirectory>$HELIX_CORRELATION_PAYLOAD/superpmi</SuperPMIDirectory>
<OutputMchPath>$HELIX_WORKITEM_UPLOAD_ROOT</OutputMchPath>
<!-- Workaround until https://github.com/dotnet/arcade/pull/6179 is not available -->
<HelixResultsDestinationDir>$(BUILD_SOURCESDIRECTORY)/artifacts/helixresults</HelixResultsDestinationDir>
<WorkItemCommand>$(SuperPMIDirectory)/superpmi.py collect --pmi -pmi_location $(SuperPMIDirectory)/pmi.dll </WorkItemCommand>
</PropertyGroup>

<PropertyGroup Condition="'$(WorkItemCommand)' != ''">
<WorkItemCommand>$(Python) $(WorkItemCommand) -pmi_assemblies $(PmiAssembliesDirectory) -arch $(Architecture) -build_type $(BuildConfig) -core_root $(SuperPMIDirectory)</WorkItemCommand>
</PropertyGroup>

<PropertyGroup>
<EnableAzurePipelinesReporter>false</EnableAzurePipelinesReporter>
<EnableXUnitReporter>false</EnableXUnitReporter>
<WorkItemTimeout>5:00</WorkItemTimeout>
</PropertyGroup>

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

<ItemGroup>
<!-- libraries payload -->
<LibraryPartitions Include="$([System.IO.Directory]::GetDirectories($(LibrariesArtifacts)))"/>
<Partition Include="@(LibraryPartitions -> '%(Filename)')" PmiAssemblies="Core_Root$(FileSeparatorChar)%(Filename)" OutputMchName="libraries.pmi" PartitionId="%(Filename)" />

<!-- tests payload -->
<!-- TODO: Disable SPMI for P1 tests -->
<!-- <TestPartitions Include="$([System.IO.Directory]::GetDirectories($(TestsArtifacts)))"/>
<Partition Include="@(TestPartitions -> '%(Filename)')" PmiAssemblies="Tests$(FileSeparatorChar)%(Filename)" OutputMchName="tests.pmi" PartitionId="%(Filename)" /> -->
</ItemGroup>

<ItemGroup>
<HelixWorkItem Include="@(Partition)">
<OutputFileName>%(HelixWorkItem.OutputMchName).$(MchFileTag).%(HelixWorkItem.PartitionId)</OutputFileName>
<PayloadDirectory>$(PmiAssembliesPayload)$(FileSeparatorChar)%(HelixWorkItem.PmiAssemblies)</PayloadDirectory>
<Command>$(WorkItemCommand) -output_mch_path $(OutputMchPath)$(FileSeparatorChar)%(OutputFileName).mch -log_file $(OutputMchPath)$(FileSeparatorChar)%(OutputFileName).log</Command>
<Timeout>$(WorkItemTimeout)</Timeout>
<DownloadFilesFromResults>%(OutputFileName).mch;%(OutputFileName).mch.mct;%(OutputFileName).log</DownloadFilesFromResults>
</HelixWorkItem>
</ItemGroup>

<!--
This is useful for local testing to print the produced helix items
To use this when you are changing how items are produced, uncomment the target
and replace the Project item at the top of the file with this:
<Project DefaultTargets="printItems">

Once you've done that you can run this to see the results:
dotnet msbuild .\scenarios.proj /v:n
-->
<!--
<PropertyGroup>
<HelixTargetQueues>Some_Queue</HelixTargetQueues>
<LibrariesArtifacts>E:\temp\power\test1</LibrariesArtifacts>
<TestsArtifacts>E:\temp\power\test1</TestsArtifacts>
</PropertyGroup>
<Target Name="printItems">
<Message Text="@(HelixWorkItem -> 'name: %(HelixWorkItem.Identity)
dir: %(HelixWorkItem.PayloadDirectory)
pre: %(HelixWorkItem.PreCommands)
command: %(HelixWorkItem.Command)
post: %(HelixWorkItem.PostCommands)
timeout: %(HelixWorkItem.Timeout) '"/>
</Target>
-->

</Project>
53 changes: 53 additions & 0 deletions eng/common/templates/steps/superpmi-send-to-helix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Please remember to update the documentation if you make changes to these parameters!
parameters:
HelixSource: 'pr/default' # required -- sources must start with pr/, official/, prodcon/, or agent/
HelixType: 'tests/default/' # required -- Helix telemetry which identifies what type of data this is; should include "test" for clarity and must end in '/'
HelixBuild: $(Build.BuildNumber) # required -- the build number Helix will use to identify this -- automatically set to the AzDO build number
HelixTargetQueues: '' # required -- semicolon delimited list of Helix queues to test on; see https://helix.dot.net/ for a list of queues
HelixAccessToken: '' # required -- access token to make Helix API requests; should be provided by the appropriate variable group
HelixPreCommands: '' # optional -- commands to run before Helix work item execution
HelixPostCommands: '' # optional -- commands to run after Helix work item execution
WorkItemDirectory: '' # optional -- a payload directory to zip up and send to Helix; requires WorkItemCommand; incompatible with XUnitProjects
CorrelationPayloadDirectory: '' # optional -- a directory to zip up and send to Helix as a correlation payload
IncludeDotNetCli: false # optional -- true will download a version of the .NET CLI onto the Helix machine as a correlation payload; requires DotNetCliPackageType and DotNetCliVersion
DotNetCliPackageType: '' # optional -- either 'sdk' or 'runtime'; determines whether the sdk or runtime will be sent to Helix; see https://raw.githubusercontent.com/dotnet/core/master/release-notes/releases.json
DotNetCliVersion: '' # optional -- version of the CLI to send to Helix; based on this: https://raw.githubusercontent.com/dotnet/core/master/release-notes/releases.json
EnableXUnitReporter: false # optional -- true enables XUnit result reporting to Mission Control
WaitForWorkItemCompletion: true # optional -- true will make the task wait until work items have been completed and fail the build if work items fail. False is "fire and forget."
Creator: '' # optional -- if the build is external, use this to specify who is sending the job
DisplayNamePrefix: 'Send job to Helix' # optional -- rename the beginning of the displayName of the steps in AzDO
condition: succeeded() # optional -- condition for step to execute; defaults to succeeded()
continueOnError: false # optional -- determines whether to continue the build if the step errors; defaults to false
BuildConfig: 'checked' # optional -- Mostly, superpmi will be run on checked builds
LibrariesArtifacts: ''
TestsArtifacts: ''

steps:
- template: /eng/pipelines/common/templates/runtimes/send-to-helix-inner-step.yml
parameters:
osGroup: ${{ parameters.osGroup }}
sendParams: $(Build.SourcesDirectory)/eng/common/superpmi/superpmi.proj /restore /t:Test /bl:$(Build.SourcesDirectory)/artifacts/log/$(BuildConfig)/SendToHelix.binlog
displayName: ${{ parameters.DisplayNamePrefix }}
condition: ${{ parameters.condition }}
continueOnError: ${{ parameters.continueOnError }}
environment:
MchFileTag: $(MchFileTag)
BuildConfig: ${{ parameters.BuildConfig }}
LibrariesArtifacts: ${{ parameters.LibrariesArtifacts }}
TestsArtifacts: ${{ parameters.TestsArtifacts }}
HelixSource: ${{ parameters.HelixSource }}
HelixType: ${{ parameters.HelixType }}
HelixBuild: ${{ parameters.HelixBuild }}
HelixTargetQueues: ${{ parameters.HelixTargetQueues }}
HelixAccessToken: ${{ parameters.HelixAccessToken }}
HelixPreCommands: ${{ parameters.HelixPreCommands }}
HelixPostCommands: ${{ parameters.HelixPostCommands }}
WorkItemDirectory: ${{ parameters.WorkItemDirectory }}
CorrelationPayloadDirectory: ${{ parameters.CorrelationPayloadDirectory }}
IncludeDotNetCli: ${{ parameters.IncludeDotNetCli }}
DotNetCliPackageType: ${{ parameters.DotNetCliPackageType }}
DotNetCliVersion: ${{ parameters.DotNetCliVersion }}
EnableXUnitReporter: ${{ parameters.EnableXUnitReporter }}
WaitForWorkItemCompletion: ${{ parameters.WaitForWorkItemCompletion }}
Creator: ${{ parameters.Creator }}
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
66 changes: 66 additions & 0 deletions eng/pipelines/coreclr/superpmi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
trigger: none

pr: none

# schedules:
# - cron: "0 4 * * *"
# displayName: Daily at 8:00 PM (UTC-8:00)
# branches:
# include:
# - master
# always: true

jobs:
#
# Checkout repository
#
- template: /eng/pipelines/common/checkout-job.yml

- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/common/build-coreclr-and-libraries-job.yml
buildConfig: checked
platforms:
# Linux tests are built on the OSX machines.
# - OSX_x64
- Linux_arm
- Linux_arm64
- Linux_x64
- Windows_NT_x64
- Windows_NT_x86
- Windows_NT_arm64
- CoreClrTestBuildHost # Either OSX_x64 or Linux_x64
jobParameters:
testGroup: outerloop

# TODO: Disable SPMI for P1 tests
# - template: /eng/pipelines/common/platform-matrix.yml
# parameters:
# jobTemplate: /eng/pipelines/common/templates/runtimes/build-test-job.yml
# buildConfig: checked
# platforms:
# - CoreClrTestBuildHost # Either OSX_x64 or Linux_x64
# jobParameters:
# testGroup: outerloop
# liveLibrariesBuildConfig: Release

- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/coreclr/templates/superpmi-job.yml
buildConfig: checked
platforms:
# Linux tests are built on the OSX machines.
# - OSX_x64
- Linux_arm
- Linux_arm64
- Linux_x64
- Windows_NT_x64
- Windows_NT_x86
- Windows_NT_arm64
- CoreClrTestBuildHost # Either OSX_x64 or Linux_x64
helixQueueGroup: ci
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
jobParameters:
testGroup: outerloop
liveLibrariesBuildConfig: Release

143 changes: 143 additions & 0 deletions eng/pipelines/coreclr/templates/run-superpmi-job.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
parameters:
steps: [] # optional -- any additional steps that need to happen before pulling down the jitutils repo and sending the jitutils to helix (ie building your repo)
variables: [] # optional -- list of additional variables to send to the template
jobName: '' # required -- job name
displayName: '' # optional -- display name for the job. Will use jobName if not passed
pool: '' # required -- name of the Build pool
container: '' # required -- name of the container
buildConfig: '' # required -- build configuration
archType: '' # required -- targeting CPU architecture
osGroup: '' # required -- operating system for the job
osSubgroup: '' # optional -- operating system subgroup
extraSetupParameters: '' # optional -- extra arguments to pass to the setup script
frameworks: ['netcoreapp3.0'] # optional -- list of frameworks to run against
continueOnError: 'false' # optional -- determines whether to continue the build if the step errors
dependsOn: '' # optional -- dependencies of the job
timeoutInMinutes: 320 # optional -- timeout for the job
enableTelemetry: false # optional -- enable for telemetry
liveLibrariesBuildConfig: '' # optional -- live-live libraries configuration to use for the run
runtimeType: 'coreclr' # optional -- Sets the runtime as coreclr or mono
codeGenType: 'JIT' # optional -- Decides on the codegen technology if running on mono
projectFile: 'superpmi.proj' # optional -- project file to build helix workitems
runKind: '' # required -- test category

jobs:
- template: xplat-pipeline-job.yml
parameters:
dependsOn: ${{ parameters.dependsOn }}
buildConfig: ${{ parameters.buildConfig }}
archType: ${{ parameters.archType }}
osGroup: ${{ parameters.osGroup }}
osSubgroup: ${{ parameters.osSubgroup }}
liveLibrariesBuildConfig: ${{ parameters.liveLibrariesBuildConfig }}
enableTelemetry: ${{ parameters.enableTelemetry }}
enablePublishBuildArtifacts: true
continueOnError: ${{ parameters.continueOnError }}

${{ if ne(parameters.displayName, '') }}:
displayName: '${{ parameters.displayName }}'
${{ if eq(parameters.displayName, '') }}:
displayName: '${{ parameters.jobName }}'

timeoutInMinutes: ${{ parameters.timeoutInMinutes }}

variables:

- ${{ each variable in parameters.variables }}:
- ${{ if ne(variable.name, '') }}:
- name: ${{ variable.name }}
value: ${{ variable.value }}
- ${{ if ne(variable.group, '') }}:
- group: ${{ variable.group }}

- HelixApiAccessToken: ''
- HelixPreCommand: ''
- MchFileTag: '${{ parameters.osGroup }}.${{ parameters.archType }}.${{ parameters.buildConfig }}'

- ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
- name: PythonScript
value: 'py -3'
- name: PipScript
value: 'py -3 -m pip'
- name: Core_Root_Dir
value: '$(Build.SourcesDirectory)\artifacts\tests\coreclr\${{ parameters.osGroup }}.${{ parameters.archType }}.${{ parameters.buildConfig }}\Tests\Core_Root'
- name: MchFilesLocation
value: '$(Build.SourcesDirectory)\artifacts\helixresults\'
- ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
- name: PythonScript
value: 'python3'
- name: PipScript
value: 'pip3'
- name: Core_Root_Dir
value: '$(Build.SourcesDirectory)/artifacts/tests/coreclr/${{ parameters.osGroup }}.${{ parameters.archType }}.$(buildConfigUpper)/Tests/Core_Root'
- name: MchFilesLocation
value: '$(Build.SourcesDirectory)/artifacts/helixresults/'
workspace:
clean: all
pool:
${{ parameters.pool }}
container: ${{ parameters.container }}
strategy:
matrix:
${{ each framework in parameters.frameworks }}:
${{ framework }}:
_Framework: ${{ framework }}
steps:
- ${{ parameters.steps }}

- script: $(PythonScript) $(Build.SourcesDirectory)/src/coreclr/scripts/superpmi-setup.py -source_directory $(Build.SourcesDirectory) -core_root_directory $(Core_Root_Dir) -arch $(archType) -mch_file_tag $(MchFileTag) -libraries_directory $(Core_Root_Dir) -tests_directory $(managedTestArtifactRootFolderPath) -max_size 50 # size in MB
displayName: ${{ format('SuperPMI setup ({0})', parameters.osGroup) }}

# Run superpmi collection in helix
- template: /eng/common/templates/steps/superpmi-send-to-helix.yml
parameters:
HelixSource: '$(HelixSourcePrefix)/$(Build.Repository.Name)/$(Build.SourceBranch)' # sources must start with pr/, official/, prodcon/, or agent/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I beliueve this is no longer needed, this is automatically set by the Helix SDK nowadays.

HelixType: 'test/superpmi/$(Kind)/$(_Framework)/$(Architecture)'
HelixAccessToken: $(HelixApiAccessToken)
HelixTargetQueues: $(Queue)
HelixPreCommands: $(HelixPreCommand)
Creator: $(Creator)
WorkItemTimeout: 4:00 # 4 hours
WorkItemDirectory: '$(WorkItemDirectory)'
CorrelationPayloadDirectory: '$(CorrelationPayloadDirectory)'
ProjectFile: ${{ parameters.projectFile }}
BuildConfig: ${{ parameters.buildConfig }}
osGroup: ${{ parameters.osGroup }}
LibrariesArtifacts: '$(LibrariesArtifacts)'
TestsArtifacts: '$(TestsArtifacts)'

- task: PublishPipelineArtifact@1
displayName: Publish SuperPMI collection
inputs:
targetPath: $(Build.SourcesDirectory)/artifacts/helixresults
artifactName: 'SuperPMI_Result_$(osGroup)$(osSubgroup)_$(archType)_$(buildConfig)_${{ parameters.runtimeType }}_${{ parameters.codeGenType }}'
continueOnError: true
condition: always()

- script: $(PythonScript) $(Build.SourcesDirectory)/src/coreclr/scripts/superpmi.py merge-mch -pattern $(MchFilesLocation)libraries.pmi*.mch -output_mch_path $(MchFilesLocation)libraries.pmi.$(MchFileTag).mch
displayName: Merge libraries SuperPMI collections

# TODO: Disable SPMI for P1 tests
# - script: $(PythonScript) $(Build.SourcesDirectory)/src/coreclr/scripts/superpmi.py merge-mch -pattern $(MchFilesLocation)tests.pmi*.mch -output_mch_path $(MchFilesLocation)tests.pmi.$(MchFileTag).mch
# displayName: Merge tests SuperPMI collections

# For now, we won't upload merged collection as an artifact.

- script: $(PythonScript) $(Build.SourcesDirectory)/src/coreclr/scripts/superpmi.py upload -arch $(archType) -build_type $(buildConfig) -mch_files $(MchFilesLocation)libraries.pmi.$(MchFileTag).mch -core_root $(Build.SourcesDirectory)/artifacts/bin/coreclr/$(osGroup).x64.$(buildConfigUpper)
displayName: Upload SuperPMI libraries collection to Azure Storage
env:
CLRJIT_AZ_KEY: $(clrjit_key1) # secret key stored as variable in pipeline

# TODO: Disable SPMI for P1 tests
# - script: $(PythonScript) $(Build.SourcesDirectory)/src/coreclr/scripts/superpmi.py upload -arch $(archType) -build_type $(buildConfig) $(MchFilesLocation)tests.pmi.$(MchFileTag).mch -core_root $(Build.SourcesDirectory)/artifacts/bin/coreclr/$(osGroup).x64.$(buildConfigUpper)
# displayName: Upload SuperPMI tests collection to Azure Storage
# env:
# CLRJIT_AZ_KEY: $(clrjit_key1) # secret key stored as variable in pipeline

- task: PublishPipelineArtifact@1
displayName: Publish Logs
inputs:
targetPath: $(Build.SourcesDirectory)/artifacts/log
artifactName: 'SuperPMI_Logs_$(osGroup)$(osSubgroup)_$(archType)_$(buildConfig)_${{ parameters.runtimeType }}_${{ parameters.codeGenType }}_${{ parameters.runKind }}'
continueOnError: true
condition: always()
Loading