Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spmi replay pipeline #56871

Merged
66 commits merged into from
Aug 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
9c1284e
Add superpmi-replay pipeline file
kunalspathak Jul 28, 2021
60b44b4
Add superpmi-replay-job.yml that downloads collection
kunalspathak Jul 28, 2021
1919da8
Moved superpmi-replay-job to right location
kunalspathak Jul 28, 2021
f85e072
make sure to have spmi collection after jit build
kunalspathak Jul 28, 2021
224adcd
annotate displayName with windows/OSX
kunalspathak Jul 28, 2021
33072e3
Make osGroup=windows
kunalspathak Jul 29, 2021
207ce41
Add helixType (if that matters)
kunalspathak Jul 29, 2021
84e3dfe
Add some more variables
kunalspathak Jul 29, 2021
2b232d0
skip restore internal tools
kunalspathak Jul 29, 2021
971d198
Just use build-jit-job directly
kunalspathak Jul 29, 2021
bc571f9
Hardcode windows.x64.checked
kunalspathak Jul 29, 2021
f7f77ae
Add -download_all -download_raw options to superpmi.py
kunalspathak Jul 29, 2021
a7bdc5d
Seperate 2 jobs
kunalspathak Jul 29, 2021
fabab8a
Fix Upload artifacts
kunalspathak Jul 29, 2021
9f8a0ba
Fix uploadAsArtifacts
kunalspathak Jul 29, 2021
08650f6
Fix to uploadAsArtifacts
kunalspathak Jul 29, 2021
d14111f
comment upload to azure storage temporarily
kunalspathak Jul 29, 2021
a3916fe
Set variables inside superpmi-replay-job
kunalspathak Jul 29, 2021
fcd9855
Entire pipeline
kunalspathak Jul 30, 2021
dd12070
minor fix
kunalspathak Jul 30, 2021
b136c9d
Add some logging
kunalspathak Jul 30, 2021
333927e
Fix the path
kunalspathak Jul 30, 2021
c8f75f5
fix file names and partition ids
kunalspathak Aug 2, 2021
4ed4cc0
add sample download on helix machine
kunalspathak Aug 2, 2021
f0a9ae8
fix helix-correlation-payload
kunalspathak Aug 2, 2021
4da534d
Download specific build
kunalspathak Aug 2, 2021
9cb6da8
Try to fix correlation payload directory
kunalspathak Aug 2, 2021
12287f6
Do not run windows x86 for now
kunalspathak Aug 2, 2021
c901a70
Log directory
kunalspathak Aug 2, 2021
8dda3f1
walktree instead of dir
kunalspathak Aug 2, 2021
af25275
fix the bug
kunalspathak Aug 2, 2021
2fc1495
Add workitem directory as Payload
kunalspathak Aug 2, 2021
60c86e5
TEMP: Skip downloading collection during setup
kunalspathak Aug 3, 2021
3ec4a84
fix core_root
kunalspathak Aug 3, 2021
966a530
Make download happen on helix
kunalspathak Aug 3, 2021
494e7ab
Add windows x86
kunalspathak Aug 3, 2021
e7ab499
Use -target_os and pass 1 item to helix
kunalspathak Aug 3, 2021
eea085f
Add some logging, have different work item ID
kunalspathak Aug 3, 2021
283f211
fix the superpmi.log upload
kunalspathak Aug 3, 2021
f1e914b
Fix the log location
kunalspathak Aug 3, 2021
92e3d55
one more fix to log_directory
kunalspathak Aug 3, 2021
93edb83
try to fix download results
kunalspathak Aug 3, 2021
20db184
Move the matrix to proj file
kunalspathak Aug 3, 2021
bcc6c36
fix superpmi-replay.proj
kunalspathak Aug 3, 2021
8b50c09
Cleanup
kunalspathak Aug 3, 2021
e35562e
Go back to download specific
kunalspathak Aug 4, 2021
7033211
WorkTimeout for 5 hours
kunalspathak Aug 4, 2021
4edf41d
Remove timeoutInMinutes
kunalspathak Aug 4, 2021
244693f
fix errors related to logging
kunalspathak Aug 4, 2021
9794f4c
return failed run result
kunalspathak Aug 4, 2021
dc5ca48
fix the appending logic
kunalspathak Aug 4, 2021
b9ba241
Remove download-all and download-raw and instead add -no-progres
kunalspathak Aug 4, 2021
4d97688
do not show download progress, try fixing download file
kunalspathak Aug 4, 2021
53eb396
TO REVERT: Just try benchmark on windows x64/x86
kunalspathak Aug 4, 2021
0c12c61
Use uploadAsArtifacts in build-jit-job
kunalspathak Aug 4, 2021
4a48c37
Create dummy.txt in workitem directory
kunalspathak Aug 4, 2021
1c14146
create workitem_directory
kunalspathak Aug 5, 2021
8fbcace
Build clrjit
kunalspathak Aug 5, 2021
5a3168d
fix build-jit-job
kunalspathak Aug 5, 2021
f796b6a
add dependsOn
kunalspathak Aug 5, 2021
deeb625
print params
kunalspathak Aug 5, 2021
faa8294
TO REVERT: Just run jitbuild win-x64
kunalspathak Aug 5, 2021
7c73aa6
minor
kunalspathak Aug 5, 2021
b06725f
move under jobParameters
kunalspathak Aug 5, 2021
a729794
Cleanup
kunalspathak Aug 5, 2021
c8dc88a
review feedback
kunalspathak Aug 11, 2021
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
29 changes: 29 additions & 0 deletions eng/pipelines/common/download-specific-artifact-step.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
parameters:
unpackFolder: ''
cleanUnpackFolder: true
artifactFileName: ''
artifactName: ''
displayName: ''

