From 90f2e9b11e2a7af44173ecc4bcd119bd07fb789d Mon Sep 17 00:00:00 2001 From: Bruce Forstall Date: Sun, 20 Aug 2023 23:08:23 -0700 Subject: [PATCH 01/28] Enable libraries run collection --- eng/pipelines/coreclr/superpmi-collect.yml | 26 ++++ eng/pipelines/libraries/helix.yml | 6 + eng/pipelines/libraries/run-test-job.yml | 132 +++++++++++++++++++ eng/testing/tests.targets | 82 +++++++++++- src/libraries/sendtohelix.proj | 26 +++- src/libraries/sendtohelixhelp.proj | 48 +++++++ src/tests/Common/helixpublishwitharcade.proj | 4 +- 7 files changed, 317 insertions(+), 7 deletions(-) diff --git a/eng/pipelines/coreclr/superpmi-collect.yml b/eng/pipelines/coreclr/superpmi-collect.yml index 4c66b20aecbc7..a2c30dbebe138 100644 --- a/eng/pipelines/coreclr/superpmi-collect.yml +++ b/eng/pipelines/coreclr/superpmi-collect.yml @@ -234,3 +234,29 @@ extends: testGroup: outerloop liveLibrariesBuildConfig: Release SuperPmiCollect: true + + # + # Collection of libraries test run + # Libraries Test Run using Release libraries, and Checked CoreCLR + # + - template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/libraries/run-test-job.yml + buildConfig: Release + platforms: + - osx_arm64 + - linux_arm + - linux_arm64 + - linux_x64 + - windows_x64 + - windows_x86 + - windows_arm64 + helixQueueGroup: superpmi + helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml + jobParameters: + testScope: innerloop + liveRuntimeBuildConfig: checked + dependsOnTestBuildConfiguration: Release + dependsOnTestArchitecture: x64 + coreclrTestGroup: superpmi_collection + SuperPmiCollect: true \ No newline at end of file diff --git a/eng/pipelines/libraries/helix.yml b/eng/pipelines/libraries/helix.yml index f63792367fe78..03b3cf1ebaffc 100644 --- a/eng/pipelines/libraries/helix.yml +++ b/eng/pipelines/libraries/helix.yml @@ -13,6 +13,9 @@ parameters: extraHelixArguments: '' shouldContinueOnError: false scenarios: '' + SuperPmiCollect: '' + SuperPmiCollectionType: '' + SuperPmiCollectionName: '' steps: - script: $(_msbuildCommand) $(_warnAsErrorParamHelixOverride) -restore @@ -34,6 +37,9 @@ steps: env: SYSTEM_ACCESSTOKEN: $(System.AccessToken) # We need to set this env var to publish helix results to Azure Dev Ops _Scenarios: ${{ join(',', parameters.scenarios) }} # Pass scenarios to MSBuild as env var to avoid need of escaping comma separated list + _SuperPmiCollect: ${{ parameters.SuperPmiCollect }} + _SuperPmiCollectionType: ${{ parameters.SuperPmiCollectionType }} + _SuperPmiCollectionName: ${{ parameters.SuperPmiCollectionName }} ${{ if eq(variables['System.TeamProject'], 'internal') }}: HelixAccessToken: $(HelixApiAccessToken) diff --git a/eng/pipelines/libraries/run-test-job.yml b/eng/pipelines/libraries/run-test-job.yml index 4fe91d22a9312..c9138068c2d7f 100644 --- a/eng/pipelines/libraries/run-test-job.yml +++ b/eng/pipelines/libraries/run-test-job.yml @@ -23,6 +23,7 @@ parameters: # stress modes that each test will be run with. This is the same usage as 'testGroup' in # eng/pipelines/common/templates/runtimes/run-test-job.yml. coreclrTestGroup: '' + SuperPmiCollect: false dependsOn: [] jobs: @@ -64,11 +65,48 @@ jobs: - ${{ format('libraries_build_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} - ${{ if ne(parameters.liveRuntimeBuildConfig, '') }}: - ${{ format('{0}_{1}_product_build_{2}{3}_{4}_{5}', parameters.runtimeFlavor, parameters.runtimeVariant, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.liveRuntimeBuildConfig) }} + # SuperPMI collection needs to run mcs.exe on the AzDO machine. Assume that's an x64 machine, and download an x64 product build if needed. + - ${{ if and(eq(parameters.SuperPmiCollect, true), ne(parameters.archType, 'x64')) }}: + - ${{ format('coreclr_{0}_product_build_{1}{2}_{3}_{4}', '', parameters.osGroup, parameters.osSubgroup, 'x64', parameters.buildConfig) }} variables: - librariesTestsArtifactName: ${{ format('libraries_test_assets_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} - _archiveTestsParameter: /p:ArchiveTests=true + # Variables used for SuperPMI collection + - name: CollectionType + value: '' + - name: CollectionName + value: '' + - ${{ if eq(parameters.SuperPmiCollect, true) }}: + - MchFileTag: '${{ parameters.osGroup }}.${{ parameters.archType }}.${{ parameters.buildConfig }}' + - name: CollectionType + value: 'run' + - name: CollectionName + value: 'libraries_tests' + - ${{ if eq(parameters.osGroup, 'windows') }}: + - name: PythonScript + value: 'py -3' + - name: PipScript + value: 'py -3 -m pip' + - name: MchFilesLocation + value: '$(Build.SourcesDirectory)\artifacts\helixresults\' + - name: MergedMchFileLocation + value: '$(Build.SourcesDirectory)\artifacts\spmi_collection\' + - name: SpmiLogsLocation + value: '$(Build.SourcesDirectory)\artifacts\spmi_logs\' + - ${{ if ne(parameters.osGroup, 'windows') }}: + - name: PythonScript + value: 'python3' + - name: PipScript + value: 'pip3' + - name: MchFilesLocation + value: '$(Build.SourcesDirectory)/artifacts/helixresults/' + - name: MergedMchFileLocation + value: '$(Build.SourcesDirectory)/artifacts/spmi_collection/' + - name: SpmiLogsLocation + value: '$(Build.SourcesDirectory)/artifacts/spmi_logs/' + - ${{ parameters.variables }} steps: @@ -100,6 +138,15 @@ jobs: /bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/overrideRuntimeFromLiveDrop.binlog displayName: Prepare TestHost with runtime $(runtimeFlavorName) + # SuperPMI collection: Download x64 coreclr if running on non-x64 configuration (needed for mcs.exe) + - ${{ if and(eq(parameters.SuperPmiCollect, true), ne(parameters.archType, 'x64')) }}: + - template: /eng/pipelines/common/download-artifact-step.yml + parameters: + unpackFolder: '$(Build.SourcesDirectory)/artifacts/bin/coreclr/$(osGroup).x64.$(buildConfigUpper)' + artifactFileName: 'CoreCLRProduct___$(osGroup)$(osSubgroup)_x64_$(buildConfig)$(archiveExtension)' + artifactName: 'CoreCLRProduct___$(osGroup)$(osSubgroup)_x64_$(buildConfig)' + displayName: 'CoreCLR product build (x64)' + - template: /eng/pipelines/libraries/helix.yml parameters: runtimeFlavor: ${{ parameters.runtimeFlavor }} @@ -113,6 +160,9 @@ jobs: shouldContinueOnError: ${{ parameters.shouldContinueOnError }} creator: dotnet-bot testRunNamePrefixSuffix: $(_testRunNamePrefixSuffix) + SuperPmiCollect: ${{ parameters.SuperPmiCollect }} + SuperPmiCollectionType: $(CollectionType) + SuperPmiCollectionName: $(CollectionName) # coreclrTestGroup: The following mappings of 'coreclrTestGroup' to 'scenarios' is copied from # eng/pipelines/common/templates/runtimes/run-test-job.yml (with 'testGroup' replaced by 'coreclrTestGroup' @@ -137,6 +187,10 @@ jobs: ${{ else }}: extraHelixArguments: $(_extraHelixArguments) + ${{ if in(parameters.coreclrTestGroup, 'superpmi_collection') }}: + scenarios: + - normal + - no_tiered_compilation ${{ if in(parameters.coreclrTestGroup, 'jitstress') }}: scenarios: - no_tiered_compilation @@ -205,3 +259,81 @@ jobs: - syntheticpgo - syntheticpgo_blend + ######################################################################################################## + # + # Finalize SuperPMI collection: (1) merge all MCH files generated by all Helix jobs, (2) upload MCH file to Azure Storage, (3) upload log files + # Note that all these steps are "condition: always()" because we want to upload as much of the collection + # as possible, even if there were test failures. + # + ######################################################################################################## + + - ${{ if eq(parameters.SuperPmiCollect, true) }}: + + # Create required directories for merged mch collection and superpmi logs + - ${{ if ne(parameters.osGroup, 'windows') }}: + - script: | + mkdir -p $(MergedMchFileLocation) + mkdir -p $(SpmiLogsLocation) + displayName: Create SuperPMI directories + condition: always() + - ${{ if eq(parameters.osGroup, 'windows') }}: + - script: | + mkdir $(MergedMchFileLocation) + mkdir $(SpmiLogsLocation) + displayName: Create SuperPMI directories + condition: always() + + - script: $(PythonScript) $(Build.SourcesDirectory)/src/coreclr/scripts/superpmi.py merge-mch -log_level DEBUG -pattern $(MchFilesLocation)$(CollectionName).$(CollectionType)*.mch -output_mch_path $(MergedMchFileLocation)$(CollectionName).$(CollectionType).$(MchFileTag).mch + displayName: 'Merge $(CollectionName)-$(CollectionType) SuperPMI collections' + condition: always() + + - template: /eng/pipelines/common/upload-artifact-step.yml + parameters: + rootFolder: $(MergedMchFileLocation) + includeRootFolder: false + archiveType: $(archiveType) + tarCompression: $(tarCompression) + archiveExtension: $(archiveExtension) + artifactName: 'SuperPMI_Collection_$(CollectionName)_$(CollectionType)_$(osGroup)$(osSubgroup)_$(archType)_$(buildConfig)' + displayName: 'Upload artifacts SuperPMI $(CollectionName)-$(CollectionType) collection' + condition: always() + + # Add authenticated pip feed + - task: PipAuthenticate@1 + displayName: 'Pip Authenticate' + inputs: + artifactFeeds: public/dotnet-public-pypi + onlyAddExtraIndex: false + condition: always() + + # 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 + condition: always() + + - script: $(PythonScript) $(Build.SourcesDirectory)/src/coreclr/scripts/superpmi.py upload -log_level DEBUG -arch $(archType) -build_type $(buildConfig) -mch_files $(MergedMchFileLocation)$(CollectionName).$(CollectionType).$(MchFileTag).mch -core_root $(Build.SourcesDirectory)/artifacts/bin/coreclr/$(osGroup).x64.$(buildConfigUpper) + displayName: 'Upload SuperPMI $(CollectionName)-$(CollectionType) collection to Azure Storage' + condition: always() + env: + CLRJIT_AZ_KEY: $(clrjit_key1) # secret key stored as variable in pipeline + + - task: CopyFiles@2 + displayName: Copying superpmi.log of all partitions + inputs: + sourceFolder: '$(MchFilesLocation)' + contents: '**/$(CollectionName).$(CollectionType)*.log' + targetFolder: '$(SpmiLogsLocation)' + condition: always() + + - task: PublishPipelineArtifact@1 + displayName: Publish SuperPMI logs + inputs: + targetPath: $(SpmiLogsLocation) + artifactName: 'SuperPMI_Logs_$(CollectionName)_$(CollectionType)_$(osGroup)$(osSubgroup)_$(archType)_$(buildConfig)' + condition: always() + + ######################################################################################################## + # + # End of SuperPMI processing + # + ######################################################################################################## diff --git a/eng/testing/tests.targets b/eng/testing/tests.targets index f4bf46cd298cb..25f2c0656bdb2 100644 --- a/eng/testing/tests.targets +++ b/eng/testing/tests.targets @@ -93,8 +93,19 @@ + + + + + + + - + + $(RunScriptCommand) $RSP_FILE @@ -111,6 +122,10 @@ + + + + - + + + + + + + + + + + + + + + + + + diff --git a/src/libraries/sendtohelix.proj b/src/libraries/sendtohelix.proj index 354064b4dc014..eb49efc40ab60 100644 --- a/src/libraries/sendtohelix.proj +++ b/src/libraries/sendtohelix.proj @@ -46,12 +46,17 @@ Creator=$(Creator); HelixAccessToken=$(HelixAccessToken); HelixTargetQueues=$(HelixTargetQueues); - BuildTargetFramework=$(BuildTargetFramework) + BuildTargetFramework=$(BuildTargetFramework); + Scenarios=$(_Scenarios); + SuperPmiCollect=$(_SuperPmiCollect); + SuperPmiCollectionType=$(_SuperPmiCollectionType); + SuperPmiCollectionName=$(_SuperPmiCollectionName) <_DebuggerHosts Condition="'$(_DebuggerHosts)' == ''">$(DebuggerHost) <_DebuggerHosts Condition="'$(_DebuggerHosts)' == ''">chrome + @@ -62,7 +67,7 @@ - + $(MSBuildThisFileDirectory)sendtohelixhelp.proj @@ -195,6 +200,21 @@ SkipUnchangedFiles="true" /> + + + + + + + <_SuperPmiScriptsFiles Include="$(RepoRoot)src\coreclr\scripts\*.py" /> + + + + + + + + DependsOnTargets="CreateAllScenarioTestEnvFiles;PrepareSuperPmiCollectCorrelationPayload;CompressRuntimeDirectory" > diff --git a/src/libraries/sendtohelixhelp.proj b/src/libraries/sendtohelixhelp.proj index 6c04a4365065f..a8b2a256f8725 100644 --- a/src/libraries/sendtohelixhelp.proj +++ b/src/libraries/sendtohelixhelp.proj @@ -64,6 +64,9 @@ dotnet-latest dotnet-none + false + + @@ -130,6 +133,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -288,6 +335,7 @@ %(Identity) $(HelixCommand) $(_workItemTimeout) + $(SuperPmiCollectionName).$(SuperPmiCollectionType).$(TargetOS).$(TargetArchitecture).$(Configuration).mch;$(SuperPmiCollectionName).$(SuperPmiCollectionType).$(TargetOS).$(TargetArchitecture).$(Configuration).log diff --git a/src/tests/Common/helixpublishwitharcade.proj b/src/tests/Common/helixpublishwitharcade.proj index 3fa699ce6cfb3..43f2f4dbb63a5 100644 --- a/src/tests/Common/helixpublishwitharcade.proj +++ b/src/tests/Common/helixpublishwitharcade.proj @@ -695,7 +695,7 @@ - + @@ -742,7 +742,7 @@ - + From 4b2c4d970e5f135af8da93e1b9f35980bfbbff79 Mon Sep 17 00:00:00 2001 From: Bruce Forstall Date: Sun, 20 Aug 2023 23:14:13 -0700 Subject: [PATCH 02/28] [TEST ONLY] Comment out collections Leave only new libraries run collection, for testing new code, and 'realworld' to make sure I didn't break anything fundamental. --- eng/pipelines/coreclr/superpmi-collect.yml | 282 ++++++++++----------- 1 file changed, 141 insertions(+), 141 deletions(-) diff --git a/eng/pipelines/coreclr/superpmi-collect.yml b/eng/pipelines/coreclr/superpmi-collect.yml index a2c30dbebe138..bbcefc519e600 100644 --- a/eng/pipelines/coreclr/superpmi-collect.yml +++ b/eng/pipelines/coreclr/superpmi-collect.yml @@ -73,65 +73,65 @@ extends: jobParameters: testGroup: outerloop - - template: /eng/pipelines/common/platform-matrix.yml - parameters: - jobTemplate: /eng/pipelines/coreclr/templates/superpmi-collect-job.yml - buildConfig: checked - platforms: - - osx_arm64 - - linux_arm - - linux_arm64 - - linux_x64 - - windows_x64 - - windows_x86 - - windows_arm64 - helixQueueGroup: ci - helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml - jobParameters: - testGroup: outerloop - liveLibrariesBuildConfig: Release - collectionType: pmi - collectionName: libraries - - - template: /eng/pipelines/common/platform-matrix.yml - parameters: - jobTemplate: /eng/pipelines/coreclr/templates/superpmi-collect-job.yml - buildConfig: checked - platforms: - - osx_arm64 - - linux_arm - - linux_arm64 - - linux_x64 - - windows_x64 - - windows_x86 - - windows_arm64 - helixQueueGroup: ci - helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml - jobParameters: - testGroup: outerloop - liveLibrariesBuildConfig: Release - collectionType: pmi - collectionName: libraries_tests - - - template: /eng/pipelines/common/platform-matrix.yml - parameters: - jobTemplate: /eng/pipelines/coreclr/templates/superpmi-collect-job.yml - buildConfig: checked - platforms: - - osx_arm64 - - linux_arm - - linux_arm64 - - linux_x64 - - windows_x64 - - windows_x86 - - windows_arm64 - helixQueueGroup: ci - helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml - jobParameters: - testGroup: outerloop - liveLibrariesBuildConfig: Release - collectionType: crossgen2 - collectionName: libraries +# - template: /eng/pipelines/common/platform-matrix.yml +# parameters: +# jobTemplate: /eng/pipelines/coreclr/templates/superpmi-collect-job.yml +# buildConfig: checked +# platforms: +# - osx_arm64 +# - linux_arm +# - linux_arm64 +# - linux_x64 +# - windows_x64 +# - windows_x86 +# - windows_arm64 +# helixQueueGroup: ci +# helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml +# jobParameters: +# testGroup: outerloop +# liveLibrariesBuildConfig: Release +# collectionType: pmi +# collectionName: libraries +# +# - template: /eng/pipelines/common/platform-matrix.yml +# parameters: +# jobTemplate: /eng/pipelines/coreclr/templates/superpmi-collect-job.yml +# buildConfig: checked +# platforms: +# - osx_arm64 +# - linux_arm +# - linux_arm64 +# - linux_x64 +# - windows_x64 +# - windows_x86 +# - windows_arm64 +# helixQueueGroup: ci +# helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml +# jobParameters: +# testGroup: outerloop +# liveLibrariesBuildConfig: Release +# collectionType: pmi +# collectionName: libraries_tests +# +# - template: /eng/pipelines/common/platform-matrix.yml +# parameters: +# jobTemplate: /eng/pipelines/coreclr/templates/superpmi-collect-job.yml +# buildConfig: checked +# platforms: +# - osx_arm64 +# - linux_arm +# - linux_arm64 +# - linux_x64 +# - windows_x64 +# - windows_x86 +# - windows_arm64 +# helixQueueGroup: ci +# helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml +# jobParameters: +# testGroup: outerloop +# liveLibrariesBuildConfig: Release +# collectionType: crossgen2 +# collectionName: libraries - template: /eng/pipelines/common/platform-matrix.yml parameters: @@ -153,87 +153,87 @@ extends: collectionType: run collectionName: realworld - - template: /eng/pipelines/common/platform-matrix.yml - parameters: - jobTemplate: /eng/pipelines/coreclr/templates/superpmi-collect-job.yml - buildConfig: checked - platforms: - - osx_arm64 - - linux_arm - - linux_arm64 - - linux_x64 - - windows_x64 - - windows_x86 - - windows_arm64 - helixQueueGroup: ci - helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml - jobParameters: - testGroup: outerloop - liveLibrariesBuildConfig: Release - collectionType: run - collectionName: benchmarks - - - template: /eng/pipelines/common/platform-matrix.yml - parameters: - jobTemplate: /eng/pipelines/coreclr/templates/superpmi-collect-job.yml - buildConfig: checked - platforms: - - osx_arm64 - - linux_arm - - linux_arm64 - - linux_x64 - - windows_x64 - - windows_x86 - - windows_arm64 - helixQueueGroup: ci - helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml - jobParameters: - testGroup: outerloop - liveLibrariesBuildConfig: Release - collectionType: run_tiered - collectionName: benchmarks - - - template: /eng/pipelines/common/platform-matrix.yml - parameters: - jobTemplate: /eng/pipelines/coreclr/templates/superpmi-collect-job.yml - buildConfig: checked - platforms: - - osx_arm64 - - linux_arm - - linux_arm64 - - linux_x64 - - windows_x64 - - windows_x86 - - windows_arm64 - helixQueueGroup: ci - helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml - jobParameters: - testGroup: outerloop - liveLibrariesBuildConfig: Release - collectionType: run_pgo - collectionName: benchmarks - - # - # Collection of coreclr test run - # - - template: /eng/pipelines/common/platform-matrix.yml - parameters: - jobTemplate: /eng/pipelines/common/templates/runtimes/run-test-job.yml - buildConfig: checked - platforms: - - osx_arm64 - - linux_arm - - linux_arm64 - - linux_x64 - - windows_x64 - - windows_x86 - - windows_arm64 - helixQueueGroup: superpmi - helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml - jobParameters: - testGroup: outerloop - liveLibrariesBuildConfig: Release - SuperPmiCollect: true +# - template: /eng/pipelines/common/platform-matrix.yml +# parameters: +# jobTemplate: /eng/pipelines/coreclr/templates/superpmi-collect-job.yml +# buildConfig: checked +# platforms: +# - osx_arm64 +# - linux_arm +# - linux_arm64 +# - linux_x64 +# - windows_x64 +# - windows_x86 +# - windows_arm64 +# helixQueueGroup: ci +# helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml +# jobParameters: +# testGroup: outerloop +# liveLibrariesBuildConfig: Release +# collectionType: run +# collectionName: benchmarks +# +# - template: /eng/pipelines/common/platform-matrix.yml +# parameters: +# jobTemplate: /eng/pipelines/coreclr/templates/superpmi-collect-job.yml +# buildConfig: checked +# platforms: +# - osx_arm64 +# - linux_arm +# - linux_arm64 +# - linux_x64 +# - windows_x64 +# - windows_x86 +# - windows_arm64 +# helixQueueGroup: ci +# helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml +# jobParameters: +# testGroup: outerloop +# liveLibrariesBuildConfig: Release +# collectionType: run_tiered +# collectionName: benchmarks +# +# - template: /eng/pipelines/common/platform-matrix.yml +# parameters: +# jobTemplate: /eng/pipelines/coreclr/templates/superpmi-collect-job.yml +# buildConfig: checked +# platforms: +# - osx_arm64 +# - linux_arm +# - linux_arm64 +# - linux_x64 +# - windows_x64 +# - windows_x86 +# - windows_arm64 +# helixQueueGroup: ci +# helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml +# jobParameters: +# testGroup: outerloop +# liveLibrariesBuildConfig: Release +# collectionType: run_pgo +# collectionName: benchmarks +# +# # +# # Collection of coreclr test run +# # +# - template: /eng/pipelines/common/platform-matrix.yml +# parameters: +# jobTemplate: /eng/pipelines/common/templates/runtimes/run-test-job.yml +# buildConfig: checked +# platforms: +# - osx_arm64 +# - linux_arm +# - linux_arm64 +# - linux_x64 +# - windows_x64 +# - windows_x86 +# - windows_arm64 +# helixQueueGroup: superpmi +# helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml +# jobParameters: +# testGroup: outerloop +# liveLibrariesBuildConfig: Release +# SuperPmiCollect: true # # Collection of libraries test run @@ -259,4 +259,4 @@ extends: dependsOnTestBuildConfiguration: Release dependsOnTestArchitecture: x64 coreclrTestGroup: superpmi_collection - SuperPmiCollect: true \ No newline at end of file + SuperPmiCollect: true From db40a30703aeff0c1c0a4348646436602e4f15a0 Mon Sep 17 00:00:00 2001 From: Bruce Forstall Date: Sun, 20 Aug 2023 23:18:45 -0700 Subject: [PATCH 03/28] Fix variables indentation --- eng/pipelines/libraries/run-test-job.yml | 62 ++++++++++++------------ 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/eng/pipelines/libraries/run-test-job.yml b/eng/pipelines/libraries/run-test-job.yml index c9138068c2d7f..aee3066f1c58a 100644 --- a/eng/pipelines/libraries/run-test-job.yml +++ b/eng/pipelines/libraries/run-test-job.yml @@ -73,39 +73,39 @@ jobs: - librariesTestsArtifactName: ${{ format('libraries_test_assets_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} - _archiveTestsParameter: /p:ArchiveTests=true - # Variables used for SuperPMI collection - - name: CollectionType - value: '' - - name: CollectionName - value: '' - - ${{ if eq(parameters.SuperPmiCollect, true) }}: - - MchFileTag: '${{ parameters.osGroup }}.${{ parameters.archType }}.${{ parameters.buildConfig }}' + # Variables used for SuperPMI collection - name: CollectionType - value: 'run' + value: '' - name: CollectionName - value: 'libraries_tests' - - ${{ if eq(parameters.osGroup, 'windows') }}: - - name: PythonScript - value: 'py -3' - - name: PipScript - value: 'py -3 -m pip' - - name: MchFilesLocation - value: '$(Build.SourcesDirectory)\artifacts\helixresults\' - - name: MergedMchFileLocation - value: '$(Build.SourcesDirectory)\artifacts\spmi_collection\' - - name: SpmiLogsLocation - value: '$(Build.SourcesDirectory)\artifacts\spmi_logs\' - - ${{ if ne(parameters.osGroup, 'windows') }}: - - name: PythonScript - value: 'python3' - - name: PipScript - value: 'pip3' - - name: MchFilesLocation - value: '$(Build.SourcesDirectory)/artifacts/helixresults/' - - name: MergedMchFileLocation - value: '$(Build.SourcesDirectory)/artifacts/spmi_collection/' - - name: SpmiLogsLocation - value: '$(Build.SourcesDirectory)/artifacts/spmi_logs/' + value: '' + - ${{ if eq(parameters.SuperPmiCollect, true) }}: + - MchFileTag: '${{ parameters.osGroup }}.${{ parameters.archType }}.${{ parameters.buildConfig }}' + - name: CollectionType + value: 'run' + - name: CollectionName + value: 'libraries_tests' + - ${{ if eq(parameters.osGroup, 'windows') }}: + - name: PythonScript + value: 'py -3' + - name: PipScript + value: 'py -3 -m pip' + - name: MchFilesLocation + value: '$(Build.SourcesDirectory)\artifacts\helixresults\' + - name: MergedMchFileLocation + value: '$(Build.SourcesDirectory)\artifacts\spmi_collection\' + - name: SpmiLogsLocation + value: '$(Build.SourcesDirectory)\artifacts\spmi_logs\' + - ${{ if ne(parameters.osGroup, 'windows') }}: + - name: PythonScript + value: 'python3' + - name: PipScript + value: 'pip3' + - name: MchFilesLocation + value: '$(Build.SourcesDirectory)/artifacts/helixresults/' + - name: MergedMchFileLocation + value: '$(Build.SourcesDirectory)/artifacts/spmi_collection/' + - name: SpmiLogsLocation + value: '$(Build.SourcesDirectory)/artifacts/spmi_logs/' - ${{ parameters.variables }} From ebb44a9a8dfd7ba57f9130c0e79afb8bfb498023 Mon Sep 17 00:00:00 2001 From: Bruce Forstall Date: Sun, 20 Aug 2023 23:27:51 -0700 Subject: [PATCH 04/28] Fix runtime config variable --- eng/pipelines/libraries/run-test-job.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/libraries/run-test-job.yml b/eng/pipelines/libraries/run-test-job.yml index aee3066f1c58a..cde6d12fec615 100644 --- a/eng/pipelines/libraries/run-test-job.yml +++ b/eng/pipelines/libraries/run-test-job.yml @@ -67,7 +67,7 @@ jobs: - ${{ format('{0}_{1}_product_build_{2}{3}_{4}_{5}', parameters.runtimeFlavor, parameters.runtimeVariant, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.liveRuntimeBuildConfig) }} # SuperPMI collection needs to run mcs.exe on the AzDO machine. Assume that's an x64 machine, and download an x64 product build if needed. - ${{ if and(eq(parameters.SuperPmiCollect, true), ne(parameters.archType, 'x64')) }}: - - ${{ format('coreclr_{0}_product_build_{1}{2}_{3}_{4}', '', parameters.osGroup, parameters.osSubgroup, 'x64', parameters.buildConfig) }} + - ${{ format('{0}_{1}_product_build_{2}{3}_{4}_{5}', 'coreclr', '', parameters.osGroup, parameters.osSubgroup, 'x64', parameters.liveRuntimeBuildConfig) }} variables: - librariesTestsArtifactName: ${{ format('libraries_test_assets_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} From eb577f89f10913b01c97735e5433c062b5ccb118 Mon Sep 17 00:00:00 2001 From: Bruce Forstall Date: Mon, 21 Aug 2023 10:02:43 -0700 Subject: [PATCH 05/28] Fix Target syntax --- eng/testing/tests.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/testing/tests.targets b/eng/testing/tests.targets index 25f2c0656bdb2..e1d9e34535a6b 100644 --- a/eng/testing/tests.targets +++ b/eng/testing/tests.targets @@ -104,7 +104,7 @@ + DependsOnTargets="Generate@(ExecutionScriptKind, 'ExecutionScript;Generate')ExecutionScript"> From 4965834b33a8b1403ca128fda31a86bae8bcb33b Mon Sep 17 00:00:00 2001 From: Bruce Forstall Date: Mon, 21 Aug 2023 11:39:33 -0700 Subject: [PATCH 06/28] Fix GenerateRunScript dependencies --- eng/testing/tests.targets | 131 +++++++++++++++++++------------------- 1 file changed, 66 insertions(+), 65 deletions(-) diff --git a/eng/testing/tests.targets b/eng/testing/tests.targets index e1d9e34535a6b..ae1d696a3e0fb 100644 --- a/eng/testing/tests.targets +++ b/eng/testing/tests.targets @@ -94,6 +94,71 @@ + + + + + + + + + + + + + + + + + + + @@ -104,7 +169,7 @@ + DependsOnTargets="GetSuperPMICollection@(ExecutionScriptKind, 'Script;GetSuperPMICollection')Script"> @@ -210,68 +275,4 @@ TEST_ARCH=$(_AndroidArchitecture) - - - - - - - - - - - - - - - - - - From cf86cd6892af290b27e0b13bd77da7a53b748d71 Mon Sep 17 00:00:00 2001 From: Bruce Forstall Date: Mon, 21 Aug 2023 17:27:05 -0700 Subject: [PATCH 07/28] Fix some issues with finding mcs, and other path variables --- .../templates/runtimes/run-test-job.yml | 2 +- eng/pipelines/libraries/run-test-job.yml | 52 ++++++++++++++----- src/libraries/sendtohelixhelp.proj | 9 +++- 3 files changed, 48 insertions(+), 15 deletions(-) diff --git a/eng/pipelines/common/templates/runtimes/run-test-job.yml b/eng/pipelines/common/templates/runtimes/run-test-job.yml index a137b7c796e6b..527be29f98172 100644 --- a/eng/pipelines/common/templates/runtimes/run-test-job.yml +++ b/eng/pipelines/common/templates/runtimes/run-test-job.yml @@ -631,7 +631,7 @@ jobs: displayName: Create SuperPMI directories condition: always() - - script: $(PythonScript) $(Build.SourcesDirectory)/src/coreclr/scripts/superpmi.py merge-mch -log_level DEBUG -pattern $(MchFilesLocation)$(CollectionName).$(CollectionType)*.mch -output_mch_path $(MergedMchFileLocation)$(CollectionName).$(CollectionType).$(MchFileTag).mch + - script: $(PythonScript) $(Build.SourcesDirectory)/src/coreclr/scripts/superpmi.py merge-mch -log_level DEBUG -pattern $(MchFilesLocation)$(CollectionName).$(CollectionType)*.mch -output_mch_path $(MergedMchFileLocation)$(CollectionName).$(CollectionType).$(MchFileTag).mch displayName: 'Merge $(CollectionName)-$(CollectionType) SuperPMI collections' condition: always() diff --git a/eng/pipelines/libraries/run-test-job.yml b/eng/pipelines/libraries/run-test-job.yml index cde6d12fec615..e9e14fd3655e2 100644 --- a/eng/pipelines/libraries/run-test-job.yml +++ b/eng/pipelines/libraries/run-test-job.yml @@ -70,6 +70,23 @@ jobs: - ${{ format('{0}_{1}_product_build_{2}{3}_{4}_{5}', 'coreclr', '', parameters.osGroup, parameters.osSubgroup, 'x64', parameters.liveRuntimeBuildConfig) }} variables: + # Convenience variables + - name: buildConfig + value: ${{ parameters.buildConfig }} + - name: archType + value: ${{ parameters.archType }} + - name: osGroup + value: ${{ parameters.osGroup }} + - name: osSubgroup + value: ${{ parameters.osSubgroup }} + - name: buildConfigUpper + ${{ if eq(parameters.buildConfig, 'debug') }}: + value: 'Debug' + ${{ if eq(parameters.buildConfig, 'release') }}: + value: 'Release' + ${{ if eq(parameters.buildConfig, 'checked') }}: + value: 'Checked' + - librariesTestsArtifactName: ${{ format('libraries_test_assets_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} - _archiveTestsParameter: /p:ArchiveTests=true @@ -78,12 +95,23 @@ jobs: value: '' - name: CollectionName value: '' + - name: _runtimeX64DownloadPath + value: '' + # superpmi.py 'merge-mch' needs to be able to find the mcs tool. Point SuperPmiMcsPath at the downloaded CoreCLR binaries. For non-x64 targets, download an x64 + # build and point at that. Pass this to superpmi.py as the '-core_root' argument. It's not actually a "Core_Root" directory, but all it needs is to find mcs. + - name: SuperPmiMcsPath + value: $(_runtimeDownloadPath) - ${{ if eq(parameters.SuperPmiCollect, true) }}: - MchFileTag: '${{ parameters.osGroup }}.${{ parameters.archType }}.${{ parameters.buildConfig }}' - name: CollectionType value: 'run' - name: CollectionName value: 'libraries_tests' + - ${{ if ne(parameters.archType, 'x64') }}: + - name: _runtimeX64DownloadPath + value: '$(Build.SourcesDirectory)/artifacts/transport/${{ parameters.runtimeFlavor }}.x64' + - name: SuperPmiMcsPath + value: $(_runtimeX64DownloadPath) - ${{ if eq(parameters.osGroup, 'windows') }}: - name: PythonScript value: 'py -3' @@ -126,6 +154,15 @@ jobs: artifactFileName: $(librariesTestsArtifactName)$(archiveExtension) unpackFolder: $(Build.SourcesDirectory)/artifacts + # SuperPMI collection: Download x64 coreclr if running on non-x64 configuration (needed for mcs.exe) + - ${{ if and(eq(parameters.SuperPmiCollect, true), ne(parameters.archType, 'x64')) }}: + - template: /eng/pipelines/common/download-artifact-step.yml + parameters: + unpackFolder: $(_runtimeX64DownloadPath) + artifactFileName: 'CoreCLRProduct___$(osGroup)$(osSubgroup)_x64_${{ parameters.liveRuntimeBuildConfig }}$(archiveExtension)' + artifactName: 'CoreCLRProduct___$(osGroup)$(osSubgroup)_x64_${{ parameters.liveRuntimeBuildConfig }}' + displayName: 'CoreCLR product build (x64)' + - ${{ if in(parameters.osGroup, 'osx', 'maccatalyst', 'ios', 'iossimulator', 'tvos', 'tvossimulator') }}: - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh ${{ parameters.osGroup }} displayName: Install Build Dependencies @@ -138,15 +175,6 @@ jobs: /bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/overrideRuntimeFromLiveDrop.binlog displayName: Prepare TestHost with runtime $(runtimeFlavorName) - # SuperPMI collection: Download x64 coreclr if running on non-x64 configuration (needed for mcs.exe) - - ${{ if and(eq(parameters.SuperPmiCollect, true), ne(parameters.archType, 'x64')) }}: - - template: /eng/pipelines/common/download-artifact-step.yml - parameters: - unpackFolder: '$(Build.SourcesDirectory)/artifacts/bin/coreclr/$(osGroup).x64.$(buildConfigUpper)' - artifactFileName: 'CoreCLRProduct___$(osGroup)$(osSubgroup)_x64_$(buildConfig)$(archiveExtension)' - artifactName: 'CoreCLRProduct___$(osGroup)$(osSubgroup)_x64_$(buildConfig)' - displayName: 'CoreCLR product build (x64)' - - template: /eng/pipelines/libraries/helix.yml parameters: runtimeFlavor: ${{ parameters.runtimeFlavor }} @@ -274,16 +302,16 @@ jobs: - script: | mkdir -p $(MergedMchFileLocation) mkdir -p $(SpmiLogsLocation) - displayName: Create SuperPMI directories + displayName: 'Create SuperPMI directories $(MergedMchFileLocation), $(SpmiLogsLocation)' condition: always() - ${{ if eq(parameters.osGroup, 'windows') }}: - script: | mkdir $(MergedMchFileLocation) mkdir $(SpmiLogsLocation) - displayName: Create SuperPMI directories + displayName: 'Create SuperPMI directories $(MergedMchFileLocation), $(SpmiLogsLocation)' condition: always() - - script: $(PythonScript) $(Build.SourcesDirectory)/src/coreclr/scripts/superpmi.py merge-mch -log_level DEBUG -pattern $(MchFilesLocation)$(CollectionName).$(CollectionType)*.mch -output_mch_path $(MergedMchFileLocation)$(CollectionName).$(CollectionType).$(MchFileTag).mch + - script: $(PythonScript) $(Build.SourcesDirectory)/src/coreclr/scripts/superpmi.py merge-mch -log_level DEBUG -pattern $(MchFilesLocation)$(CollectionName).$(CollectionType)*.mch -output_mch_path $(MergedMchFileLocation)$(CollectionName).$(CollectionType).$(MchFileTag).mch -core_root $(SuperPmiMcsPath) displayName: 'Merge $(CollectionName)-$(CollectionType) SuperPMI collections' condition: always() diff --git a/src/libraries/sendtohelixhelp.proj b/src/libraries/sendtohelixhelp.proj index a8b2a256f8725..69929dd2ce0a5 100644 --- a/src/libraries/sendtohelixhelp.proj +++ b/src/libraries/sendtohelixhelp.proj @@ -144,6 +144,8 @@ + + @@ -153,7 +155,8 @@ - + + @@ -165,6 +168,8 @@ + + @@ -174,7 +179,7 @@ - + From 7a47784a1612eed8a3c46cfec4937892e3865a4f Mon Sep 17 00:00:00 2001 From: Bruce Forstall Date: Tue, 22 Aug 2023 16:52:36 -0700 Subject: [PATCH 08/28] Copy CoreCLR built binaries to a location SPMI can find them --- eng/pipelines/libraries/base-job.yml | 18 +++++++++++ eng/pipelines/libraries/run-test-job.yml | 20 ++++++------ eng/testing/tests.targets | 40 ++++++++++++++++-------- src/libraries/sendtohelix.proj | 29 +++++++++++++++-- src/libraries/sendtohelixhelp.proj | 13 +++++--- 5 files changed, 91 insertions(+), 29 deletions(-) diff --git a/eng/pipelines/libraries/base-job.yml b/eng/pipelines/libraries/base-job.yml index 9dea30f61c455..ebcea0169fa5e 100644 --- a/eng/pipelines/libraries/base-job.yml +++ b/eng/pipelines/libraries/base-job.yml @@ -24,6 +24,7 @@ parameters: pool: '' runTests: false pgoType: '' + SuperPmiCollect: false jobs: - template: /eng/common/templates/job/job.yml @@ -113,6 +114,12 @@ jobs: # we need to override this value to support build-coreclr-and-libraries-job.yml - _BuildConfig: ${{ parameters.buildConfig }} + # For SuperPMI we also download the runtime artifacts to a location that gets added to the Helix correlation payload, so we have access to the SuperPMI tools + # superpmi, mcs, and the SuperPMI shim, as well as easy access to the path of the JIT being used. + #- _SpmiRuntimeDownloadPath: '' + #- ${{ if eq(parameters.SuperPmiCollect, true) }}: + #- _SpmiRuntimeDownloadPath: '$(Build.SourcesDirectory)/artifacts/helix/coreclr' + dependsOn: - ${{ if eq(parameters.dependOnEvaluatePaths, true) }}: - evaluate_paths @@ -136,4 +143,15 @@ jobs: artifactName: '$(_runtimeArtifactName)' displayName: '$(runtimeFlavorName) build drop' + # SuperPMI needs the runtime in an additional location -- which is added to the Helix correlation payload -- so copy it there. + # (We might only need the mcs.exe/superpmi.exe/superpmi-shim-collector.dll/clrjit.dll (equivalent on non-Windows) + # so we could potentially copy less here.) + #- ${{ if eq(parameters.SuperPmiCollect, true) }}: + #- task: CopyFiles@2 + #displayName: 'Copy $(runtimeFlavorName) build drop to SuperPMI location' + #inputs: + #sourceFolder: '$(_runtimeDownloadPath)' + #contents: '**' + #targetFolder: '$(_SpmiRuntimeDownloadPath)' + - ${{ parameters.steps }} diff --git a/eng/pipelines/libraries/run-test-job.yml b/eng/pipelines/libraries/run-test-job.yml index e9e14fd3655e2..f75d303211bc7 100644 --- a/eng/pipelines/libraries/run-test-job.yml +++ b/eng/pipelines/libraries/run-test-job.yml @@ -43,6 +43,7 @@ jobs: container: ${{ parameters.container }} condition: ${{ parameters.condition }} testScope: ${{ parameters.testScope }} + SuperPmiCollect: ${{ parameters.SuperPmiCollect }} runTests: true ${{ if ne(parameters.liveRuntimeBuildConfig, '') }}: displayName: ${{ format('Test Run {0} {1}', parameters.liveRuntimeBuildConfig, parameters.runtimeDisplayName) }} @@ -138,6 +139,16 @@ jobs: - ${{ parameters.variables }} steps: + + # SuperPMI collection: Download x64 coreclr if running on non-x64 configuration (needed for mcs.exe on AzDO machine; see `SuperPmiMcsPath`. + - ${{ if and(eq(parameters.SuperPmiCollect, true), ne(parameters.archType, 'x64')) }}: + - template: /eng/pipelines/common/download-artifact-step.yml + parameters: + unpackFolder: $(_runtimeX64DownloadPath) + artifactFileName: 'CoreCLRProduct___$(osGroup)$(osSubgroup)_x64_${{ parameters.liveRuntimeBuildConfig }}$(archiveExtension)' + artifactName: 'CoreCLRProduct___$(osGroup)$(osSubgroup)_x64_${{ parameters.liveRuntimeBuildConfig }}' + displayName: 'CoreCLR product build (x64)' + - template: /eng/pipelines/common/download-artifact-step.yml parameters: displayName: Build Assets @@ -154,15 +165,6 @@ jobs: artifactFileName: $(librariesTestsArtifactName)$(archiveExtension) unpackFolder: $(Build.SourcesDirectory)/artifacts - # SuperPMI collection: Download x64 coreclr if running on non-x64 configuration (needed for mcs.exe) - - ${{ if and(eq(parameters.SuperPmiCollect, true), ne(parameters.archType, 'x64')) }}: - - template: /eng/pipelines/common/download-artifact-step.yml - parameters: - unpackFolder: $(_runtimeX64DownloadPath) - artifactFileName: 'CoreCLRProduct___$(osGroup)$(osSubgroup)_x64_${{ parameters.liveRuntimeBuildConfig }}$(archiveExtension)' - artifactName: 'CoreCLRProduct___$(osGroup)$(osSubgroup)_x64_${{ parameters.liveRuntimeBuildConfig }}' - displayName: 'CoreCLR product build (x64)' - - ${{ if in(parameters.osGroup, 'osx', 'maccatalyst', 'ios', 'iossimulator', 'tvos', 'tvossimulator') }}: - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh ${{ parameters.osGroup }} displayName: Install Build Dependencies diff --git a/eng/testing/tests.targets b/eng/testing/tests.targets index ae1d696a3e0fb..e30c1b492e4ef 100644 --- a/eng/testing/tests.targets +++ b/eng/testing/tests.targets @@ -93,13 +93,12 @@ - - - @@ -167,6 +168,10 @@ set DOTNET_JitPath=%CORE_ROOT%\superpmi-shim-collector.dll + + @@ -187,6 +192,11 @@ set DOTNET_JitPath=%CORE_ROOT%\superpmi-shim-collector.dll + + + + + @@ -201,6 +211,10 @@ set DOTNET_JitPath=%CORE_ROOT%\superpmi-shim-collector.dll --> + + + + diff --git a/src/libraries/sendtohelix.proj b/src/libraries/sendtohelix.proj index eb49efc40ab60..a0f34b8e58442 100644 --- a/src/libraries/sendtohelix.proj +++ b/src/libraries/sendtohelix.proj @@ -210,9 +210,31 @@ <_SuperPmiScriptsFiles Include="$(RepoRoot)src\coreclr\scripts\*.py" /> - - - + + + + + + + + + + + + + + + diff --git a/src/libraries/sendtohelixhelp.proj b/src/libraries/sendtohelixhelp.proj index 69929dd2ce0a5..6b356ab8b9ebb 100644 --- a/src/libraries/sendtohelixhelp.proj +++ b/src/libraries/sendtohelixhelp.proj @@ -140,22 +140,25 @@ because we know it can be used, but %TEMP%\spmi_collect might be better. --> + - + + - + + @@ -164,21 +167,23 @@ + - + - + + From c802c6c67c7c52325c160c58d45822b4e60876e6 Mon Sep 17 00:00:00 2001 From: Bruce Forstall Date: Tue, 22 Aug 2023 23:44:55 -0700 Subject: [PATCH 09/28] Try different way to get bash script --- eng/testing/tests.targets | 14 +++++++++++--- src/libraries/sendtohelixhelp.proj | 1 + 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/eng/testing/tests.targets b/eng/testing/tests.targets index e30c1b492e4ef..187d0cdbd462f 100644 --- a/eng/testing/tests.targets +++ b/eng/testing/tests.targets @@ -163,18 +163,22 @@ set DOTNET_JitPath=%spmi_core_root%\superpmi-shim-collector.dll + + DependsOnTargets="GetSuperPMICollectionBatchScript;GetSuperPMICollectionBashScript"> @@ -198,6 +202,10 @@ set DOTNET_JitPath=%spmi_core_root%\superpmi-shim-collector.dll + diff --git a/src/libraries/sendtohelixhelp.proj b/src/libraries/sendtohelixhelp.proj index 6b356ab8b9ebb..381d52ce811c9 100644 --- a/src/libraries/sendtohelixhelp.proj +++ b/src/libraries/sendtohelixhelp.proj @@ -183,6 +183,7 @@ + From 472d3eafa1f15df08d4b29fdd45c47ee60e6d2fb Mon Sep 17 00:00:00 2001 From: Bruce Forstall Date: Wed, 23 Aug 2023 10:31:24 -0700 Subject: [PATCH 10/28] Another attempt to install SPMI collection in RunTests.sh on non-Windows --- eng/testing/tests.targets | 10 ++++++ .../installer.tasks/GenerateRunScript.cs | 31 ++++++++++++++----- 2 files changed, 33 insertions(+), 8 deletions(-) diff --git a/eng/testing/tests.targets b/eng/testing/tests.targets index 187d0cdbd462f..62dc43601230f 100644 --- a/eng/testing/tests.targets +++ b/eng/testing/tests.targets @@ -195,6 +195,15 @@ set DOTNET_JitPath=%spmi_core_root%\superpmi-shim-collector.dll $(TestDebugger) /debugexe $(RunScriptCommand) + + + + + @@ -206,6 +215,7 @@ set DOTNET_JitPath=%spmi_core_root%\superpmi-shim-collector.dll ***** why does the Windows collection work and the bash/Linux/OSX collection doesn't get the collection commands added? ***** secondarily, why aren't there newlines in the "echo" version of the windows commands? --> + diff --git a/src/tasks/installer.tasks/GenerateRunScript.cs b/src/tasks/installer.tasks/GenerateRunScript.cs index e363810fe1de3..6bcdffb1fff12 100644 --- a/src/tasks/installer.tasks/GenerateRunScript.cs +++ b/src/tasks/installer.tasks/GenerateRunScript.cs @@ -62,14 +62,19 @@ private void WriteRunScript(string templateContent, string extension) { bool isUnix = extension == ".sh"; string lineFeed = isUnix ? "\n" : "\r\n"; + string[] newlineSeparator = new string[] { Environment.NewLine }; var setCommandsBuilder = new StringBuilder(); for (int i = 0; i < SetCommands.Length; i++) { - setCommandsBuilder.Append(SetCommands[i]); - if (i < SetCommands.Length - 1) + string[] setCommandsSplit = SetCommands[i].Split(newlineSeparator, StringSplitOptions.None); + for (int j = 0; j < setCommandsSplit.Length; j++) { - setCommandsBuilder.Append(lineFeed); + setCommandsBuilder.Append(setCommandsSplit[j]); + if ((j < setCommandsSplit.Length - 1) || (i < SetCommands.Length - 1)) + { + setCommandsBuilder.Append(lineFeed); + } } } templateContent = templateContent.Replace("[[SetCommands]]", setCommandsBuilder.ToString()); @@ -77,10 +82,14 @@ private void WriteRunScript(string templateContent, string extension) var runCommandsBuilder = new StringBuilder(); for (int i = 0; i < RunCommands.Length; i++) { - runCommandsBuilder.Append(RunCommands[i]); - if (i < RunCommands.Length - 1) + string[] runCommandsSplit = RunCommands[i].Split(newlineSeparator, StringSplitOptions.None); + for (int j = 0; j < runCommandsSplit.Length; j++) { - runCommandsBuilder.Append(lineFeed); + runCommandsBuilder.Append(runCommandsSplit[j]); + if ((j < runCommandsSplit.Length - 1) || (i < RunCommands.Length - 1)) + { + runCommandsBuilder.Append(lineFeed); + } } } templateContent = templateContent.Replace("[[RunCommands]]", runCommandsBuilder.ToString()); @@ -89,14 +98,20 @@ private void WriteRunScript(string templateContent, string extension) var setCommandEchoesBuilder = new StringBuilder(); foreach (string setCommand in SetCommands) { - setCommandEchoesBuilder.Append($"echo {SanitizeEcho(setCommand,isUnix)}{lineFeed}"); + foreach (string setCommandOneLine in setCommand.Split(newlineSeparator, StringSplitOptions.None)) + { + setCommandEchoesBuilder.Append($"echo {SanitizeEcho(setCommandOneLine,isUnix)}{lineFeed}"); + } } templateContent = templateContent.Replace("[[SetCommandsEcho]]", setCommandEchoesBuilder.ToString()); var runCommandEchoesBuilder = new StringBuilder(); foreach (string runCommand in RunCommands) { - runCommandEchoesBuilder.Append($"echo {SanitizeEcho(runCommand,isUnix)}{lineFeed}"); + foreach (string runCommandOneLine in runCommand.Split(newlineSeparator, StringSplitOptions.None)) + { + runCommandEchoesBuilder.Append($"echo {SanitizeEcho(runCommandOneLine,isUnix)}{lineFeed}"); + } } templateContent = templateContent.Replace("[[RunCommandsEcho]]", runCommandEchoesBuilder.ToString()); From d56e231da4254f25a774202521f91781b627c2ae Mon Sep 17 00:00:00 2001 From: Bruce Forstall Date: Wed, 23 Aug 2023 13:47:42 -0700 Subject: [PATCH 11/28] Try again to get bash script setup to work --- eng/testing/tests.targets | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/eng/testing/tests.targets b/eng/testing/tests.targets index 62dc43601230f..5587d7b1139a3 100644 --- a/eng/testing/tests.targets +++ b/eng/testing/tests.targets @@ -97,7 +97,7 @@ *********************************************************************************************** SuperPMI collection - GetSuperPMICollectionBashScript/GetSuperPMICollectionBatchScript are similar to or exact copies of + SuperPMICollectionBashScript/SuperPMICollectionBatchScript are similar to or exact copies of code in src\tests\Common\CLRTest.Jit.targets. *********************************************************************************************** @@ -105,10 +105,8 @@ to escape semicolons with %3B here. --> - - - + - - - + - - - - - - + + - + From 1fa505ea7b91f758c01d8a50a11e9cbb9b40765d Mon Sep 17 00:00:00 2001 From: Bruce Forstall Date: Wed, 23 Aug 2023 15:41:32 -0700 Subject: [PATCH 12/28] Move spmi collection enabling to the RunnerTemplate scripts --- eng/pipelines/libraries/base-job.yml | 17 ----- eng/testing/RunnerTemplate.cmd | 16 +++++ eng/testing/RunnerTemplate.sh | 32 +++++++++ eng/testing/tests.targets | 103 --------------------------- src/libraries/sendtohelix.proj | 11 +-- src/libraries/sendtohelixhelp.proj | 10 +-- 6 files changed, 51 insertions(+), 138 deletions(-) diff --git a/eng/pipelines/libraries/base-job.yml b/eng/pipelines/libraries/base-job.yml index ebcea0169fa5e..a4c0fdb21ff88 100644 --- a/eng/pipelines/libraries/base-job.yml +++ b/eng/pipelines/libraries/base-job.yml @@ -114,12 +114,6 @@ jobs: # we need to override this value to support build-coreclr-and-libraries-job.yml - _BuildConfig: ${{ parameters.buildConfig }} - # For SuperPMI we also download the runtime artifacts to a location that gets added to the Helix correlation payload, so we have access to the SuperPMI tools - # superpmi, mcs, and the SuperPMI shim, as well as easy access to the path of the JIT being used. - #- _SpmiRuntimeDownloadPath: '' - #- ${{ if eq(parameters.SuperPmiCollect, true) }}: - #- _SpmiRuntimeDownloadPath: '$(Build.SourcesDirectory)/artifacts/helix/coreclr' - dependsOn: - ${{ if eq(parameters.dependOnEvaluatePaths, true) }}: - evaluate_paths @@ -143,15 +137,4 @@ jobs: artifactName: '$(_runtimeArtifactName)' displayName: '$(runtimeFlavorName) build drop' - # SuperPMI needs the runtime in an additional location -- which is added to the Helix correlation payload -- so copy it there. - # (We might only need the mcs.exe/superpmi.exe/superpmi-shim-collector.dll/clrjit.dll (equivalent on non-Windows) - # so we could potentially copy less here.) - #- ${{ if eq(parameters.SuperPmiCollect, true) }}: - #- task: CopyFiles@2 - #displayName: 'Copy $(runtimeFlavorName) build drop to SuperPMI location' - #inputs: - #sourceFolder: '$(_runtimeDownloadPath)' - #contents: '**' - #targetFolder: '$(_SpmiRuntimeDownloadPath)' - - ${{ parameters.steps }} diff --git a/eng/testing/RunnerTemplate.cmd b/eng/testing/RunnerTemplate.cmd index 3833fd569d199..c0d3769a00c05 100644 --- a/eng/testing/RunnerTemplate.cmd +++ b/eng/testing/RunnerTemplate.cmd @@ -47,6 +47,22 @@ set DOTNET_MULTILEVEL_LOOKUP=0 :: Assume failure set HAS_TEST_RESULTS=0 +:: Support for SuperPMI collection +REM SuperPMI collection +if not defined spmi_enable_collection goto :skip_spmi_enable_collection +REM spmi_collect_dir and spmi_core_root need to be set before this script is run, if SuperPMI collection is enabled. +if not defined spmi_collect_dir echo ERROR: spmi_collect_dir not defined&goto :skip_spmi_enable_collection +if not defined spmi_core_root echo ERROR: spmi_core_root not defined&goto :skip_spmi_enable_collection +if not exist %spmi_collect_dir% mkdir %spmi_collect_dir% +set spmi_jitlib=%spmi_core_root%\clrjit.dll +if not exist %spmi_jitlib% echo ERROR: %spmi_jitlib% not found&goto :skip_spmi_enable_collection +set SuperPMIShimLogPath=%spmi_collect_dir% +set SuperPMIShimPath=%spmi_jitlib% +set DOTNET_EnableExtraSuperPmiQueries=1 +set DOTNET_JitPath=%spmi_core_root%\superpmi-shim-collector.dll +if not exist %DOTNET_JitPath% echo ERROR: %DOTNET_JitPath% not found&goto :skip_spmi_enable_collection +:skip_spmi_enable_collection + :: ========================= BEGIN Test Execution ============================= echo ----- start %DATE% %TIME% =============== To repro directly: ===================================================== echo pushd %EXECUTION_DIR% diff --git a/eng/testing/RunnerTemplate.sh b/eng/testing/RunnerTemplate.sh index 7c534f72b5e86..d2dbc050af288 100644 --- a/eng/testing/RunnerTemplate.sh +++ b/eng/testing/RunnerTemplate.sh @@ -157,6 +157,38 @@ elif [[ "$(uname -s)" == "Linux" ]]; then fi # ========================= END Core File Setup ============================== +# ========================= BEGIN support for SuperPMI collection ============================== +if [ ! -z $spmi_enable_collection ]; then + # spmi_collect_dir and spmi_core_root need to be set before this script is run, if SuperPMI collection is enabled. + if [ -z $spmi_collect_dir ]; then + echo "ERROR - spmi_collect_dir not defined" + exit 1 + fi + if [ -z $spmi_core_root ]; then + echo "ERROR - spmi_core_root not defined" + exit 1 + fi + mkdir -p $spmi_collect_dir + export spmi_file_extension=so + if [[ "$(uname -s)" == "Darwin" ]]; then + export spmi_file_extension=dylib + fi + export spmi_jitlib=$spmi_core_root/libclrjit.$spmi_file_extension + export SuperPMIShimLogPath=$spmi_collect_dir + export SuperPMIShimPath=$spmi_jitlib + export DOTNET_EnableExtraSuperPmiQueries=1 + export DOTNET_JitPath=$spmi_core_root/libsuperpmi-shim-collector.$spmi_file_extension + if [ ! -e $spmi_jitlib ]; then + echo "ERROR - $spmi_jitlib not found" + exit 1 + fi + if [ ! -e $DOTNET_JitPath ]; then + echo "ERROR - $DOTNET_JitPath not found" + exit 1 + fi +fi +# ========================= END support for SuperPMI collection ============================== + # ========================= BEGIN Test Execution ============================= echo ----- start $(date) =============== To repro directly: ===================================================== echo pushd $EXECUTION_DIR diff --git a/eng/testing/tests.targets b/eng/testing/tests.targets index 5587d7b1139a3..70d9759dda6ad 100644 --- a/eng/testing/tests.targets +++ b/eng/testing/tests.targets @@ -93,82 +93,6 @@ - - - - - - - - - - - - - - - @@ -187,30 +111,7 @@ set DOTNET_JitPath=%spmi_core_root%\superpmi-shim-collector.dll $(TestDebugger) /debugexe $(RunScriptCommand) - - - - - - - - - - - - - - - - - - - - diff --git a/src/libraries/sendtohelix.proj b/src/libraries/sendtohelix.proj index a0f34b8e58442..1e12decfae4e5 100644 --- a/src/libraries/sendtohelix.proj +++ b/src/libraries/sendtohelix.proj @@ -216,19 +216,10 @@ - - diff --git a/src/libraries/sendtohelixhelp.proj b/src/libraries/sendtohelixhelp.proj index 381d52ce811c9..7a67738fffc93 100644 --- a/src/libraries/sendtohelixhelp.proj +++ b/src/libraries/sendtohelixhelp.proj @@ -144,8 +144,7 @@ - - + @@ -157,8 +156,6 @@ - - @@ -171,8 +168,7 @@ - - + @@ -183,8 +179,6 @@ - - From fc5294fd9f5411edbe22f9c084f0830143a5d235 Mon Sep 17 00:00:00 2001 From: Bruce Forstall Date: Wed, 23 Aug 2023 16:12:05 -0700 Subject: [PATCH 13/28] Refine RunnerTemplate files --- eng/testing/RunnerTemplate.cmd | 16 ++++++++++------ eng/testing/RunnerTemplate.sh | 12 ++++++++---- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/eng/testing/RunnerTemplate.cmd b/eng/testing/RunnerTemplate.cmd index c0d3769a00c05..4f4646a72315d 100644 --- a/eng/testing/RunnerTemplate.cmd +++ b/eng/testing/RunnerTemplate.cmd @@ -50,17 +50,21 @@ set HAS_TEST_RESULTS=0 :: Support for SuperPMI collection REM SuperPMI collection if not defined spmi_enable_collection goto :skip_spmi_enable_collection +echo SuperPMI collection enabled REM spmi_collect_dir and spmi_core_root need to be set before this script is run, if SuperPMI collection is enabled. -if not defined spmi_collect_dir echo ERROR: spmi_collect_dir not defined&goto :skip_spmi_enable_collection -if not defined spmi_core_root echo ERROR: spmi_core_root not defined&goto :skip_spmi_enable_collection +if not defined spmi_collect_dir echo ERROR: spmi_collect_dir not defined&exit /b 1 +if not defined spmi_core_root echo ERROR: spmi_core_root not defined&exit /b 1 if not exist %spmi_collect_dir% mkdir %spmi_collect_dir% -set spmi_jitlib=%spmi_core_root%\clrjit.dll -if not exist %spmi_jitlib% echo ERROR: %spmi_jitlib% not found&goto :skip_spmi_enable_collection set SuperPMIShimLogPath=%spmi_collect_dir% -set SuperPMIShimPath=%spmi_jitlib% +set SuperPMIShimPath=%spmi_core_root%\clrjit.dll +if not exist %SuperPMIShimPath% echo ERROR: %SuperPMIShimPath% not found&exit /b 1 set DOTNET_EnableExtraSuperPmiQueries=1 set DOTNET_JitPath=%spmi_core_root%\superpmi-shim-collector.dll -if not exist %DOTNET_JitPath% echo ERROR: %DOTNET_JitPath% not found&goto :skip_spmi_enable_collection +if not exist %DOTNET_JitPath% echo ERROR: %DOTNET_JitPath% not found&exit /b 1 +echo SuperPMIShimLogPath=%SuperPMIShimLogPath% +echo SuperPMIShimPath=%SuperPMIShimPath% +echo DOTNET_EnableExtraSuperPmiQueries=%DOTNET_EnableExtraSuperPmiQueries% +echo DOTNET_JitPath=%DOTNET_JitPath% :skip_spmi_enable_collection :: ========================= BEGIN Test Execution ============================= diff --git a/eng/testing/RunnerTemplate.sh b/eng/testing/RunnerTemplate.sh index d2dbc050af288..9252c30576ed9 100644 --- a/eng/testing/RunnerTemplate.sh +++ b/eng/testing/RunnerTemplate.sh @@ -159,6 +159,7 @@ fi # ========================= BEGIN support for SuperPMI collection ============================== if [ ! -z $spmi_enable_collection ]; then + echo "SuperPMI collection enabled" # spmi_collect_dir and spmi_core_root need to be set before this script is run, if SuperPMI collection is enabled. if [ -z $spmi_collect_dir ]; then echo "ERROR - spmi_collect_dir not defined" @@ -173,19 +174,22 @@ if [ ! -z $spmi_enable_collection ]; then if [[ "$(uname -s)" == "Darwin" ]]; then export spmi_file_extension=dylib fi - export spmi_jitlib=$spmi_core_root/libclrjit.$spmi_file_extension export SuperPMIShimLogPath=$spmi_collect_dir - export SuperPMIShimPath=$spmi_jitlib + export SuperPMIShimPath=$spmi_core_root/libclrjit.$spmi_file_extension export DOTNET_EnableExtraSuperPmiQueries=1 export DOTNET_JitPath=$spmi_core_root/libsuperpmi-shim-collector.$spmi_file_extension - if [ ! -e $spmi_jitlib ]; then - echo "ERROR - $spmi_jitlib not found" + if [ ! -e $SuperPMIShimPath ]; then + echo "ERROR - $SuperPMIShimPath not found" exit 1 fi if [ ! -e $DOTNET_JitPath ]; then echo "ERROR - $DOTNET_JitPath not found" exit 1 fi + echo "SuperPMIShimLogPath=$SuperPMIShimLogPath" + echo "SuperPMIShimPath=$SuperPMIShimPath" + echo "DOTNET_EnableExtraSuperPmiQueries=$DOTNET_EnableExtraSuperPmiQueries" + echo "DOTNET_JitPath=$DOTNET_JitPath" fi # ========================= END support for SuperPMI collection ============================== From eda1df0d5c072c47afb11bed2e301e4011fe6820 Mon Sep 17 00:00:00 2001 From: Bruce Forstall Date: Wed, 23 Aug 2023 18:35:32 -0700 Subject: [PATCH 14/28] Check disk space Disk space on AzDO machines is running out during collection. Print disk space to see what we've got. E.g., for linux-x64, the Helix work items create 25.5GB, and the merged .mch is 12GB. In total, the correlation payload is 1.8GB and all downloaded workitems are 29GB. The total space needed including merged .mch is 44GB. --- eng/pipelines/libraries/run-test-job.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/eng/pipelines/libraries/run-test-job.yml b/eng/pipelines/libraries/run-test-job.yml index f75d303211bc7..b5a82cb60fc9b 100644 --- a/eng/pipelines/libraries/run-test-job.yml +++ b/eng/pipelines/libraries/run-test-job.yml @@ -140,6 +140,16 @@ jobs: steps: + - ${{ if eq(parameters.SuperPmiCollect, true) }}: + # Show disk space + - ${{ if ne(parameters.osGroup, 'windows') }}: + - script: | + df -H + du -a $(MchFilesLocation) + du -a $(MchFilesLocation)/.. + displayName: 'Display disk space before' + condition: always() + # SuperPMI collection: Download x64 coreclr if running on non-x64 configuration (needed for mcs.exe on AzDO machine; see `SuperPmiMcsPath`. - ${{ if and(eq(parameters.SuperPmiCollect, true), ne(parameters.archType, 'x64')) }}: - template: /eng/pipelines/common/download-artifact-step.yml @@ -299,6 +309,17 @@ jobs: - ${{ if eq(parameters.SuperPmiCollect, true) }}: + # Show disk space + - ${{ if ne(parameters.osGroup, 'windows') }}: + - script: | + df -H + du -a $(MchFilesLocation) + du -a $(MergedMchFileLocation) + du -a $(SpmiLogsLocation) + du -a $(SpmiLogsLocation)/.. + displayName: 'Display disk space' + condition: always() + # Create required directories for merged mch collection and superpmi logs - ${{ if ne(parameters.osGroup, 'windows') }}: - script: | From b2a067bdda3f9143c065415aa57ca99fe31175a9 Mon Sep 17 00:00:00 2001 From: Bruce Forstall Date: Wed, 23 Aug 2023 21:24:04 -0700 Subject: [PATCH 15/28] Refine disk space query --- eng/pipelines/libraries/run-test-job.yml | 33 ++++++++++++++++++------ 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/eng/pipelines/libraries/run-test-job.yml b/eng/pipelines/libraries/run-test-job.yml index b5a82cb60fc9b..9abe8bbfaff77 100644 --- a/eng/pipelines/libraries/run-test-job.yml +++ b/eng/pipelines/libraries/run-test-job.yml @@ -141,14 +141,15 @@ jobs: steps: - ${{ if eq(parameters.SuperPmiCollect, true) }}: - # Show disk space - ${{ if ne(parameters.osGroup, 'windows') }}: - script: | + echo 'df -H' df -H - du -a $(MchFilesLocation) - du -a $(MchFilesLocation)/.. + echo 'df -H Build.SourcesDirectory' + df -H $(Build.SourcesDirectory) displayName: 'Display disk space before' condition: always() + continueOnError: true # SuperPMI collection: Download x64 coreclr if running on non-x64 configuration (needed for mcs.exe on AzDO machine; see `SuperPmiMcsPath`. - ${{ if and(eq(parameters.SuperPmiCollect, true), ne(parameters.archType, 'x64')) }}: @@ -187,6 +188,19 @@ jobs: /bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/overrideRuntimeFromLiveDrop.binlog displayName: Prepare TestHost with runtime $(runtimeFlavorName) + - ${{ if eq(parameters.SuperPmiCollect, true) }}: + - ${{ if ne(parameters.osGroup, 'windows') }}: + - script: | + echo 'df -H' + df -H + echo 'df -H Build.SourcesDirectory' + df -H $(Build.SourcesDirectory) + echo 'du Build.SourcesDirectory/artifacts' + du $(Build.SourcesDirectory)/artifacts + displayName: 'Display disk space before Helix' + condition: always() + continueOnError: true + - template: /eng/pipelines/libraries/helix.yml parameters: runtimeFlavor: ${{ parameters.runtimeFlavor }} @@ -309,16 +323,19 @@ jobs: - ${{ if eq(parameters.SuperPmiCollect, true) }}: - # Show disk space - ${{ if ne(parameters.osGroup, 'windows') }}: - script: | + echo 'df -H' df -H + echo 'df -H Build.SourcesDirectory' + df -H $(Build.SourcesDirectory) + echo 'du -a MchFilesLocation' du -a $(MchFilesLocation) - du -a $(MergedMchFileLocation) - du -a $(SpmiLogsLocation) - du -a $(SpmiLogsLocation)/.. - displayName: 'Display disk space' + echo 'du Build.SourcesDirectory/artifacts' + du $(Build.SourcesDirectory)/artifacts + displayName: 'Display disk space before merging' condition: always() + continueOnError: true # Create required directories for merged mch collection and superpmi logs - ${{ if ne(parameters.osGroup, 'windows') }}: From 29cdd569f798526c744fa65ab06b23cf28f6f2a4 Mon Sep 17 00:00:00 2001 From: Bruce Forstall Date: Wed, 23 Aug 2023 23:26:41 -0700 Subject: [PATCH 16/28] Split libraries tests collection into normal and no-tiered-compilation --- eng/pipelines/coreclr/superpmi-collect.yml | 31 +++++++++++++++- eng/pipelines/libraries/run-test-job.yml | 43 +++++++++++++--------- 2 files changed, 55 insertions(+), 19 deletions(-) diff --git a/eng/pipelines/coreclr/superpmi-collect.yml b/eng/pipelines/coreclr/superpmi-collect.yml index bbcefc519e600..22b6fca25acc8 100644 --- a/eng/pipelines/coreclr/superpmi-collect.yml +++ b/eng/pipelines/coreclr/superpmi-collect.yml @@ -236,7 +236,7 @@ extends: # SuperPmiCollect: true # - # Collection of libraries test run + # Collection of libraries test run: normal # Libraries Test Run using Release libraries, and Checked CoreCLR # - template: /eng/pipelines/common/platform-matrix.yml @@ -260,3 +260,32 @@ extends: dependsOnTestArchitecture: x64 coreclrTestGroup: superpmi_collection SuperPmiCollect: true + SuperPmiCollectionName: libraries_tests + + # + # Collection of libraries test run: no_tiered_compilation + # Libraries Test Run using Release libraries, and Checked CoreCLR + # + - template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/libraries/run-test-job.yml + buildConfig: Release + platforms: + - osx_arm64 + - linux_arm + - linux_arm64 + - linux_x64 + - windows_x64 + - windows_x86 + - windows_arm64 + helixQueueGroup: superpmi + helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml + jobParameters: + testScope: innerloop + liveRuntimeBuildConfig: checked + dependsOnTestBuildConfiguration: Release + dependsOnTestArchitecture: x64 + coreclrTestGroup: superpmi_collection_no_tiered_compilation + SuperPmiCollect: true + SuperPmiCollectionName: libraries_tests_no_tiered_compilation + diff --git a/eng/pipelines/libraries/run-test-job.yml b/eng/pipelines/libraries/run-test-job.yml index 9abe8bbfaff77..5c7e56b93db2f 100644 --- a/eng/pipelines/libraries/run-test-job.yml +++ b/eng/pipelines/libraries/run-test-job.yml @@ -24,6 +24,7 @@ parameters: # eng/pipelines/common/templates/runtimes/run-test-job.yml. coreclrTestGroup: '' SuperPmiCollect: false + SuperPmiCollectionName: '' dependsOn: [] jobs: @@ -92,22 +93,26 @@ jobs: - _archiveTestsParameter: /p:ArchiveTests=true # Variables used for SuperPMI collection - - name: CollectionType - value: '' - - name: CollectionName - value: '' + - name: SuperPmiCollectionType + value: 'run' + + ${{ if eq(parameters.SuperPmiCollectionName, '') }}: + - name: SuperPmiCollectionName + value: 'libraries_tests' + ${{ else }}: + - name: SuperPmiCollectionName + value: ${{ parameters.SuperPmiCollectionName }} + - name: _runtimeX64DownloadPath value: '' + # superpmi.py 'merge-mch' needs to be able to find the mcs tool. Point SuperPmiMcsPath at the downloaded CoreCLR binaries. For non-x64 targets, download an x64 # build and point at that. Pass this to superpmi.py as the '-core_root' argument. It's not actually a "Core_Root" directory, but all it needs is to find mcs. - name: SuperPmiMcsPath value: $(_runtimeDownloadPath) + - ${{ if eq(parameters.SuperPmiCollect, true) }}: - MchFileTag: '${{ parameters.osGroup }}.${{ parameters.archType }}.${{ parameters.buildConfig }}' - - name: CollectionType - value: 'run' - - name: CollectionName - value: 'libraries_tests' - ${{ if ne(parameters.archType, 'x64') }}: - name: _runtimeX64DownloadPath value: '$(Build.SourcesDirectory)/artifacts/transport/${{ parameters.runtimeFlavor }}.x64' @@ -215,8 +220,8 @@ jobs: creator: dotnet-bot testRunNamePrefixSuffix: $(_testRunNamePrefixSuffix) SuperPmiCollect: ${{ parameters.SuperPmiCollect }} - SuperPmiCollectionType: $(CollectionType) - SuperPmiCollectionName: $(CollectionName) + SuperPmiCollectionType: $(SuperPmiCollectionType) + SuperPmiCollectionName: $(SuperPmiCollectionName) # coreclrTestGroup: The following mappings of 'coreclrTestGroup' to 'scenarios' is copied from # eng/pipelines/common/templates/runtimes/run-test-job.yml (with 'testGroup' replaced by 'coreclrTestGroup' @@ -244,6 +249,8 @@ jobs: ${{ if in(parameters.coreclrTestGroup, 'superpmi_collection') }}: scenarios: - normal + ${{ if in(parameters.coreclrTestGroup, 'superpmi_collection_no_tiered_compilation') }}: + scenarios: - no_tiered_compilation ${{ if in(parameters.coreclrTestGroup, 'jitstress') }}: scenarios: @@ -351,8 +358,8 @@ jobs: displayName: 'Create SuperPMI directories $(MergedMchFileLocation), $(SpmiLogsLocation)' condition: always() - - script: $(PythonScript) $(Build.SourcesDirectory)/src/coreclr/scripts/superpmi.py merge-mch -log_level DEBUG -pattern $(MchFilesLocation)$(CollectionName).$(CollectionType)*.mch -output_mch_path $(MergedMchFileLocation)$(CollectionName).$(CollectionType).$(MchFileTag).mch -core_root $(SuperPmiMcsPath) - displayName: 'Merge $(CollectionName)-$(CollectionType) SuperPMI collections' + - script: $(PythonScript) $(Build.SourcesDirectory)/src/coreclr/scripts/superpmi.py merge-mch -log_level DEBUG -pattern $(MchFilesLocation)$(SuperPmiCollectionName).$(SuperPmiCollectionType)*.mch -output_mch_path $(MergedMchFileLocation)$(SuperPmiCollectionName).$(SuperPmiCollectionType).$(MchFileTag).mch -core_root $(SuperPmiMcsPath) + displayName: 'Merge $(SuperPmiCollectionName)-$(SuperPmiCollectionType) SuperPMI collections' condition: always() - template: /eng/pipelines/common/upload-artifact-step.yml @@ -362,8 +369,8 @@ jobs: archiveType: $(archiveType) tarCompression: $(tarCompression) archiveExtension: $(archiveExtension) - artifactName: 'SuperPMI_Collection_$(CollectionName)_$(CollectionType)_$(osGroup)$(osSubgroup)_$(archType)_$(buildConfig)' - displayName: 'Upload artifacts SuperPMI $(CollectionName)-$(CollectionType) collection' + artifactName: 'SuperPMI_Collection_$(SuperPmiCollectionName)_$(SuperPmiCollectionType)_$(osGroup)$(osSubgroup)_$(archType)_$(buildConfig)' + displayName: 'Upload artifacts SuperPMI $(SuperPmiCollectionName)-$(SuperPmiCollectionType) collection' condition: always() # Add authenticated pip feed @@ -379,8 +386,8 @@ jobs: displayName: Upgrade Pip to latest and install azure-storage-blob Python package condition: always() - - script: $(PythonScript) $(Build.SourcesDirectory)/src/coreclr/scripts/superpmi.py upload -log_level DEBUG -arch $(archType) -build_type $(buildConfig) -mch_files $(MergedMchFileLocation)$(CollectionName).$(CollectionType).$(MchFileTag).mch -core_root $(Build.SourcesDirectory)/artifacts/bin/coreclr/$(osGroup).x64.$(buildConfigUpper) - displayName: 'Upload SuperPMI $(CollectionName)-$(CollectionType) collection to Azure Storage' + - script: $(PythonScript) $(Build.SourcesDirectory)/src/coreclr/scripts/superpmi.py upload -log_level DEBUG -arch $(archType) -build_type $(buildConfig) -mch_files $(MergedMchFileLocation)$(SuperPmiCollectionName).$(SuperPmiCollectionType).$(MchFileTag).mch -core_root $(Build.SourcesDirectory)/artifacts/bin/coreclr/$(osGroup).x64.$(buildConfigUpper) + displayName: 'Upload SuperPMI $(SuperPmiCollectionName)-$(SuperPmiCollectionType) collection to Azure Storage' condition: always() env: CLRJIT_AZ_KEY: $(clrjit_key1) # secret key stored as variable in pipeline @@ -389,7 +396,7 @@ jobs: displayName: Copying superpmi.log of all partitions inputs: sourceFolder: '$(MchFilesLocation)' - contents: '**/$(CollectionName).$(CollectionType)*.log' + contents: '**/$(SuperPmiCollectionName).$(SuperPmiCollectionType)*.log' targetFolder: '$(SpmiLogsLocation)' condition: always() @@ -397,7 +404,7 @@ jobs: displayName: Publish SuperPMI logs inputs: targetPath: $(SpmiLogsLocation) - artifactName: 'SuperPMI_Logs_$(CollectionName)_$(CollectionType)_$(osGroup)$(osSubgroup)_$(archType)_$(buildConfig)' + artifactName: 'SuperPMI_Logs_$(SuperPmiCollectionName)_$(SuperPmiCollectionType)_$(osGroup)$(osSubgroup)_$(archType)_$(buildConfig)' condition: always() ######################################################################################################## From b1cb1ce8a0937c855615df8ea1683d684f4cdcd8 Mon Sep 17 00:00:00 2001 From: Bruce Forstall Date: Wed, 23 Aug 2023 23:30:40 -0700 Subject: [PATCH 17/28] Fix syntax --- eng/pipelines/libraries/run-test-job.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/eng/pipelines/libraries/run-test-job.yml b/eng/pipelines/libraries/run-test-job.yml index 5c7e56b93db2f..fc9e55b47e1de 100644 --- a/eng/pipelines/libraries/run-test-job.yml +++ b/eng/pipelines/libraries/run-test-job.yml @@ -96,11 +96,10 @@ jobs: - name: SuperPmiCollectionType value: 'run' - ${{ if eq(parameters.SuperPmiCollectionName, '') }}: - - name: SuperPmiCollectionName + - name: SuperPmiCollectionName + ${{ if eq(parameters.SuperPmiCollectionName, '') }}: value: 'libraries_tests' - ${{ else }}: - - name: SuperPmiCollectionName + ${{ else }}: value: ${{ parameters.SuperPmiCollectionName }} - name: _runtimeX64DownloadPath From ffbb819ec4f77bfde2e60878ab6bc77ff01bb83d Mon Sep 17 00:00:00 2001 From: Bruce Forstall Date: Wed, 23 Aug 2023 23:39:52 -0700 Subject: [PATCH 18/28] Differentiate different libraries test collections --- eng/pipelines/libraries/run-test-job.yml | 27 +++++++++++------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/eng/pipelines/libraries/run-test-job.yml b/eng/pipelines/libraries/run-test-job.yml index fc9e55b47e1de..2917e40c6da4d 100644 --- a/eng/pipelines/libraries/run-test-job.yml +++ b/eng/pipelines/libraries/run-test-job.yml @@ -24,7 +24,7 @@ parameters: # eng/pipelines/common/templates/runtimes/run-test-job.yml. coreclrTestGroup: '' SuperPmiCollect: false - SuperPmiCollectionName: '' + SuperPmiCollectionName: 'libraries_tests' dependsOn: [] jobs: @@ -46,12 +46,16 @@ jobs: testScope: ${{ parameters.testScope }} SuperPmiCollect: ${{ parameters.SuperPmiCollect }} runTests: true - ${{ if ne(parameters.liveRuntimeBuildConfig, '') }}: - displayName: ${{ format('Test Run {0} {1}', parameters.liveRuntimeBuildConfig, parameters.runtimeDisplayName) }} - name: ${{ format('test_run_{0}_{1}', parameters.liveRuntimeBuildConfig, parameters.runtimeDisplayName) }} - ${{ if eq(parameters.liveRuntimeBuildConfig, '') }}: - displayName: 'Test Run' - name: test_run + ${{ if eq(parameters.SuperPmiCollect, true) }}: + displayName: ${{ format('SuperPMI collection {0} {1} {2}', parameters.SuperPmiCollectionName, parameters.liveRuntimeBuildConfig, parameters.runtimeDisplayName) }} + name: ${{ format('spmi_{0}_{1}_{2}', parameters.SuperPmiCollectionName, parameters.liveRuntimeBuildConfig, parameters.runtimeDisplayName) }} + ${{ else }}: + ${{ if ne(parameters.liveRuntimeBuildConfig, '') }}: + displayName: ${{ format('Test Run {0} {1}', parameters.liveRuntimeBuildConfig, parameters.runtimeDisplayName) }} + name: ${{ format('test_run_{0}_{1}', parameters.liveRuntimeBuildConfig, parameters.runtimeDisplayName) }} + ${{ if eq(parameters.liveRuntimeBuildConfig, '') }}: + displayName: 'Test Run' + name: test_run ${{ if eq(parameters.interpreter, 'true') }}: testDisplayName: ${{ parameters.runtimeFlavor }}_interpreter_${{ parameters.liveRuntimeBuildConfig }} @@ -95,21 +99,14 @@ jobs: # Variables used for SuperPMI collection - name: SuperPmiCollectionType value: 'run' - - name: SuperPmiCollectionName - ${{ if eq(parameters.SuperPmiCollectionName, '') }}: - value: 'libraries_tests' - ${{ else }}: - value: ${{ parameters.SuperPmiCollectionName }} - + value: ${{ parameters.SuperPmiCollectionName }} - name: _runtimeX64DownloadPath value: '' - # superpmi.py 'merge-mch' needs to be able to find the mcs tool. Point SuperPmiMcsPath at the downloaded CoreCLR binaries. For non-x64 targets, download an x64 # build and point at that. Pass this to superpmi.py as the '-core_root' argument. It's not actually a "Core_Root" directory, but all it needs is to find mcs. - name: SuperPmiMcsPath value: $(_runtimeDownloadPath) - - ${{ if eq(parameters.SuperPmiCollect, true) }}: - MchFileTag: '${{ parameters.osGroup }}.${{ parameters.archType }}.${{ parameters.buildConfig }}' - ${{ if ne(parameters.archType, 'x64') }}: From 39cd4d3e97431f2de1da1d6759659616e35ca41b Mon Sep 17 00:00:00 2001 From: Bruce Forstall Date: Thu, 24 Aug 2023 18:04:26 -0700 Subject: [PATCH 19/28] Fix CultureInfoCurrentCulture.cs test It needs to copy `SuperPMIShim*` environment variables when creating a new "empty" environment. (It already copies `DOTNET_*` variables.) --- .../tests/CultureInfo/CultureInfoCurrentCulture.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/System.Globalization/tests/CultureInfo/CultureInfoCurrentCulture.cs b/src/libraries/System.Globalization/tests/CultureInfo/CultureInfoCurrentCulture.cs index 1dbebd7bb292d..17d6119116858 100644 --- a/src/libraries/System.Globalization/tests/CultureInfo/CultureInfoCurrentCulture.cs +++ b/src/libraries/System.Globalization/tests/CultureInfo/CultureInfoCurrentCulture.cs @@ -182,7 +182,7 @@ public void CurrentCulture_DefaultWithNoLang(string langEnvVar) private static void CopyEssentialTestEnvironment(IDictionary environment) { string[] essentialVariables = { "HOME", "LD_LIBRARY_PATH", "ICU_DATA" }; - string[] prefixedVariables = { "DOTNET_", "COMPlus_" }; + string[] prefixedVariables = { "DOTNET_", "COMPlus_", "SuperPMIShim" }; foreach (DictionaryEntry de in Environment.GetEnvironmentVariables()) { From b623fd7031a67510aa358a2457146142b2f27df5 Mon Sep 17 00:00:00 2001 From: Bruce Forstall Date: Thu, 24 Aug 2023 18:11:42 -0700 Subject: [PATCH 20/28] Re-enable all collections --- eng/pipelines/coreclr/superpmi-collect.yml | 281 ++++++++++----------- 1 file changed, 140 insertions(+), 141 deletions(-) diff --git a/eng/pipelines/coreclr/superpmi-collect.yml b/eng/pipelines/coreclr/superpmi-collect.yml index 22b6fca25acc8..ec56e2bc1af10 100644 --- a/eng/pipelines/coreclr/superpmi-collect.yml +++ b/eng/pipelines/coreclr/superpmi-collect.yml @@ -73,65 +73,65 @@ extends: jobParameters: testGroup: outerloop -# - template: /eng/pipelines/common/platform-matrix.yml -# parameters: -# jobTemplate: /eng/pipelines/coreclr/templates/superpmi-collect-job.yml -# buildConfig: checked -# platforms: -# - osx_arm64 -# - linux_arm -# - linux_arm64 -# - linux_x64 -# - windows_x64 -# - windows_x86 -# - windows_arm64 -# helixQueueGroup: ci -# helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml -# jobParameters: -# testGroup: outerloop -# liveLibrariesBuildConfig: Release -# collectionType: pmi -# collectionName: libraries -# -# - template: /eng/pipelines/common/platform-matrix.yml -# parameters: -# jobTemplate: /eng/pipelines/coreclr/templates/superpmi-collect-job.yml -# buildConfig: checked -# platforms: -# - osx_arm64 -# - linux_arm -# - linux_arm64 -# - linux_x64 -# - windows_x64 -# - windows_x86 -# - windows_arm64 -# helixQueueGroup: ci -# helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml -# jobParameters: -# testGroup: outerloop -# liveLibrariesBuildConfig: Release -# collectionType: pmi -# collectionName: libraries_tests -# -# - template: /eng/pipelines/common/platform-matrix.yml -# parameters: -# jobTemplate: /eng/pipelines/coreclr/templates/superpmi-collect-job.yml -# buildConfig: checked -# platforms: -# - osx_arm64 -# - linux_arm -# - linux_arm64 -# - linux_x64 -# - windows_x64 -# - windows_x86 -# - windows_arm64 -# helixQueueGroup: ci -# helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml -# jobParameters: -# testGroup: outerloop -# liveLibrariesBuildConfig: Release -# collectionType: crossgen2 -# collectionName: libraries + - template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/coreclr/templates/superpmi-collect-job.yml + buildConfig: checked + platforms: + - osx_arm64 + - linux_arm + - linux_arm64 + - linux_x64 + - windows_x64 + - windows_x86 + - windows_arm64 + helixQueueGroup: ci + helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml + jobParameters: + testGroup: outerloop + liveLibrariesBuildConfig: Release + collectionType: pmi + collectionName: libraries + + - template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/coreclr/templates/superpmi-collect-job.yml + buildConfig: checked + platforms: + - osx_arm64 + - linux_arm + - linux_arm64 + - linux_x64 + - windows_x64 + - windows_x86 + - windows_arm64 + helixQueueGroup: ci + helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml + jobParameters: + testGroup: outerloop + liveLibrariesBuildConfig: Release + collectionType: pmi + collectionName: libraries_tests + + - template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/coreclr/templates/superpmi-collect-job.yml + buildConfig: checked + platforms: + - osx_arm64 + - linux_arm + - linux_arm64 + - linux_x64 + - windows_x64 + - windows_x86 + - windows_arm64 + helixQueueGroup: ci + helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml + jobParameters: + testGroup: outerloop + liveLibrariesBuildConfig: Release + collectionType: crossgen2 + collectionName: libraries - template: /eng/pipelines/common/platform-matrix.yml parameters: @@ -153,87 +153,87 @@ extends: collectionType: run collectionName: realworld -# - template: /eng/pipelines/common/platform-matrix.yml -# parameters: -# jobTemplate: /eng/pipelines/coreclr/templates/superpmi-collect-job.yml -# buildConfig: checked -# platforms: -# - osx_arm64 -# - linux_arm -# - linux_arm64 -# - linux_x64 -# - windows_x64 -# - windows_x86 -# - windows_arm64 -# helixQueueGroup: ci -# helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml -# jobParameters: -# testGroup: outerloop -# liveLibrariesBuildConfig: Release -# collectionType: run -# collectionName: benchmarks -# -# - template: /eng/pipelines/common/platform-matrix.yml -# parameters: -# jobTemplate: /eng/pipelines/coreclr/templates/superpmi-collect-job.yml -# buildConfig: checked -# platforms: -# - osx_arm64 -# - linux_arm -# - linux_arm64 -# - linux_x64 -# - windows_x64 -# - windows_x86 -# - windows_arm64 -# helixQueueGroup: ci -# helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml -# jobParameters: -# testGroup: outerloop -# liveLibrariesBuildConfig: Release -# collectionType: run_tiered -# collectionName: benchmarks -# -# - template: /eng/pipelines/common/platform-matrix.yml -# parameters: -# jobTemplate: /eng/pipelines/coreclr/templates/superpmi-collect-job.yml -# buildConfig: checked -# platforms: -# - osx_arm64 -# - linux_arm -# - linux_arm64 -# - linux_x64 -# - windows_x64 -# - windows_x86 -# - windows_arm64 -# helixQueueGroup: ci -# helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml -# jobParameters: -# testGroup: outerloop -# liveLibrariesBuildConfig: Release -# collectionType: run_pgo -# collectionName: benchmarks -# -# # -# # Collection of coreclr test run -# # -# - template: /eng/pipelines/common/platform-matrix.yml -# parameters: -# jobTemplate: /eng/pipelines/common/templates/runtimes/run-test-job.yml -# buildConfig: checked -# platforms: -# - osx_arm64 -# - linux_arm -# - linux_arm64 -# - linux_x64 -# - windows_x64 -# - windows_x86 -# - windows_arm64 -# helixQueueGroup: superpmi -# helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml -# jobParameters: -# testGroup: outerloop -# liveLibrariesBuildConfig: Release -# SuperPmiCollect: true + - template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/coreclr/templates/superpmi-collect-job.yml + buildConfig: checked + platforms: + - osx_arm64 + - linux_arm + - linux_arm64 + - linux_x64 + - windows_x64 + - windows_x86 + - windows_arm64 + helixQueueGroup: ci + helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml + jobParameters: + testGroup: outerloop + liveLibrariesBuildConfig: Release + collectionType: run + collectionName: benchmarks + + - template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/coreclr/templates/superpmi-collect-job.yml + buildConfig: checked + platforms: + - osx_arm64 + - linux_arm + - linux_arm64 + - linux_x64 + - windows_x64 + - windows_x86 + - windows_arm64 + helixQueueGroup: ci + helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml + jobParameters: + testGroup: outerloop + liveLibrariesBuildConfig: Release + collectionType: run_tiered + collectionName: benchmarks + + - template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/coreclr/templates/superpmi-collect-job.yml + buildConfig: checked + platforms: + - osx_arm64 + - linux_arm + - linux_arm64 + - linux_x64 + - windows_x64 + - windows_x86 + - windows_arm64 + helixQueueGroup: ci + helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml + jobParameters: + testGroup: outerloop + liveLibrariesBuildConfig: Release + collectionType: run_pgo + collectionName: benchmarks + + # + # Collection of coreclr test run + # + - template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/common/templates/runtimes/run-test-job.yml + buildConfig: checked + platforms: + - osx_arm64 + - linux_arm + - linux_arm64 + - linux_x64 + - windows_x64 + - windows_x86 + - windows_arm64 + helixQueueGroup: superpmi + helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml + jobParameters: + testGroup: outerloop + liveLibrariesBuildConfig: Release + SuperPmiCollect: true # # Collection of libraries test run: normal @@ -288,4 +288,3 @@ extends: coreclrTestGroup: superpmi_collection_no_tiered_compilation SuperPmiCollect: true SuperPmiCollectionName: libraries_tests_no_tiered_compilation - From c3d5f7a53ad7b68d66602cb03cb68d1c8062164f Mon Sep 17 00:00:00 2001 From: Bruce Forstall Date: Thu, 24 Aug 2023 18:16:37 -0700 Subject: [PATCH 21/28] Remove code to display disk space --- eng/pipelines/libraries/run-test-job.yml | 42 ++---------------------- 1 file changed, 2 insertions(+), 40 deletions(-) diff --git a/eng/pipelines/libraries/run-test-job.yml b/eng/pipelines/libraries/run-test-job.yml index 2917e40c6da4d..97076ce96ec79 100644 --- a/eng/pipelines/libraries/run-test-job.yml +++ b/eng/pipelines/libraries/run-test-job.yml @@ -141,17 +141,6 @@ jobs: steps: - - ${{ if eq(parameters.SuperPmiCollect, true) }}: - - ${{ if ne(parameters.osGroup, 'windows') }}: - - script: | - echo 'df -H' - df -H - echo 'df -H Build.SourcesDirectory' - df -H $(Build.SourcesDirectory) - displayName: 'Display disk space before' - condition: always() - continueOnError: true - # SuperPMI collection: Download x64 coreclr if running on non-x64 configuration (needed for mcs.exe on AzDO machine; see `SuperPmiMcsPath`. - ${{ if and(eq(parameters.SuperPmiCollect, true), ne(parameters.archType, 'x64')) }}: - template: /eng/pipelines/common/download-artifact-step.yml @@ -189,19 +178,6 @@ jobs: /bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/overrideRuntimeFromLiveDrop.binlog displayName: Prepare TestHost with runtime $(runtimeFlavorName) - - ${{ if eq(parameters.SuperPmiCollect, true) }}: - - ${{ if ne(parameters.osGroup, 'windows') }}: - - script: | - echo 'df -H' - df -H - echo 'df -H Build.SourcesDirectory' - df -H $(Build.SourcesDirectory) - echo 'du Build.SourcesDirectory/artifacts' - du $(Build.SourcesDirectory)/artifacts - displayName: 'Display disk space before Helix' - condition: always() - continueOnError: true - - template: /eng/pipelines/libraries/helix.yml parameters: runtimeFlavor: ${{ parameters.runtimeFlavor }} @@ -326,32 +302,18 @@ jobs: - ${{ if eq(parameters.SuperPmiCollect, true) }}: - - ${{ if ne(parameters.osGroup, 'windows') }}: - - script: | - echo 'df -H' - df -H - echo 'df -H Build.SourcesDirectory' - df -H $(Build.SourcesDirectory) - echo 'du -a MchFilesLocation' - du -a $(MchFilesLocation) - echo 'du Build.SourcesDirectory/artifacts' - du $(Build.SourcesDirectory)/artifacts - displayName: 'Display disk space before merging' - condition: always() - continueOnError: true - # Create required directories for merged mch collection and superpmi logs - ${{ if ne(parameters.osGroup, 'windows') }}: - script: | mkdir -p $(MergedMchFileLocation) mkdir -p $(SpmiLogsLocation) - displayName: 'Create SuperPMI directories $(MergedMchFileLocation), $(SpmiLogsLocation)' + displayName: 'Create SuperPMI directories' condition: always() - ${{ if eq(parameters.osGroup, 'windows') }}: - script: | mkdir $(MergedMchFileLocation) mkdir $(SpmiLogsLocation) - displayName: 'Create SuperPMI directories $(MergedMchFileLocation), $(SpmiLogsLocation)' + displayName: 'Create SuperPMI directories' condition: always() - script: $(PythonScript) $(Build.SourcesDirectory)/src/coreclr/scripts/superpmi.py merge-mch -log_level DEBUG -pattern $(MchFilesLocation)$(SuperPmiCollectionName).$(SuperPmiCollectionType)*.mch -output_mch_path $(MergedMchFileLocation)$(SuperPmiCollectionName).$(SuperPmiCollectionType).$(MchFileTag).mch -core_root $(SuperPmiMcsPath) From 0ea2128830f6b72aef94cdd94f953eaee8ba1272 Mon Sep 17 00:00:00 2001 From: Bruce Forstall Date: Thu, 24 Aug 2023 18:23:22 -0700 Subject: [PATCH 22/28] Restore tests.targets; no changes were necessary --- eng/testing/tests.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/testing/tests.targets b/eng/testing/tests.targets index 70d9759dda6ad..f4bf46cd298cb 100644 --- a/eng/testing/tests.targets +++ b/eng/testing/tests.targets @@ -95,7 +95,6 @@ - $(RunScriptCommand) $RSP_FILE @@ -196,4 +195,5 @@ TEST_ARCH=$(_AndroidArchitecture) + From b6eaf8f822927b87d01c6479835cb35439b36b3c Mon Sep 17 00:00:00 2001 From: Bruce Forstall Date: Thu, 24 Aug 2023 18:23:49 -0700 Subject: [PATCH 23/28] Remove unnecessary extra output from sendtohelix.proj --- src/libraries/sendtohelix.proj | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libraries/sendtohelix.proj b/src/libraries/sendtohelix.proj index 1e12decfae4e5..44a02cd5b828e 100644 --- a/src/libraries/sendtohelix.proj +++ b/src/libraries/sendtohelix.proj @@ -241,7 +241,6 @@ - From ca6636217aa670cfa1159454e7fa467d412f025e Mon Sep 17 00:00:00 2001 From: Bruce Forstall Date: Mon, 28 Aug 2023 16:07:30 -0700 Subject: [PATCH 24/28] Extract SuperPMI post-processing steps to a separate yml file. --- eng/pipelines/libraries/run-test-job.yml | 135 ++++-------------- .../libraries/superpmi-postprocess-step.yml | 87 +++++++++++ 2 files changed, 117 insertions(+), 105 deletions(-) create mode 100644 eng/pipelines/libraries/superpmi-postprocess-step.yml diff --git a/eng/pipelines/libraries/run-test-job.yml b/eng/pipelines/libraries/run-test-job.yml index 97076ce96ec79..e5f270b0ecff8 100644 --- a/eng/pipelines/libraries/run-test-job.yml +++ b/eng/pipelines/libraries/run-test-job.yml @@ -24,6 +24,7 @@ parameters: # eng/pipelines/common/templates/runtimes/run-test-job.yml. coreclrTestGroup: '' SuperPmiCollect: false + SuperPmiCollectionType: 'run' SuperPmiCollectionName: 'libraries_tests' dependsOn: [] @@ -76,39 +77,25 @@ jobs: - ${{ format('{0}_{1}_product_build_{2}{3}_{4}_{5}', 'coreclr', '', parameters.osGroup, parameters.osSubgroup, 'x64', parameters.liveRuntimeBuildConfig) }} variables: - # Convenience variables - - name: buildConfig - value: ${{ parameters.buildConfig }} - - name: archType - value: ${{ parameters.archType }} - - name: osGroup - value: ${{ parameters.osGroup }} - - name: osSubgroup - value: ${{ parameters.osSubgroup }} - - name: buildConfigUpper - ${{ if eq(parameters.buildConfig, 'debug') }}: - value: 'Debug' - ${{ if eq(parameters.buildConfig, 'release') }}: - value: 'Release' - ${{ if eq(parameters.buildConfig, 'checked') }}: - value: 'Checked' - librariesTestsArtifactName: ${{ format('libraries_test_assets_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} - _archiveTestsParameter: /p:ArchiveTests=true # Variables used for SuperPMI collection - - name: SuperPmiCollectionType - value: 'run' - - name: SuperPmiCollectionName - value: ${{ parameters.SuperPmiCollectionName }} - - name: _runtimeX64DownloadPath - value: '' - # superpmi.py 'merge-mch' needs to be able to find the mcs tool. Point SuperPmiMcsPath at the downloaded CoreCLR binaries. For non-x64 targets, download an x64 - # build and point at that. Pass this to superpmi.py as the '-core_root' argument. It's not actually a "Core_Root" directory, but all it needs is to find mcs. - - name: SuperPmiMcsPath - value: $(_runtimeDownloadPath) - ${{ if eq(parameters.SuperPmiCollect, true) }}: - - MchFileTag: '${{ parameters.osGroup }}.${{ parameters.archType }}.${{ parameters.buildConfig }}' + - name: buildConfigUpper + ${{ if eq(parameters.buildConfig, 'debug') }}: + value: 'Debug' + ${{ if eq(parameters.buildConfig, 'release') }}: + value: 'Release' + ${{ if eq(parameters.buildConfig, 'checked') }}: + value: 'Checked' + - name: _runtimeX64DownloadPath + value: '' + # superpmi.py 'merge-mch' needs to be able to find the mcs tool. Point SuperPmiMcsPath at the downloaded CoreCLR binaries. For non-x64 targets, download an x64 + # build and point at that. Pass this to superpmi.py as the '-core_root' argument. It's not actually a "Core_Root" directory, but all it needs is to find mcs. + - name: SuperPmiMcsPath + value: $(_runtimeDownloadPath) - ${{ if ne(parameters.archType, 'x64') }}: - name: _runtimeX64DownloadPath value: '$(Build.SourcesDirectory)/artifacts/transport/${{ parameters.runtimeFlavor }}.x64' @@ -192,8 +179,8 @@ jobs: creator: dotnet-bot testRunNamePrefixSuffix: $(_testRunNamePrefixSuffix) SuperPmiCollect: ${{ parameters.SuperPmiCollect }} - SuperPmiCollectionType: $(SuperPmiCollectionType) - SuperPmiCollectionName: $(SuperPmiCollectionName) + SuperPmiCollectionType: ${{ parameters.SuperPmiCollectionType }} + SuperPmiCollectionName: ${{ parameters.SuperPmiCollectionName }} # coreclrTestGroup: The following mappings of 'coreclrTestGroup' to 'scenarios' is copied from # eng/pipelines/common/templates/runtimes/run-test-job.yml (with 'testGroup' replaced by 'coreclrTestGroup' @@ -292,81 +279,19 @@ jobs: - syntheticpgo - syntheticpgo_blend - ######################################################################################################## - # - # Finalize SuperPMI collection: (1) merge all MCH files generated by all Helix jobs, (2) upload MCH file to Azure Storage, (3) upload log files - # Note that all these steps are "condition: always()" because we want to upload as much of the collection - # as possible, even if there were test failures. - # - ######################################################################################################## - - ${{ if eq(parameters.SuperPmiCollect, true) }}: - - # Create required directories for merged mch collection and superpmi logs - - ${{ if ne(parameters.osGroup, 'windows') }}: - - script: | - mkdir -p $(MergedMchFileLocation) - mkdir -p $(SpmiLogsLocation) - displayName: 'Create SuperPMI directories' - condition: always() - - ${{ if eq(parameters.osGroup, 'windows') }}: - - script: | - mkdir $(MergedMchFileLocation) - mkdir $(SpmiLogsLocation) - displayName: 'Create SuperPMI directories' - condition: always() - - - script: $(PythonScript) $(Build.SourcesDirectory)/src/coreclr/scripts/superpmi.py merge-mch -log_level DEBUG -pattern $(MchFilesLocation)$(SuperPmiCollectionName).$(SuperPmiCollectionType)*.mch -output_mch_path $(MergedMchFileLocation)$(SuperPmiCollectionName).$(SuperPmiCollectionType).$(MchFileTag).mch -core_root $(SuperPmiMcsPath) - displayName: 'Merge $(SuperPmiCollectionName)-$(SuperPmiCollectionType) SuperPMI collections' - condition: always() - - - template: /eng/pipelines/common/upload-artifact-step.yml + - template: /eng/pipelines/libraries/superpmi-postprocess-step.yml parameters: - rootFolder: $(MergedMchFileLocation) - includeRootFolder: false - archiveType: $(archiveType) - tarCompression: $(tarCompression) - archiveExtension: $(archiveExtension) - artifactName: 'SuperPMI_Collection_$(SuperPmiCollectionName)_$(SuperPmiCollectionType)_$(osGroup)$(osSubgroup)_$(archType)_$(buildConfig)' - displayName: 'Upload artifacts SuperPMI $(SuperPmiCollectionName)-$(SuperPmiCollectionType) collection' - condition: always() - - # Add authenticated pip feed - - task: PipAuthenticate@1 - displayName: 'Pip Authenticate' - inputs: - artifactFeeds: public/dotnet-public-pypi - onlyAddExtraIndex: false - condition: always() - - # 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 - condition: always() - - - script: $(PythonScript) $(Build.SourcesDirectory)/src/coreclr/scripts/superpmi.py upload -log_level DEBUG -arch $(archType) -build_type $(buildConfig) -mch_files $(MergedMchFileLocation)$(SuperPmiCollectionName).$(SuperPmiCollectionType).$(MchFileTag).mch -core_root $(Build.SourcesDirectory)/artifacts/bin/coreclr/$(osGroup).x64.$(buildConfigUpper) - displayName: 'Upload SuperPMI $(SuperPmiCollectionName)-$(SuperPmiCollectionType) collection to Azure Storage' - condition: always() - env: - CLRJIT_AZ_KEY: $(clrjit_key1) # secret key stored as variable in pipeline - - - task: CopyFiles@2 - displayName: Copying superpmi.log of all partitions - inputs: - sourceFolder: '$(MchFilesLocation)' - contents: '**/$(SuperPmiCollectionName).$(SuperPmiCollectionType)*.log' - targetFolder: '$(SpmiLogsLocation)' - condition: always() - - - task: PublishPipelineArtifact@1 - displayName: Publish SuperPMI logs - inputs: - targetPath: $(SpmiLogsLocation) - artifactName: 'SuperPMI_Logs_$(SuperPmiCollectionName)_$(SuperPmiCollectionType)_$(osGroup)$(osSubgroup)_$(archType)_$(buildConfig)' - condition: always() - - ######################################################################################################## - # - # End of SuperPMI processing - # - ######################################################################################################## + buildConfig: ${{ parameters.buildConfig }} + buildConfigUpper: $(buildConfigUpper) + osGroup: ${{ parameters.osGroup }} + osSubgroup: ${{ parameters.osSubgroup }} + archType: ${{ parameters.archType }} + SuperPmiCollectionType: ${{ parameters.SuperPmiCollectionType }} + SuperPmiCollectionName: ${{ parameters.SuperPmiCollectionName }} + MergedMchFileLocation: $(MergedMchFileLocation) + MchFilesLocation: $(MchFilesLocation) + SpmiLogsLocation: $(SpmiLogsLocation) + SuperPmiMcsPath: $(SuperPmiMcsPath) + PythonScript: $(PythonScript) + PipScript: $(PipScript) \ No newline at end of file diff --git a/eng/pipelines/libraries/superpmi-postprocess-step.yml b/eng/pipelines/libraries/superpmi-postprocess-step.yml new file mode 100644 index 0000000000000..ef29b332c7517 --- /dev/null +++ b/eng/pipelines/libraries/superpmi-postprocess-step.yml @@ -0,0 +1,87 @@ +######################################################################################################## +# +# Finalize SuperPMI collection: (1) merge all MCH files generated by all Helix jobs, (2) upload MCH file +# to Azure Storage, (3) upload log files. Note that the steps are "condition: always()" because we want +# to upload as much of the collection as possible, even if there were test failures. +# +######################################################################################################## + +parameters: + buildConfig: '' + buildConfigUpper: '' + osGroup: '' + osSubgroup: '' + archType: '' + SuperPmiCollectionType: 'run' + SuperPmiCollectionName: 'libraries_tests' + MergedMchFileLocation: '' + MchFilesLocation: '' + SpmiLogsLocation: '' + SuperPmiMcsPath: '' + PythonScript: '' + PipScript: '' + +steps: + + # Create required directories for merged mch collection and superpmi logs + - ${{ if ne(parameters.osGroup, 'windows') }}: + - script: | + mkdir -p ${{ parameters.MergedMchFileLocation }} + mkdir -p ${{ parameters.SpmiLogsLocation }} + displayName: 'Create SuperPMI directories' + condition: always() + - ${{ if eq(parameters.osGroup, 'windows') }}: + - script: | + mkdir ${{ parameters.MergedMchFileLocation }} + mkdir ${{ parameters.SpmiLogsLocation }} + displayName: 'Create SuperPMI directories' + condition: always() + + - script: ${{ parameters.PythonScript }} $(Build.SourcesDirectory)/src/coreclr/scripts/superpmi.py merge-mch -log_level DEBUG -pattern ${{ parameters.MchFilesLocation }}${{ parameters.SuperPmiCollectionName }}.${{ parameters.SuperPmiCollectionType }}*.mch -output_mch_path ${{ parameters.MergedMchFileLocation }}${{ parameters.SuperPmiCollectionName }}.${{ parameters.SuperPmiCollectionType }}.${{ parameters.osGroup }}.${{ parameters.archType }}.${{ parameters.buildConfig }}.mch -core_root ${{ parameters.SuperPmiMcsPath }} + displayName: 'Merge ${{ parameters.SuperPmiCollectionName }}-${{ parameters.SuperPmiCollectionType }} SuperPMI collections' + condition: always() + + - template: /eng/pipelines/common/upload-artifact-step.yml + parameters: + rootFolder: ${{ parameters.MergedMchFileLocation }} + includeRootFolder: false + archiveType: $(archiveType) + tarCompression: $(tarCompression) + archiveExtension: $(archiveExtension) + artifactName: 'SuperPMI_Collection_${{ parameters.SuperPmiCollectionName }}_${{ parameters.SuperPmiCollectionType }}_${{ parameters.osGroup }}${{ parameters.osSubgroup }}_${{ parameters.archType }}_${{ parameters.buildConfig }}' + displayName: 'Upload artifacts SuperPMI ${{ parameters.SuperPmiCollectionName }}-${{ parameters.SuperPmiCollectionType }} collection' + condition: always() + + # Add authenticated pip feed + - task: PipAuthenticate@1 + displayName: 'Pip Authenticate' + inputs: + artifactFeeds: public/dotnet-public-pypi + onlyAddExtraIndex: false + condition: always() + + # Ensure the Python azure-storage-blob package is installed before doing the upload. + - script: ${{ parameters.PipScript }} install --user --upgrade pip && ${{ parameters.PipScript }} install --user azure.storage.blob==12.5.0 --force-reinstall + displayName: Upgrade Pip to latest and install azure-storage-blob Python package + condition: always() + + - script: ${{ parameters.PythonScript }} $(Build.SourcesDirectory)/src/coreclr/scripts/superpmi.py upload -log_level DEBUG -arch ${{ parameters.archType }} -build_type ${{ parameters.buildConfig }} -mch_files ${{ parameters.MergedMchFileLocation }}${{ parameters.SuperPmiCollectionName }}.${{ parameters.SuperPmiCollectionType }}.${{ parameters.osGroup }}.${{ parameters.archType }}.${{ parameters.buildConfig }}.mch -core_root $(Build.SourcesDirectory)/artifacts/bin/coreclr/${{ parameters.osGroup }}.x64.${{ parameters.buildConfigUpper }} + displayName: 'Upload SuperPMI ${{ parameters.SuperPmiCollectionName }}-${{ parameters.SuperPmiCollectionType }} collection to Azure Storage' + condition: always() + env: + CLRJIT_AZ_KEY: $(clrjit_key1) # secret key stored as variable in pipeline + + - task: CopyFiles@2 + displayName: Copying superpmi.log of all partitions + inputs: + sourceFolder: '${{ parameters.MchFilesLocation }}' + contents: '**/${{ parameters.SuperPmiCollectionName }}.${{ parameters.SuperPmiCollectionType }}*.log' + targetFolder: '${{ parameters.SpmiLogsLocation }}' + condition: always() + + - task: PublishPipelineArtifact@1 + displayName: Publish SuperPMI logs + inputs: + targetPath: ${{ parameters.SpmiLogsLocation }} + artifactName: 'SuperPMI_Logs_${{ parameters.SuperPmiCollectionName }}_${{ parameters.SuperPmiCollectionType }}_${{ parameters.osGroup }}${{ parameters.osSubgroup }}_${{ parameters.archType }}_${{ parameters.buildConfig }}' + condition: always() \ No newline at end of file From d735ddbbf7b890943c217c9225bddddcd6981c68 Mon Sep 17 00:00:00 2001 From: Bruce Forstall Date: Mon, 28 Aug 2023 17:58:04 -0700 Subject: [PATCH 25/28] Fix osGroup, osSubgroup references --- eng/pipelines/libraries/run-test-job.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/pipelines/libraries/run-test-job.yml b/eng/pipelines/libraries/run-test-job.yml index e5f270b0ecff8..070fa060922f8 100644 --- a/eng/pipelines/libraries/run-test-job.yml +++ b/eng/pipelines/libraries/run-test-job.yml @@ -133,8 +133,8 @@ jobs: - template: /eng/pipelines/common/download-artifact-step.yml parameters: unpackFolder: $(_runtimeX64DownloadPath) - artifactFileName: 'CoreCLRProduct___$(osGroup)$(osSubgroup)_x64_${{ parameters.liveRuntimeBuildConfig }}$(archiveExtension)' - artifactName: 'CoreCLRProduct___$(osGroup)$(osSubgroup)_x64_${{ parameters.liveRuntimeBuildConfig }}' + artifactFileName: 'CoreCLRProduct___${{ parameters.osGroup }}${{ parameters.osSubgroup }}_x64_${{ parameters.liveRuntimeBuildConfig }}$(archiveExtension)' + artifactName: 'CoreCLRProduct___${{ parameters.osGroup }}${{ parameters.osSubgroup }}_x64_${{ parameters.liveRuntimeBuildConfig }}' displayName: 'CoreCLR product build (x64)' - template: /eng/pipelines/common/download-artifact-step.yml From a71c37fa19db3e308fdbe546a61251124c1cffe3 Mon Sep 17 00:00:00 2001 From: Bruce Forstall Date: Mon, 28 Aug 2023 17:59:23 -0700 Subject: [PATCH 26/28] Extract some SuperPMI collection steps from run-test-job.xml Put HelixPreCommand and HelixPostCommand specification in sendtohelix-superpmi-collect.targets file. Note that the order of these commands should not be sensitive (that is, it should not matter if they are added before or after other Helix commands). --- .../sendtohelix-superpmi-collect.targets | 59 +++++++++++++++++++ src/libraries/sendtohelixhelp.proj | 53 +---------------- 2 files changed, 60 insertions(+), 52 deletions(-) create mode 100644 src/libraries/sendtohelix-superpmi-collect.targets diff --git a/src/libraries/sendtohelix-superpmi-collect.targets b/src/libraries/sendtohelix-superpmi-collect.targets new file mode 100644 index 0000000000000..5affc58dd36ef --- /dev/null +++ b/src/libraries/sendtohelix-superpmi-collect.targets @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/libraries/sendtohelixhelp.proj b/src/libraries/sendtohelixhelp.proj index 7a67738fffc93..b65627cffb10b 100644 --- a/src/libraries/sendtohelixhelp.proj +++ b/src/libraries/sendtohelixhelp.proj @@ -21,6 +21,7 @@ + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 04a3e1aa2dc29e4b1aec702b9cd3e6046fb00033 Mon Sep 17 00:00:00 2001 From: Bruce Forstall Date: Tue, 29 Aug 2023 19:50:05 -0700 Subject: [PATCH 27/28] Extract setting variables from run-test-job.yml Add superpmi-collect-variables.yml "variables template". These are used by the superpmi-postprocess-step.yml file, as well as other SuperPMI collection code. --- eng/pipelines/libraries/run-test-job.yml | 81 +++++++------------ .../libraries/superpmi-collect-variables.yml | 54 +++++++++++++ 2 files changed, 81 insertions(+), 54 deletions(-) create mode 100644 eng/pipelines/libraries/superpmi-collect-variables.yml diff --git a/eng/pipelines/libraries/run-test-job.yml b/eng/pipelines/libraries/run-test-job.yml index 070fa060922f8..8ea7b961c4a14 100644 --- a/eng/pipelines/libraries/run-test-job.yml +++ b/eng/pipelines/libraries/run-test-job.yml @@ -28,6 +28,31 @@ parameters: SuperPmiCollectionName: 'libraries_tests' dependsOn: [] +variables: + + - ${{ if ne(parameters.liveRuntimeBuildConfig, '') }}: + - name: runTestJobDisplayName + value: ${{ format('Test Run {0} {1}', parameters.liveRuntimeBuildConfig, parameters.runtimeDisplayName) }} + - name: runTestJobName + value: ${{ format('test_run_{0}_{1}', parameters.liveRuntimeBuildConfig, parameters.runtimeDisplayName) }} + - ${{ if eq(parameters.liveRuntimeBuildConfig, '') }}: + - name: runTestJobDisplayName + value: 'Test Run' + - name: runTestJobName + value: test_run + - ${{ if eq(parameters.SuperPmiCollect, true) }}: + - template: /eng/pipelines/libraries/superpmi-collect-variables.yml + parameters: + buildConfig: ${{ parameters.buildConfig }} + osGroup: ${{ parameters.osGroup }} + osSubgroup: ${{ parameters.osSubgroup }} + archType: ${{ parameters.archType }} + liveRuntimeBuildConfig: ${{ parameters.liveRuntimeBuildConfig }} + runtimeFlavor: ${{ parameters.runtimeFlavor }} + runtimeDisplayName: ${{ parameters.runtimeDisplayName }} + SuperPmiCollectionType: ${{ parameters.SuperPmiCollectionType }} + SuperPmiCollectionName: ${{ parameters.SuperPmiCollectionName }} + jobs: - template: /eng/pipelines/libraries/base-job.yml parameters: @@ -47,16 +72,8 @@ jobs: testScope: ${{ parameters.testScope }} SuperPmiCollect: ${{ parameters.SuperPmiCollect }} runTests: true - ${{ if eq(parameters.SuperPmiCollect, true) }}: - displayName: ${{ format('SuperPMI collection {0} {1} {2}', parameters.SuperPmiCollectionName, parameters.liveRuntimeBuildConfig, parameters.runtimeDisplayName) }} - name: ${{ format('spmi_{0}_{1}_{2}', parameters.SuperPmiCollectionName, parameters.liveRuntimeBuildConfig, parameters.runtimeDisplayName) }} - ${{ else }}: - ${{ if ne(parameters.liveRuntimeBuildConfig, '') }}: - displayName: ${{ format('Test Run {0} {1}', parameters.liveRuntimeBuildConfig, parameters.runtimeDisplayName) }} - name: ${{ format('test_run_{0}_{1}', parameters.liveRuntimeBuildConfig, parameters.runtimeDisplayName) }} - ${{ if eq(parameters.liveRuntimeBuildConfig, '') }}: - displayName: 'Test Run' - name: test_run + displayName: $(runTestJobDisplayName) + name: $(runTestJobName) ${{ if eq(parameters.interpreter, 'true') }}: testDisplayName: ${{ parameters.runtimeFlavor }}_interpreter_${{ parameters.liveRuntimeBuildConfig }} @@ -80,50 +97,6 @@ jobs: - librariesTestsArtifactName: ${{ format('libraries_test_assets_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} - _archiveTestsParameter: /p:ArchiveTests=true - - # Variables used for SuperPMI collection - - ${{ if eq(parameters.SuperPmiCollect, true) }}: - - name: buildConfigUpper - ${{ if eq(parameters.buildConfig, 'debug') }}: - value: 'Debug' - ${{ if eq(parameters.buildConfig, 'release') }}: - value: 'Release' - ${{ if eq(parameters.buildConfig, 'checked') }}: - value: 'Checked' - - name: _runtimeX64DownloadPath - value: '' - # superpmi.py 'merge-mch' needs to be able to find the mcs tool. Point SuperPmiMcsPath at the downloaded CoreCLR binaries. For non-x64 targets, download an x64 - # build and point at that. Pass this to superpmi.py as the '-core_root' argument. It's not actually a "Core_Root" directory, but all it needs is to find mcs. - - name: SuperPmiMcsPath - value: $(_runtimeDownloadPath) - - ${{ if ne(parameters.archType, 'x64') }}: - - name: _runtimeX64DownloadPath - value: '$(Build.SourcesDirectory)/artifacts/transport/${{ parameters.runtimeFlavor }}.x64' - - name: SuperPmiMcsPath - value: $(_runtimeX64DownloadPath) - - ${{ if eq(parameters.osGroup, 'windows') }}: - - name: PythonScript - value: 'py -3' - - name: PipScript - value: 'py -3 -m pip' - - name: MchFilesLocation - value: '$(Build.SourcesDirectory)\artifacts\helixresults\' - - name: MergedMchFileLocation - value: '$(Build.SourcesDirectory)\artifacts\spmi_collection\' - - name: SpmiLogsLocation - value: '$(Build.SourcesDirectory)\artifacts\spmi_logs\' - - ${{ if ne(parameters.osGroup, 'windows') }}: - - name: PythonScript - value: 'python3' - - name: PipScript - value: 'pip3' - - name: MchFilesLocation - value: '$(Build.SourcesDirectory)/artifacts/helixresults/' - - name: MergedMchFileLocation - value: '$(Build.SourcesDirectory)/artifacts/spmi_collection/' - - name: SpmiLogsLocation - value: '$(Build.SourcesDirectory)/artifacts/spmi_logs/' - - ${{ parameters.variables }} steps: diff --git a/eng/pipelines/libraries/superpmi-collect-variables.yml b/eng/pipelines/libraries/superpmi-collect-variables.yml new file mode 100644 index 0000000000000..60f4a108354ba --- /dev/null +++ b/eng/pipelines/libraries/superpmi-collect-variables.yml @@ -0,0 +1,54 @@ +parameters: + buildConfig: '' + osGroup: '' + osSubgroup: '' + archType: '' + liveRuntimeBuildConfig: '' + runtimeFlavor: 'coreclr' + runtimeDisplayName: 'coreclr' + SuperPmiCollectionType: 'run' + SuperPmiCollectionName: 'libraries_tests' + +variables: + + runTestJobDisplayName: ${{ format('SuperPMI collection {0} {1} {2}', parameters.SuperPmiCollectionName, parameters.liveRuntimeBuildConfig, parameters.runtimeDisplayName) }} + runTestJobName: ${{ format('spmi_{0}_{1}_{2}', parameters.SuperPmiCollectionName, parameters.liveRuntimeBuildConfig, parameters.runtimeDisplayName) }} + + - name: buildConfigUpper + ${{ if eq(parameters.buildConfig, 'debug') }}: + value: 'Debug' + ${{ if eq(parameters.buildConfig, 'release') }}: + value: 'Release' + - name: _runtimeX64DownloadPath + value: '' + # superpmi.py 'merge-mch' needs to be able to find the mcs tool. Point SuperPmiMcsPath at the downloaded CoreCLR binaries. For non-x64 targets, download an x64 + # build and point at that. Pass this to superpmi.py as the '-core_root' argument. It's not actually a "Core_Root" directory, but all it needs is to find mcs. + - name: SuperPmiMcsPath + value: $(_runtimeDownloadPath) + - ${{ if ne(parameters.archType, 'x64') }}: + - name: _runtimeX64DownloadPath + value: '$(Build.SourcesDirectory)/artifacts/transport/${{ parameters.runtimeFlavor }}.x64' + - name: SuperPmiMcsPath + value: $(_runtimeX64DownloadPath) + - ${{ if eq(parameters.osGroup, 'windows') }}: + - name: PythonScript + value: 'py -3' + - name: PipScript + value: 'py -3 -m pip' + - name: MchFilesLocation + value: '$(Build.SourcesDirectory)\artifacts\helixresults\' + - name: MergedMchFileLocation + value: '$(Build.SourcesDirectory)\artifacts\spmi_collection\' + - name: SpmiLogsLocation + value: '$(Build.SourcesDirectory)\artifacts\spmi_logs\' + - ${{ if ne(parameters.osGroup, 'windows') }}: + - name: PythonScript + value: 'python3' + - name: PipScript + value: 'pip3' + - name: MchFilesLocation + value: '$(Build.SourcesDirectory)/artifacts/helixresults/' + - name: MergedMchFileLocation + value: '$(Build.SourcesDirectory)/artifacts/spmi_collection/' + - name: SpmiLogsLocation + value: '$(Build.SourcesDirectory)/artifacts/spmi_logs/' \ No newline at end of file From 0f984c422c09ea51eb86a1d03f145dc281cff338 Mon Sep 17 00:00:00 2001 From: Bruce Forstall Date: Tue, 29 Aug 2023 20:39:24 -0700 Subject: [PATCH 28/28] Simplify setting to try and avoid YML error: ``` The 'stages' parameter is not a valid StageList. /eng/pipelines/libraries/run-test-job.yml (Line: 31, Col: 1): Unexpected value 'variables' ``` --- eng/pipelines/libraries/run-test-job.yml | 46 ++++++++----------- .../libraries/superpmi-collect-variables.yml | 8 ---- 2 files changed, 19 insertions(+), 35 deletions(-) diff --git a/eng/pipelines/libraries/run-test-job.yml b/eng/pipelines/libraries/run-test-job.yml index 8ea7b961c4a14..df19006b73869 100644 --- a/eng/pipelines/libraries/run-test-job.yml +++ b/eng/pipelines/libraries/run-test-job.yml @@ -28,31 +28,6 @@ parameters: SuperPmiCollectionName: 'libraries_tests' dependsOn: [] -variables: - - - ${{ if ne(parameters.liveRuntimeBuildConfig, '') }}: - - name: runTestJobDisplayName - value: ${{ format('Test Run {0} {1}', parameters.liveRuntimeBuildConfig, parameters.runtimeDisplayName) }} - - name: runTestJobName - value: ${{ format('test_run_{0}_{1}', parameters.liveRuntimeBuildConfig, parameters.runtimeDisplayName) }} - - ${{ if eq(parameters.liveRuntimeBuildConfig, '') }}: - - name: runTestJobDisplayName - value: 'Test Run' - - name: runTestJobName - value: test_run - - ${{ if eq(parameters.SuperPmiCollect, true) }}: - - template: /eng/pipelines/libraries/superpmi-collect-variables.yml - parameters: - buildConfig: ${{ parameters.buildConfig }} - osGroup: ${{ parameters.osGroup }} - osSubgroup: ${{ parameters.osSubgroup }} - archType: ${{ parameters.archType }} - liveRuntimeBuildConfig: ${{ parameters.liveRuntimeBuildConfig }} - runtimeFlavor: ${{ parameters.runtimeFlavor }} - runtimeDisplayName: ${{ parameters.runtimeDisplayName }} - SuperPmiCollectionType: ${{ parameters.SuperPmiCollectionType }} - SuperPmiCollectionName: ${{ parameters.SuperPmiCollectionName }} - jobs: - template: /eng/pipelines/libraries/base-job.yml parameters: @@ -72,8 +47,16 @@ jobs: testScope: ${{ parameters.testScope }} SuperPmiCollect: ${{ parameters.SuperPmiCollect }} runTests: true - displayName: $(runTestJobDisplayName) - name: $(runTestJobName) + ${{ if eq(parameters.SuperPmiCollect, true) }}: + displayName: ${{ format('SuperPMI collection {0} {1} {2}', parameters.SuperPmiCollectionName, parameters.liveRuntimeBuildConfig, parameters.runtimeDisplayName) }} + name: ${{ format('spmi_{0}_{1}_{2}', parameters.SuperPmiCollectionName, parameters.liveRuntimeBuildConfig, parameters.runtimeDisplayName) }} + ${{ else }}: + ${{ if ne(parameters.liveRuntimeBuildConfig, '') }}: + displayName: ${{ format('Test Run {0} {1}', parameters.liveRuntimeBuildConfig, parameters.runtimeDisplayName) }} + name: ${{ format('test_run_{0}_{1}', parameters.liveRuntimeBuildConfig, parameters.runtimeDisplayName) }} + ${{ if eq(parameters.liveRuntimeBuildConfig, '') }}: + displayName: 'Test Run' + name: test_run ${{ if eq(parameters.interpreter, 'true') }}: testDisplayName: ${{ parameters.runtimeFlavor }}_interpreter_${{ parameters.liveRuntimeBuildConfig }} @@ -97,6 +80,15 @@ jobs: - librariesTestsArtifactName: ${{ format('libraries_test_assets_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} - _archiveTestsParameter: /p:ArchiveTests=true + + - ${{ if eq(parameters.SuperPmiCollect, true) }}: + - template: /eng/pipelines/libraries/superpmi-collect-variables.yml + parameters: + buildConfig: ${{ parameters.buildConfig }} + osGroup: ${{ parameters.osGroup }} + archType: ${{ parameters.archType }} + runtimeFlavor: ${{ parameters.runtimeFlavor }} + - ${{ parameters.variables }} steps: diff --git a/eng/pipelines/libraries/superpmi-collect-variables.yml b/eng/pipelines/libraries/superpmi-collect-variables.yml index 60f4a108354ba..509bd60942450 100644 --- a/eng/pipelines/libraries/superpmi-collect-variables.yml +++ b/eng/pipelines/libraries/superpmi-collect-variables.yml @@ -1,19 +1,11 @@ parameters: buildConfig: '' osGroup: '' - osSubgroup: '' archType: '' - liveRuntimeBuildConfig: '' runtimeFlavor: 'coreclr' - runtimeDisplayName: 'coreclr' - SuperPmiCollectionType: 'run' - SuperPmiCollectionName: 'libraries_tests' variables: - runTestJobDisplayName: ${{ format('SuperPMI collection {0} {1} {2}', parameters.SuperPmiCollectionName, parameters.liveRuntimeBuildConfig, parameters.runtimeDisplayName) }} - runTestJobName: ${{ format('spmi_{0}_{1}_{2}', parameters.SuperPmiCollectionName, parameters.liveRuntimeBuildConfig, parameters.runtimeDisplayName) }} - - name: buildConfigUpper ${{ if eq(parameters.buildConfig, 'debug') }}: value: 'Debug'