Skip to content

Commit c9998da

Browse files
authored
Use python venv for SPMI collection / jit rolling build (#95714)
Use python venv for SPMI collection and jit rolling build Since it needs to install packages.
1 parent f5d5347 commit c9998da

File tree

2 files changed

+24
-10
lines changed

2 files changed

+24
-10
lines changed

eng/pipelines/coreclr/templates/build-jit-job.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,19 @@ jobs:
5757
value: ''
5858

5959
- ${{ if eq(parameters.osGroup, 'windows') }}:
60+
- name: PythonSetupScript
61+
value: 'py -3 -m venv $(Build.SourcesDirectory)\venv'
6062
- name: PythonScript
61-
value: 'py -3'
63+
value: '$(Build.SourcesDirectory)\venv\Scripts\python.exe'
6264
- name: PipScript
63-
value: 'py -3 -m pip'
65+
value: '$(Build.SourcesDirectory)\venv\Scripts\python.exe -m pip'
6466
- ${{ if ne(parameters.osGroup, 'windows') }}:
67+
- name: PythonSetupScript
68+
value: 'python3 -m venv $(Build.SourcesDirectory)/venv'
6569
- name: PythonScript
66-
value: 'python3'
70+
value: '$(Build.SourcesDirectory)/venv/bin/python3'
6771
- name: PipScript
68-
value: 'pip3'
72+
value: '$(Build.SourcesDirectory)/venv/bin/pip3'
6973

7074
- ${{ parameters.variables }}
7175

@@ -106,8 +110,11 @@ jobs:
106110
artifactFeeds: public/dotnet-public-pypi
107111
onlyAddExtraIndex: false
108112

113+
- script: $(PythonSetupScript)
114+
displayName: Enable python venv
115+
109116
# Ensure the Python azure-storage-blob package is installed before doing the upload.
110-
- script: $(PipScript) install --user --upgrade pip && $(PipScript) install --user azure.storage.blob==12.5.0 --force-reinstall
117+
- script: $(PipScript) install --upgrade pip && $(PipScript) install azure.storage.blob==12.5.0 --force-reinstall
111118
displayName: Upgrade Pip to latest and install azure-storage-blob Python package
112119

113120
- script: $(PythonScript) $(Build.SourcesDirectory)/src/coreclr/scripts/jitrollingbuild.py upload -build_type $(buildConfig) -arch $(archType) -host_os $(osGroup) -git_hash $(Build.SourceVersion) --use_latest_jit_change

eng/pipelines/coreclr/templates/run-superpmi-collect-job.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,12 @@ jobs:
5555
- CollectionName: ${{ parameters.collectionName }}
5656

5757
- ${{ if eq(parameters.osGroup, 'windows') }}:
58+
- name: PythonSetupScript
59+
value: 'py -3 -m venv $(Build.SourcesDirectory)\venv'
5860
- name: PythonScript
59-
value: 'py -3'
61+
value: '$(Build.SourcesDirectory)\venv\Scripts\python.exe'
6062
- name: PipScript
61-
value: 'py -3 -m pip'
63+
value: '$(Build.SourcesDirectory)\venv\Scripts\python.exe -m pip'
6264
- name: Core_Root_Dir
6365
value: '$(Build.SourcesDirectory)\artifacts\tests\coreclr\${{ parameters.osGroup }}.${{ parameters.archType }}.${{ parameters.buildConfig }}\Tests\Core_Root'
6466
- name: MchFilesLocation
@@ -70,10 +72,12 @@ jobs:
7072
- name: PayloadLocation
7173
value: '$(Build.SourcesDirectory)\payload'
7274
- ${{ if ne(parameters.osGroup, 'windows') }}:
75+
- name: PythonSetupScript
76+
value: 'python3 -m venv $(Build.SourcesDirectory)/venv'
7377
- name: PythonScript
74-
value: 'python3'
78+
value: '$(Build.SourcesDirectory)/venv/bin/python3'
7579
- name: PipScript
76-
value: 'pip3'
80+
value: '$(Build.SourcesDirectory)/venv/bin/pip3'
7781
- name: Core_Root_Dir
7882
value: '$(Build.SourcesDirectory)/artifacts/tests/coreclr/${{ parameters.osGroup }}.${{ parameters.archType }}.$(buildConfigUpper)/Tests/Core_Root'
7983
- name: MchFilesLocation
@@ -112,6 +116,9 @@ jobs:
112116
steps:
113117
- ${{ parameters.steps }}
114118

119+
- script: $(PythonSetupScript)
120+
displayName: Enable python venv
121+
115122
- script: $(PythonScript) $(Build.SourcesDirectory)/src/coreclr/scripts/superpmi_collect_setup.py -payload_directory $(PayloadLocation) -source_directory $(Build.SourcesDirectory) -core_root_directory $(Core_Root_Dir) -arch $(archType) -platform $(osGroup) -mch_file_tag $(MchFileTag) -input_directory $(InputDirectory) -collection_name $(CollectionName) -collection_type $(CollectionType) -max_size 25 # size in MB
116123
displayName: ${{ format('SuperPMI setup ({0})', parameters.osGroup) }}
117124

@@ -173,7 +180,7 @@ jobs:
173180
onlyAddExtraIndex: false
174181

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

179186
- 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)

0 commit comments

Comments
 (0)