Skip to content

Commit 74dd256

Browse files
authored
Allow for building helix payloads directly from build artifacts in python (#4911)
* Add test manifest support for running microbenchmarks * Add missing argument to script * Fix bugs * Fix command line parsing * Abstract out payload building * Minor fixes * Abstracting out more parts * Some more cleanup/fixes * Remove csproj changes (kept in separate branch) * Add some documentation/cleanup * Address PR comments
1 parent 2a99dcc commit 74dd256

File tree

8 files changed

+703
-486
lines changed

8 files changed

+703
-486
lines changed

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,16 @@
1212
**/.pytest_cache/
1313

1414
## VSCode .gitignore (included from https://github.com/github/gitignore/blob/master/Global/VisualStudioCode.gitignore
15-
.vscode/
15+
.vscode/*
1616
!.vscode/settings.json
1717
!.vscode/tasks.json
1818
!.vscode/launch.json
1919
!.vscode/extensions.json
20+
!.vscode/*.code-snippets
21+
!*.code-workspace
22+
23+
# Built Visual Studio Code Extensions
24+
*.vsix
2025

2126
## Ignore Visual Studio temporary files, build results, and
2227
## files generated by popular Visual Studio add-ons.

.vscode/settings.json

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,6 @@
1010
"**/packages/": true,
1111
"/tools/": true,
1212
},
13-
"python.analysis.typeCheckingMode": "strict",
14-
"python.analysis.diagnosticSeverityOverrides": {
15-
"reportMissingParameterType": "none",
16-
"reportUnnecessaryComparison": "information",
17-
"reportUnnecessaryIsInstance": "information",
18-
"reportUnusedVariable": "information",
19-
"reportMissingTypeStubs": "information"
20-
},
21-
"python.analysis.extraPaths": ["scripts"],
22-
"python.analysis.diagnosticMode": "workspace"
13+
"python.analysis.typeCheckingMode": "standard",
14+
"python.analysis.extraPaths": ["scripts"]
2315
}

eng/pipelines/templates/run-performance-job.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ parameters:
5656
iOSLlvmBuild: false # optional -- Whether to build iOS with LLVM
5757
iOSStripSymbols: false # optional -- Whether to strip symbols from the iOS build
5858
additionalSetupParameters: '' # optional -- Additional arguments to pass to the script
59+
liveLibrariesBuildConfig: '' # optional -- Build configuration when generating Core_Root for libraries
5960

6061
jobs:
6162
- template: ${{ parameters.jobTemplate }}
@@ -226,6 +227,10 @@ jobs:
226227
- '--internal'
227228
- ${{ if eq(parameters.downloadPdn, true) }}:
228229
- '--pdn-path "$(_pdnPath)"'
230+
- ${{ if ne(parameters.buildConfig, '') }}:
231+
- '--build-config ${{ parameters.buildConfig }}'
232+
- ${{ if ne(parameters.liveLibrariesBuildConfig, '') }}:
233+
- '--live-libraries-build-config ${{ parameters.liveLibrariesBuildConfig }}'
229234
- ${{ if ne(parameters.additionalSetupParameters, '') }}:
230235
- '${{ parameters.additionalSetupParameters }}'
231236
- template: /eng/pipelines/templates/send-to-helix-step.yml

eng/pipelines/templates/runtime-perf-job.yml

