Skip to content

Commit 93e3d61

Browse files
centralise feed authentication for ADO pipelines (#27997)
### Description Centralise feed authentication & setup for build systems on ADO build pipelines. ### Motivation and Context SDL requires official build pipelines use a single controlled feed for external resources. --------- Co-authored-by: Sanaa Hamel <sanaahamel@microsoft.com>
1 parent a670da2 commit 93e3d61

24 files changed

Lines changed: 212 additions & 153 deletions

tools/ci_build/github/azure-pipelines/linux-gpu-tensorrt-cuda-minimal-ci-pipeline.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,9 @@ jobs:
6767
clean: true
6868
submodules: none
6969

70-
- task: UsePythonVersion@0
71-
inputs:
70+
- template: templates/setup-feeds-and-python-steps.yml
71+
parameters:
7272
versionSpec: '3.12'
73-
addToPath: true
7473
architecture: 'x64'
7574

7675
- template: templates/get-docker-image-steps.yml

tools/ci_build/github/azure-pipelines/nuget/templates/test_win.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,9 @@ stages:
3737
value: '-Dorg.gradle.daemon=false'
3838

3939
steps:
40-
- task: UsePythonVersion@0
41-
inputs:
42-
versionSpec: '3.12'
43-
addToPath: true
44-
architecture: x64
45-
- task: PipAuthenticate@1
46-
displayName: 'Pip Authenticate'
47-
inputs:
48-
artifactFeeds: 'Lotus'
40+
- template: ../../templates/setup-feeds-and-python-steps.yml
41+
parameters:
42+
architecture: 'x64'
4943

5044
- task: NuGetToolInstaller@0
5145
displayName: Use Nuget 6.10.x
@@ -69,7 +63,7 @@ stages:
6963
- download: build
7064
displayName: 'Download Nuget'
7165
artifact: 'drop-signed-nuget-${{ parameters.ArtifactSuffix }}'
72-
66+
7367

7468
- template: get-nuget-package-version-as-variable.yml
7569
parameters:

tools/ci_build/github/azure-pipelines/post-merge-jobs.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -398,11 +398,9 @@ stages:
398398
- checkout: self
399399
submodules: false
400400

401-
- task: UsePythonVersion@0
402-
inputs:
403-
versionSpec: '3.12'
404-
addToPath: true
405-
architecture: x64
401+
- template: templates/setup-feeds-and-python-steps.yml
402+
parameters:
403+
architecture: 'x64'
406404

407405
- task: CmdLine@2
408406
displayName: 'Run build_custom_android_package.py'
@@ -432,11 +430,10 @@ stages:
432430
vmImage: "macOS-14"
433431

434432
steps:
435-
- task: UsePythonVersion@0
436-
inputs:
433+
- template: templates/setup-feeds-and-python-steps.yml
434+
parameters:
437435
versionSpec: "3.12"
438-
addToPath: true
439-
architecture: "x64"
436+
architecture: 'x64'
440437

441438
- template: templates/use-xcode-version.yml
442439

tools/ci_build/github/azure-pipelines/stages/jobs/react-natvie-andriod-e2e-test-job.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,9 @@ jobs:
2323
ANDROID_AVD_HOME: $(Agent.TempDirectory)
2424
timeoutInMinutes: 90
2525
steps:
26-
- task: UsePythonVersion@0
27-
displayName: Use python 3.12
28-
inputs:
29-
versionSpec: "3.12"
30-
addToPath: true
31-
architecture: "x64"
26+
- template: ../../templates/setup-feeds-and-python-steps.yml
27+
parameters:
28+
architecture: 'x64'
3229

3330
- task: JavaToolInstaller@0
3431
displayName: Use jdk 17

tools/ci_build/github/azure-pipelines/stages/nuget-cuda-packaging-stage.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ stages:
4040
steps:
4141
- checkout: self
4242
submodules: true
43+
44+
- template: ../templates/setup-feeds-and-python-steps.yml
45+
4346
- template: ../templates/flex-downloadPipelineArtifact.yml
4447
parameters:
4548
StepName: 'Download Pipeline Artifact - NuGet'
@@ -72,16 +75,6 @@ stages:
7275
SpecificArtifact: ${{ parameters.SpecificArtifact }}
7376
BuildId: ${{ parameters.BuildId }}
7477

75-
- task: UsePythonVersion@0
76-
displayName: 'Use Python'
77-
inputs:
78-
versionSpec: 3.12
79-
80-
- task: PipAuthenticate@1
81-
displayName: 'Pip Authenticate'
82-
inputs:
83-
artifactFeeds: 'Lotus'
84-
8578
- template: ../templates/set-version-number-variables-step.yml
8679

8780
# Reconstruct the build dir

tools/ci_build/github/azure-pipelines/stages/nuget-linux-cuda-packaging-stage.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,8 @@ stages:
3030
- name: CUDA_VERSION
3131
value: ${{ parameters.CudaVersion }}
3232
steps:
33+
- template: ../templates/setup-feeds-and-python-steps.yml
3334
- template: ../templates/set-version-number-variables-step.yml
34-
- task: UsePythonVersion@0
35-
displayName: Use Python 3.12
36-
inputs:
37-
versionSpec: 3.12
3835
- template: ../templates/get-docker-image-steps.yml
3936
parameters:
4037
Dockerfile: tools/ci_build/github/linux/docker/inference/x86_64/default/cuda${{ variables.CUDA_VERSION_MAJOR }}/Dockerfile
@@ -90,10 +87,7 @@ stages:
9087
- checkout: self
9188
clean: true
9289
submodules: recursive
93-
- task: UsePythonVersion@0
94-
displayName: Use Python 3.12
95-
inputs:
96-
versionSpec: 3.12
90+
- template: ../templates/setup-feeds-and-python-steps.yml
9791
- template: ../templates/get-docker-image-steps.yml
9892
parameters:
9993
Dockerfile: tools/ci_build/github/linux/docker/inference/x86_64/default/cuda${{ variables.CUDA_VERSION_MAJOR }}/Dockerfile

tools/ci_build/github/azure-pipelines/stages/nuget-win-cuda-packaging-stage.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ stages:
127127
- checkout: onnxruntime-inference-examples # due to checkout multiple repos, the root directory is $(Build.SourcesDirectory)/onnxruntime-inference-examples
128128
submodules: false
129129

130+
- template: ../templates/setup-feeds-and-python-steps.yml
131+
130132
- script: dir $(Build.SourcesDirectory)
131133
- template: ../templates/jobs/download_win_gpu_library.yml
132134
parameters:

tools/ci_build/github/azure-pipelines/stages/py-win-gpu-stage.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -201,17 +201,11 @@ stages:
201201
clean: true
202202
submodules: none
203203

204-
- task: UsePythonVersion@0
205-
inputs:
204+
- template: ../templates/setup-feeds-and-python-steps.yml
205+
parameters:
206206
versionSpec: ${{ parameters.PYTHON_VERSION }}
207-
addToPath: true
208207
architecture: 'x64'
209208

210-
- task: PipAuthenticate@1
211-
displayName: 'Pip Authenticate'
212-
inputs:
213-
artifactFeeds: 'Lotus'
214-
215209
- template: ../templates/jobs/download_win_gpu_library.yml
216210
parameters:
217211
CudaVersion: ${{ parameters.CudaVersion }}

tools/ci_build/github/azure-pipelines/stages/py-win-webgpu-stage.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -155,17 +155,11 @@ stages:
155155
clean: true
156156
submodules: none
157157

158-
- task: UsePythonVersion@0
159-
inputs:
158+
- template: ../templates/setup-feeds-and-python-steps.yml
159+
parameters:
160160
versionSpec: ${{ parameters.PYTHON_VERSION }}
161-
addToPath: true
162161
architecture: 'x64'
163162

164-
- task: PipAuthenticate@1
165-
displayName: 'Pip Authenticate'
166-
inputs:
167-
artifactFeeds: 'Lotus'
168-
169163
- script: python -m pip install -r $(Build.SourcesDirectory)\tools\ci_build\github\windows\python\requirements.txt
170164
env:
171165
TMPDIR: "$(Agent.TempDirectory)"

tools/ci_build/github/azure-pipelines/templates/c-api-cpu.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -348,16 +348,7 @@ stages:
348348
DisplayName: 'ESRP - Sign C# dlls'
349349
DoEsrp: true
350350

351-
- task: UsePythonVersion@0
352-
displayName: 'Use Python'
353-
inputs:
354-
versionSpec: 3.12
355-
356-
- task: PipAuthenticate@1
357-
displayName: 'Pip Authenticate'
358-
inputs:
359-
artifactFeeds: 'Lotus'
360-
351+
- template: setup-feeds-and-python-steps.yml
361352

362353
- task: MSBuild@1
363354
displayName: 'Build Nuget Packages'

0 commit comments

Comments
 (0)