steps:
# Download artifact
- task: DownloadBuildArtifacts@0
displayName: 'Download specific ${{ parameters.displayName }}'
inputs:
buildType: specific
project: 'internal' # 'internal' or 'public'
pipeline: 'superpmi-replay'
buildVersionToDownload: specific
branchName: 'your/branch/having/artifacts'
buildId: '1274841'
downloadType: single
downloadPath: '$(Build.SourcesDirectory)/__download__'
artifactName: '${{ parameters.artifactName }}'

# Unzip artifact
- task: ExtractFiles@1
displayName: 'Unzip specific ${{ parameters.displayName }}'
inputs:
archiveFilePatterns: $(Build.SourcesDirectory)/__download__/${{ parameters.artifactName }}/${{ parameters.artifactFileName }}
destinationFolder: ${{ parameters.unpackFolder }}
cleanDestinationFolder: ${{ parameters.cleanUnpackFolder }}
35 changes: 35 additions & 0 deletions eng/pipelines/coreclr/superpmi-replay.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
trigger:
batch: false
branches:
include:
- main
paths:
include:
- src/coreclr/jit/*
- src/coreclr/inc/jiteeversionguid.h

# This pipeline is supposed to be run only on merged changes
# and should not be triggerable from a PR.
pr: none

jobs:

- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/coreclr/templates/build-jit-job.yml
buildConfig: checked
platforms:
- windows_x64
- windows_x86
jobParameters:
uploadAs: 'pipelineArtifacts'

- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/coreclr/templates/superpmi-replay-job.yml
buildConfig: checked
platforms:
- windows_x64
- windows_x86
helixQueueGroup: ci
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
36 changes: 26 additions & 10 deletions eng/pipelines/coreclr/templates/build-jit-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ parameters:
timeoutInMinutes: ''
variables: {}
dependOnEvaluatePaths: false
uploadAs: 'azureBlob'

### Product build
jobs:
Expand Down Expand Up @@ -49,6 +50,8 @@ jobs:

- name: publishLogsArtifactPrefix
value: 'BuildLogs_CoreCLR_JIT'
- name: uploadAs
value: ${{ parameters.uploadAs }}

- name: compilerArg
value: ''
Expand Down Expand Up @@ -85,11 +88,11 @@ jobs:
# preinstalled, so we only need this step for OSX and Windows.
- ${{ if eq(parameters.osGroup, 'OSX') }}:
- script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup) ${{ parameters.archType }} azDO
displayName: Install native dependencies
displayName: Install native dependencies (OSX)
- ${{ if eq(parameters.osGroup, 'windows') }}:
# Necessary to install python
- script: $(Build.SourcesDirectory)\eng\common\init-tools-native.cmd -InstallDirectory $(Build.SourcesDirectory)\native-tools -Force
displayName: Install native dependencies
displayName: Install native dependencies (windows)

# Install internal tools on official builds
# Since our internal tools are behind an authenticated feed,
Expand All @@ -106,14 +109,27 @@ jobs:
- script: set __TestIntermediateDir=int&&$(Build.SourcesDirectory)/src/coreclr/build-runtime$(scriptExt) $(buildConfig) $(archType) -ci -nopgooptimize -skiprestoreoptdata -component alljits
displayName: Build CoreCLR JIT

# Ensure the Python azure-storage-blob package is installed before doing the upload.
- script: $(PipScript) install --user --upgrade pip && $(PipScript) install --user azure.storage.blob==12.5.0 --force-reinstall
displayName: Upgrade Pip to latest and install azure-storage-blob Python package

- script: $(PythonScript) $(Build.SourcesDirectory)/src/coreclr/scripts/jitrollingbuild.py upload -build_type $(buildConfig) -arch $(archType) -host_os $(osGroup) -git_hash $(Build.SourceVersion)
displayName: Upload JIT to Azure Storage
env:
CLRJIT_AZ_KEY: $(clrjit_key1) # secret key stored as variable in pipeline
- ${{ if eq(parameters.uploadAs, 'azureBlob') }}:
# Ensure the Python azure-storage-blob package is installed before doing the upload.
- script: $(PipScript) install --user --upgrade pip && $(PipScript) install --user azure.storage.blob==12.5.0 --force-reinstall
displayName: Upgrade Pip to latest and install azure-storage-blob Python package

- script: $(PythonScript) $(Build.SourcesDirectory)/src/coreclr/scripts/jitrollingbuild.py upload -build_type $(buildConfig) -arch $(archType) -host_os $(osGroup) -git_hash $(Build.SourceVersion)
displayName: Upload JIT to Azure Storage
env:
CLRJIT_AZ_KEY: $(clrjit_key1) # secret key stored as variable in pipeline

- ${{ if eq(parameters.uploadAs, 'pipelineArtifacts') }}:
# Publish product output directory for consumption by tests.
- template: /eng/pipelines/common/upload-artifact-step.yml
parameters:
rootFolder: $(buildProductRootFolderPath)
includeRootFolder: false
archiveType: $(archiveType)
tarCompression: $(tarCompression)
archiveExtension: $(archiveExtension)
artifactName: $(buildProductArtifactName)
displayName: 'product build'

# Publish Logs
- task: PublishPipelineArtifact@1
Expand Down
3 changes: 1 addition & 2 deletions eng/pipelines/coreclr/templates/run-superpmi-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ parameters:
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
collectionType: ''
collectionName: ''
Expand Down Expand Up @@ -144,7 +143,7 @@ jobs:
WorkItemTimeout: 4:00 # 4 hours
WorkItemDirectory: '$(WorkItemDirectory)'
CorrelationPayloadDirectory: '$(CorrelationPayloadDirectory)'
ProjectFile: ${{ parameters.projectFile }}
ProjectFile: 'superpmi.proj'
BuildConfig: ${{ parameters.buildConfig }}
osGroup: ${{ parameters.osGroup }}
InputArtifacts: '$(InputArtifacts)'
Expand Down
125 changes: 125 additions & 0 deletions eng/pipelines/coreclr/templates/run-superpmi-replay-job.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
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
runKind: '' # required -- test category
collectionType: ''
collectionName: ''
dependOnEvaluatePaths: false

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 }}
collectionType: $ {{ parameters.collectionType }}
collectionName: ${{ parameters.collectionName }}
dependOnEvaluatePaths: ${{ parameters.dependOnEvaluatePaths }}
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}

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

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

- name: PythonScript
value: 'py -3'
- name: PipScript
value: 'py -3 -m pip'
- name: SpmiCollectionLocation
value: '$(Build.SourcesDirectory)\artifacts\spmi\'
- name: SpmiLogsLocation
value: '$(Build.SourcesDirectory)\artifacts\spmi_logs\'
- name: HelixResultLocation
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: |
mkdir -p $(SpmiCollectionLocation)
displayName: Create directory for SPMI collection

- script: $(PythonScript) $(Build.SourcesDirectory)/src/coreclr/scripts/superpmi_replay_setup.py -source_directory $(Build.SourcesDirectory) -product_directory $(buildProductRootFolderPath) -arch $(archType)
displayName: ${{ format('SuperPMI replay setup ({0} {1})', parameters.osGroup, parameters.archType) }}

# Run superpmi replay in helix
- template: /eng/pipelines/coreclr/templates/superpmi-send-to-helix.yml
parameters:
HelixSource: '$(HelixSourcePrefix)/$(Build.Repository.Name)/$(Build.SourceBranch)' # sources must start with pr/, official/, prodcon/, or agent/
HelixAccessToken: $(HelixApiAccessToken)
HelixTargetQueues: $(Queue)
HelixPreCommands: $(HelixPreCommand)
Creator: $(Creator)
WorkItemTimeout: 4:00 # 4 hours
WorkItemDirectory: '$(WorkItemDirectory)'
CorrelationPayloadDirectory: '$(CorrelationPayloadDirectory)'
ProjectFile: 'superpmi-replay.proj'
BuildConfig: ${{ parameters.buildConfig }}
osGroup: ${{ parameters.osGroup }}
archType: ${{ parameters.archType }}
continueOnError: true # Run the future step i.e. upload superpmi logs

# Always upload the available logs for diagnostics
- task: CopyFiles@2
displayName: Copying superpmi.log of all partitions
inputs:
sourceFolder: '$(HelixResultLocation)'
contents: '**/superpmi_*.log'
targetFolder: '$(SpmiLogsLocation)'
condition: always()

