make nuget workflow easy to debug. (#15693)

### Description
Add parameters to make some stages could use other run's intermediate
output.

### Motivation and Context
nuget workflow has 38 stages of 4 layers.
We had to run the whole workflow from begining to test one stage.
It could make life easier to run only one stage for testing.
like

![image](https://user-images.githubusercontent.com/16190118/234453721-e6e9a4bd-5e0b-4101-a18e-d5cf60615c9f.png)

### N.B.
In this PR, Nuget_Test_Linux_CPU, Nuget_Test_LinuxGPU and
Jar_Packaging_GPU are enabled as the first step.
So I can start to move tests from Linux host to container
This commit is contained in:
Yi Zhang 2023-04-27 14:54:14 +08:00 committed by GitHub
parent 926ae7d786
commit 53ff50d19a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 64 additions and 28 deletions

View file

@ -24,6 +24,17 @@ parameters:
type: boolean
default: false
# these 2 parameters are used for debugging.
- name: SpecificArtifact
displayName: Use Specific Artifact (Debugging only)
type: boolean
default: false
- name: BuildId
displayName: Pipeline BuildId, you could find it in the URL
type: string
default: '0'
resources:
repositories:
- repository: onnxruntime-inference-examples # The name used to reference this repository in the checkout step
@ -36,6 +47,12 @@ resources:
name: pypa/manylinux
ref: aead4d751c2101e23336aa73f2380df83e7a13f3
variables:
- name: specificArtifact
value: ${{ parameters.SpecificArtifact }}
- name: otherRunId
value: ${{ parameters.BuildId }}
stages:
- template: templates/c-api-cpu.yml
parameters:
@ -151,24 +168,21 @@ stages:
submodules: false
- template: templates/set-version-number-variables-step.yml
- task: DownloadPipelineArtifact@2
displayName: 'Download Pipeline Artifact - Win x64'
inputs:
buildType: 'current'
- template: templates/flex-downloadPipelineArtifact.yml
parameters:
stepName: 'Download Pipeline Artifact - Win x64'
artifactName: 'drop-onnxruntime-java-win-x64-tensorrt'
targetPath: '$(Build.BinariesDirectory)\java-artifact\onnxruntime-java-win-x64'
- task: DownloadPipelineArtifact@2
displayName: 'Download Pipeline Artifact - Linux x64'
inputs:
buildType: 'current'
- template: templates/flex-downloadPipelineArtifact.yml
parameters:
stepName: 'Download Pipeline Artifact - Linux x64'
artifactName: 'drop-onnxruntime-java-linux-x64-cuda'
targetPath: '$(Build.BinariesDirectory)\java-artifact\onnxruntime-java-linux-x64'
- task: DownloadPipelineArtifact@2
displayName: 'Download Pipeline Artifact - Linux x64'
inputs:
buildType: 'current'
- template: templates/flex-downloadPipelineArtifact.yml
parameters:
stepName: 'Download Pipeline Artifact - Linux x64'
artifactName: 'drop-onnxruntime-java-linux-x64-tensorrt'
targetPath: '$(Build.BinariesDirectory)\java-artifact\onnxruntime-java-linux-x64-tensorrt'
@ -839,31 +853,31 @@ stages:
rename %%~ni.nupkg %%~ni.zip
unzip %%~ni.zip -d %%~ni
del /Q %%~ni.zip
unzip win-dml-x86.zip -d win-x86
mkdir %%~ni\runtimes\win-x86
mkdir %%~ni\runtimes\win-x86\native
move win-x86\runtimes\win-x86\native\onnxruntime.dll %%~ni\runtimes\win-x86\native\onnxruntime.dll
move win-x86\runtimes\win-x86\native\onnxruntime.lib %%~ni\runtimes\win-x86\native\onnxruntime.lib
move win-x86\runtimes\win-x86\native\onnxruntime.pdb %%~ni\runtimes\win-x86\native\onnxruntime.pdb
unzip win-dml-arm64.zip -d win-arm64
mkdir %%~ni\runtimes\win-arm64
mkdir %%~ni\runtimes\win-arm64\native
move win-arm64\runtimes\win-arm64\native\onnxruntime.dll %%~ni\runtimes\win-arm64\native\onnxruntime.dll
move win-arm64\runtimes\win-arm64\native\onnxruntime.lib %%~ni\runtimes\win-arm64\native\onnxruntime.lib
move win-arm64\runtimes\win-arm64\native\onnxruntime.pdb %%~ni\runtimes\win-arm64\native\onnxruntime.pdb
unzip win-dml-arm.zip -d win-arm
mkdir %%~ni\runtimes\win-arm
mkdir %%~ni\runtimes\win-arm\native
move win-arm\runtimes\win-arm\native\onnxruntime.dll %%~ni\runtimes\win-arm\native\onnxruntime.dll
move win-arm\runtimes\win-arm\native\onnxruntime.lib %%~ni\runtimes\win-arm\native\onnxruntime.lib
move win-arm\runtimes\win-arm\native\onnxruntime.pdb %%~ni\runtimes\win-arm\native\onnxruntime.pdb
pushd %%~ni
zip -r ..\%%~ni.zip .
popd

View file

@ -20,17 +20,17 @@ stages:
variables:
- name: OnnxRuntimeBuildDirectory
value: '$(Build.BinariesDirectory)'
steps:
- task: DownloadPipelineArtifact@0
displayName: 'Download Signed NuGet'
inputs:
steps:
- template: ../../templates/flex-downloadPipelineArtifact.yml
parameters:
stepName: 'Download Signed NuGet'
artifactName: drop-signed-nuget-${{ parameters.ArtifactSuffix }}
targetPath: '$(Build.BinariesDirectory)/nuget-artifact'
- task: DownloadPipelineArtifact@0
displayName: 'Download Linux CustomOp TestData'
inputs:
- template: ../../templates/flex-downloadPipelineArtifact.yml
parameters:
stepName: 'Download Linux CustomOp TestData'
artifactName: 'onnxruntime-linux-x64'
targetPath: '$(Build.BinariesDirectory)/testdata'

View file

@ -918,5 +918,3 @@ stages:
- task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3
displayName: 'Clean Agent Directories'
condition: always()

View file

@ -0,0 +1,24 @@
parameters:
- name: stepName
type: string
- name: artifactName
type: string
- name: targetPath
type: string
steps:
- task: DownloadPipelineArtifact@2
displayName: ${{ parameters.stepName }}}
inputs:
artifactName: ${{ parameters.artifactName}}
targetPath: '${{ parameters.targetPath }}'
${{ if eq(variables.specificArtifact, false)}}:
buildType: 'current'
${{ else }}:
source: 'specific'
project: $(System.TeamProject)
pipeline: $(Build.DefinitionName)
runVersion: 'specific'
runId: $(otherRunId)