Lines changed: 2 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ parameters:
1616
hybridGlobalization: 'False'
1717
isScenario: false
1818
downloadSpecificBuild: null # buildId, pipeline, branchName, project
19-
crossBuild: false
2019
runtimeRepoAlias: runtime
2120
performanceRepoAlias: self
2221
selfIsRuntime: true
@@ -37,7 +36,7 @@ jobs:
3736
# Test job depends on the corresponding build job
3837
${{ if eq(parameters.downloadSpecificBuild.buildId, '') }}:
3938
dependsOn:
40-
- ${{ if not(or(in(parameters.runtimeType, 'AndroidMono', 'AndroidCoreCLR', 'iOSMono', 'iOSNativeAOT', 'wasm'), and(eq(parameters.runtimeType, 'mono'), ne(parameters.codeGenType, 'AOT')))) }}:
39+
- ${{ if not(in(parameters.runtimeType, 'AndroidMono', 'AndroidCoreCLR', 'iOSMono', 'iOSNativeAOT', 'wasm', 'mono')) }}:
4140
- ${{ format('build_{0}{1}_{2}_{3}_{4}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig, 'coreclr') }}
4241
- ${{ if and(eq(parameters.runtimeType, 'mono'), ne(parameters.codeGenType, 'AOT')) }}:
4342
- ${{ format('build_{0}{1}_{2}_{3}_{4}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig, 'mono') }}
@@ -56,20 +55,10 @@ jobs:
5655
- ${{ 'build_ios_arm64_release_iOSNativeAOT' }}
5756

5857
variables:
59-
- name: _crossBuildPropertyArg
60-
value: ''
61-
- ${{ if eq(parameters.crossBuild, true) }}:
62-
- name: _crossBuildPropertyArg
63-
value: '-cross'
6458
- name: librariesDownloadDir
6559
value: $(Build.SourcesDirectory)/artifacts
6660
- name: builtAppDir
6761
value: $(Build.SourcesDirectory)
68-
- name: librariesOverrideArg
69-
value: ''
70-
- ${{ if ne(parameters.liveLibrariesBuildConfig, '') }}:
71-
- name: librariesOverrideArg
72-
value: '/p:LibrariesConfiguration=${{ parameters.liveLibrariesBuildConfig }}'
7362

7463
- name: buildConfigUpper
7564
${{ if eq(parameters.buildConfig, 'debug') }}:
@@ -82,13 +71,9 @@ jobs:
8271
- ${{ if eq(parameters.osGroup, 'windows') }}:
8372
- name: archiveExtension
8473
value: '.zip'
85-
- name: scriptExt
86-
value: '.cmd'
8774
- ${{ else }}:
8875
- name: archiveExtension
8976
value: '.tar.gz'
90-
- name: scriptExt
91-
value: '.sh'
9277

9378
- ${{ each variable in parameters.variables }}:
9479
- ${{ variable }}
@@ -119,34 +104,13 @@ jobs:
119104
artifactName: BrowserWasm
120105
displayName: BrowserWasm
121106
${{ insert }}: ${{ parameters.downloadSpecificBuild }}
122-
123-
- script: >-
124-
mkdir -p $(librariesDownloadDir)/bin/wasm/wasm-data &&
125-
mkdir -p $(librariesDownloadDir)/bin/wasm/dotnet &&
126-
cp -r $(librariesDownloadDir)/BrowserWasm/staging/dotnet-latest/* $(librariesDownloadDir)/bin/wasm/dotnet &&
127-
cp -r $(librariesDownloadDir)/BrowserWasm/staging/built-nugets $(librariesDownloadDir)/bin/wasm &&
128-
cp src/mono/browser/test-main.js $(librariesDownloadDir)/bin/wasm/wasm-data/test-main.js &&
129-
find $(librariesDownloadDir)/bin/wasm -type d &&
130-
find $(librariesDownloadDir)/bin/wasm -type f -exec chmod 664 {} \;
131-
displayName: "Create wasm directory (Linux)"
132107
- ${{ elseif and(eq(parameters.codeGenType, 'AOT'), not(eq(parameters.runtimeType, 'AndroidMono'))) }}:
133-
# Download mono AOT
134-
- template: /eng/pipelines/templates/download-artifact-step.yml
135-
parameters:
136-
unpackFolder: $(librariesDownloadDir)/bin
137-
artifactFileName: 'BuildArtifacts_${{ parameters.osGroup }}${{ parameters.osSubgroup }}_${{ parameters.archType }}_$(buildConfigUpper)_coreclr$(archiveExtension)'
138-
artifactName: 'BuildArtifacts_${{ parameters.osGroup }}${{ parameters.osSubgroup }}_${{ parameters.archType }}_$(buildConfigUpper)_coreclr'
139-
displayName: 'Runtime artifacts'
140-
141108
- template: /eng/pipelines/templates/download-artifact-step.yml
142109
parameters:
143110
unpackFolder: $(librariesDownloadDir)/LinuxMonoAOT
144111
artifactFileName: LinuxMonoAOT${{ parameters.archType }}.tar.gz
145112
artifactName: LinuxMonoAOT${{ parameters.archType }}
146113
displayName: AOT Mono Artifacts
147-
148-
- script: "mkdir -p $(librariesDownloadDir)/bin/aot;mkdir -p $(librariesDownloadDir)/bin/aot/pack;cp -r $(librariesDownloadDir)/LinuxMonoAOT/artifacts/bin/mono/linux.${{ parameters.archType }}.Release/cross/linux-${{ parameters.archType }}/* $(librariesDownloadDir)/bin/aot;cp -r $(librariesDownloadDir)/LinuxMonoAOT/artifacts/bin/microsoft.netcore.app.runtime.linux-${{ parameters.archType }}/Release/* $(librariesDownloadDir)/bin/aot/pack"
149-
displayName: "Create aot directory (Linux)"
150114
- ${{ elseif in(parameters.runtimeType, 'coreclr', 'mono') }}:
151115
- template: /eng/pipelines/templates/download-artifact-step.yml
152116
parameters:
@@ -276,32 +240,4 @@ jobs:
276240
artifactName: 'iOSNativeAOTArm64NoStripSymbolsBuildLog'
277241
${{ if and(eq(parameters.runtimeType, 'iOSNativeAOT'), eq(parameters.iOSStripSymbols, 'True')) }}:
278242
artifactName: 'iOSNativeAOTArm64StripSymbolsBuildLog'
279-
checkDownloadedFiles: true
280-
281-
- ${{ if notIn(parameters.runtimeType, 'wasm', 'AndroidMono', 'AndroidCoreCLR', 'iOSMono', 'iOSNativeAOT') }}:
282-
- ${{ if ne(parameters.runtimeFlavor, 'Mono') }}:
283-
# Create Core_Root
284-
- script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) ${{ parameters.buildConfig }} ${{ parameters.archType }} generatelayoutonly $(librariesOverrideArg) $(_crossBuildPropertyArg)
285-
displayName: Create Core_Root
286-
- ${{ elseif ne(parameters.osGroup, 'windows') }}:
287-
- task: CopyFiles@2
288-
displayName: Create .dotnet-mono folder
289-
inputs:
290-
SourceFolder: $(librariesDownloadDir)/bin/testhost/${{ parameters.framework }}-${{ parameters.osGroup }}-$(buildConfigUpper)-${{ parameters.archType }}
291-
TargetFolder: $(Build.SourcesDirectory)/.dotnet-mono
292-
- task: CopyFiles@2
293-
displayName: Copy corerun to .dotnet-mono
294-
inputs:
295-
SourceFolder: $(librariesDownloadDir)/bin/coreclr/${{ parameters.osGroup }}.${{ parameters.archType }}.$(buildConfigUpper)
296-
Contents: 'corerun*'
297-
TargetFolder: $(Build.SourcesDirectory)/.dotnet-mono/shared/Microsoft.NETCore.App/$(productVersion)
298-
299-
- ${{ if and(eq(parameters.isScenario, true), eq(parameters.runtimeType, 'wasm')) }}:
300-
- script: >-
301-
mkdir -p $(librariesDownloadDir)/bin/wasm/data &&
302-
cp -r $(librariesDownloadDir)/BrowserWasm/staging/dotnet-latest $(librariesDownloadDir)/bin/wasm &&
303-
cp -r $(librariesDownloadDir)/BrowserWasm/staging/built-nugets $(librariesDownloadDir)/bin/wasm &&
304-
cp src/mono/browser/test-main.js $(librariesDownloadDir)/bin/wasm/data/test-main.js &&
305-
find $(librariesDownloadDir)/bin/wasm -type f -exec chmod 664 {} \;
306-
displayName: "Create wasm directory (Linux)"
307-
condition: succeeded()
243+
checkDownloadedFiles: true

requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ azure.identity==1.16.1
44
dataclasses==0.8
55
gitpython<=3.1.41
66
urllib3==1.26.19
7+
opentelemetry-api==1.23.0
8+
opentelemetry-sdk==1.23.0

scripts/benchmarks_ci.py

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -87,42 +87,6 @@ def add_arguments(parser: ArgumentParser) -> ArgumentParser:
8787
# Restore/Build/Run functionality for MicroBenchmarks.csproj
8888
micro_benchmarks.add_arguments(parser)
8989

90-
PRODUCT_INFO = [
91-
'init-tools', # Default
92-
'repo',
93-
'cli',
94-
'args',
95-
]
96-
parser.add_argument(
97-
'--cli-source-info',
98-
dest='cli_source_info',
99-
required=False,
100-
default=PRODUCT_INFO[0],
101-
choices=PRODUCT_INFO,
102-
help='Specifies where the product information comes from.',
103-
)
104-
parser.add_argument(
105-
'--cli-branch',
106-
dest='cli_branch',
107-
required=False,
108-
type=str,
109-
help='Product branch.'
110-
)
111-
parser.add_argument(
112-
'--cli-commit-sha',
113-
dest='cli_commit_sha',
114-
required=False,
115-
type=str,
116-
help='Product commit sha.'
117-
)
118-
parser.add_argument(
119-
'--cli-repository',
120-
dest='cli_repository',
121-
required=False,
122-
type=str,
123-
help='Product repository.'
124-
)
125-
12690
def __is_valid_dotnet_path(dp: str) -> str:
12791
if not os.path.isdir(dp):
12892
raise ArgumentTypeError('Path {} does not exist'.format(dp))
@@ -142,24 +106,6 @@ def __is_valid_dotnet_path(dp: str) -> str:
142106
help='Path to a custom dotnet'
143107
)
144108

145-
def __is_valid_datetime(dt: str) -> str:
146-
try:
147-
datetime.strptime(dt, '%Y-%m-%dT%H:%M:%SZ')
148-
return dt
149-
except ValueError:
150-
raise ArgumentTypeError(
151-
'Datetime "{}" is in the wrong format.'.format(dt))
152-
153-
parser.add_argument(
154-
'--cli-source-timestamp',
155-
dest='cli_source_timestamp',
156-
required=False,
157-
type=__is_valid_datetime,
158-
help='''Product timestamp of the soruces used to generate this build
159-
(date-time from RFC 3339, Section 5.6.
160-
"%%Y-%%m-%%dT%%H:%%M:%%SZ").'''
161-
)
162-
163109
parser.add_argument('--upload-to-perflab-container',
164110
dest="upload_to_perflab_container",
165111
required=False,

0 commit comments

Comments
 (0)