- task: PublishPipelineArtifact@1
displayName: Publish Superpmi logs
inputs:
targetPath: $(SpmiLogsLocation)
artifactName: 'SuperPMI_Logs_$(archType)_$(buildConfig)'
condition: always()

- task: PublishPipelineArtifact@1
displayName: Publish SuperPMI build logs
inputs:
targetPath: $(Build.SourcesDirectory)/artifacts/log
artifactName: 'SuperPMI_BuildLogs__$(archType)_$(buildConfig)'
condition: always()
1 change: 0 additions & 1 deletion eng/pipelines/coreclr/templates/superpmi-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ jobs:
liveLibrariesBuildConfig: ${{ parameters.liveLibrariesBuildConfig }}
runtimeType: ${{ parameters.runtimeType }}
codeGenType: ${{ parameters.codeGenType }}
projectFile: ${{ parameters.projectFile }}
runKind: ${{ parameters.runKind }}
testGroup: ${{ parameters.testGroup }}
collectionType: ${{ parameters.collectionType }}
Expand Down
43 changes: 43 additions & 0 deletions eng/pipelines/coreclr/templates/superpmi-replay-job.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
parameters:
buildConfig: '' # required -- build configuration
archType: '' # required -- targeting CPU architecture
osGroup: '' # required -- operating system for the job
osSubgroup: '' # optional -- operating system subgroup
pool: ''
stagedBuild: false
timeoutInMinutes: 320 # build timeout
framework: net5.0 # Specify the appropriate framework when running release branches (ie netcoreapp3.0 for release/3.0)
variables: {}
dependOnEvaluatePaths: false
runJobTemplate: '/eng/pipelines/coreclr/templates/run-superpmi-replay-job.yml'

jobs:
- template: ${{ parameters.runJobTemplate }}
parameters:
jobName: ${{ format('superpmibuild_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }}
displayName: ${{ format('SuperPMI replay {0} {1}', parameters.osGroup, parameters.archType) }}
pool: ${{ parameters.pool }}
buildConfig: ${{ parameters.buildConfig }}
archType: ${{ parameters.archType }}
osGroup: ${{ parameters.osGroup }}
osSubgroup: ${{ parameters.osSubgroup }}
dependOnEvaluatePaths: ${{ parameters.dependOnEvaluatePaths }}
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
additionalSetupParameters: ${{ parameters.additionalSetupParameters }}
dependsOn:
- ${{ format('coreclr_jit_build_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }}

variables: ${{ parameters.variables }}

frameworks:
- ${{ parameters.framework }}

steps:

# Download jit builds
- template: /eng/pipelines/common/download-artifact-step.yml
parameters:
unpackFolder: $(buildProductRootFolderPath)
artifactFileName: '$(buildProductArtifactName)$(archiveExtension)'
artifactName: '$(buildProductArtifactName)'
displayName: 'JIT product build'
3 changes: 2 additions & 1 deletion eng/pipelines/coreclr/templates/superpmi-send-to-helix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ parameters:
InputArtifacts: ''
CollectionType: ''
CollectionName: ''
ProjectFile: ''

steps:
- template: /eng/pipelines/common/templates/runtimes/send-to-helix-inner-step.yml
parameters:
osGroup: ${{ parameters.osGroup }}
sendParams: $(Build.SourcesDirectory)/src/coreclr/scripts/superpmi.proj /restore /t:Test /bl:$(Build.SourcesDirectory)/artifacts/log/$(BuildConfig)/SendToHelix.binlog
sendParams: $(Build.SourcesDirectory)/src/coreclr/scripts/${{ parameters.ProjectFile }} /restore /t:Test /bl:$(Build.SourcesDirectory)/artifacts/log/$(BuildConfig)/SendToHelix.binlog
displayName: ${{ parameters.DisplayNamePrefix }}
condition: ${{ parameters.condition }}
shouldContinueOnError: ${{ parameters.continueOnError }}
Expand Down
Loading