onnxruntime/tools/ci_build/github/azure-pipelines/templates/py-packaging-linux-test.yml
Changming Sun 6db72165eb
Fix python packaging test pipeline (#17204)
### Description
1. Fix python packaging test pipeline. There was an error in
tools/ci_build/github/linux/run_python_tests.sh that it installed a
released version of onnxruntime python package from pypi.org to run the
test. Supposedly it should pick one from the current build.
2. Refactor the pipeline to allow choosing cmake build type from the web
UI when manually trigger a build. Now this feature is for Linux only.
Because I don't want to change too much when we are about to cut a
release branch. After that I will expand it to all platforms. This
feature is useful for debugging pipeline issues, also, we may consider
having a nightly pipeline to run all tests in Debug mode which may catch
extra bugs because in debug mode we can enforce range check.

Test run:
https://aiinfra.visualstudio.com/Lotus/_build/results?buildId=342674&view=results

### Motivation and Context
Currently the pipeline has a crash error. 

AB#18580
2023-08-18 14:51:26 -07:00

85 lines
2.5 KiB
YAML

parameters:
- name: arch
type: string
- name: device
type: string
- name: machine_pool
type: string
- name: extra_job_id
type: string
default: ''
- name: python_wheel_suffix
type: string
default: ''
# TODO: Ideally it should fetch information from the build that triggers it
- name: cmake_build_type
type: string
default: 'Release'
values:
- Debug
- Release
- RelWithDebInfo
- MinSizeRel
- name: timeout
type: number
default: 120
jobs:
- job: Linux_Test_${{ parameters.device }}${{ parameters.extra_job_id }}_${{ parameters.arch }}
timeoutInMinutes: ${{ parameters.timeout }}
variables:
skipComponentGovernanceDetection: true
workspace:
clean: all
pool: ${{ parameters.machine_pool }}
steps:
- task: DownloadPipelineArtifact@2
displayName: 'Download Pipeline Artifact'
inputs:
artifactName: 'drop-linux-${{ lower(parameters.device) }}-${{ parameters.arch }}'
targetPath: '$(Build.BinariesDirectory)/${{parameters.cmake_build_type}}'
# The public ADO project
${{ if eq(variables['System.CollectionId'], 'f3ad12f2-e480-4533-baf2-635c95467d29') }}:
buildType: current
# The private ADO project
${{ if eq(variables['System.CollectionId'], 'bc038106-a83b-4dab-9dd3-5a41bc58f34c') }}:
project: '530acbc4-21bc-487d-8cd8-348ff451d2ff'
definition: 841
preferTriggeringPipeline: true
runVersion: 'latest'
buildType: specific
- task: DownloadPipelineArtifact@2
displayName: 'Download Pipeline Artifact'
inputs:
artifactName: 'onnxruntime${{ parameters.python_wheel_suffix }}'
targetPath: '$(Build.BinariesDirectory)/whl'
# The public ADO project
${{ if eq(variables['System.CollectionId'], 'f3ad12f2-e480-4533-baf2-635c95467d29') }}:
buildType: current
# The private ADO project
${{ if eq(variables['System.CollectionId'], 'bc038106-a83b-4dab-9dd3-5a41bc58f34c') }}:
project: '530acbc4-21bc-487d-8cd8-348ff451d2ff'
definition: 841
preferTriggeringPipeline: true
runVersion: 'latest'
buildType: specific
- task: Bash@3
displayName: 'Bash Script'
inputs:
targetType: filePath
filePath: tools/ci_build/github/linux/run_python_tests.sh
arguments: -d ${{ parameters.device }} -c ${{parameters.cmake_build_type}}
- task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3
displayName: 'Clean Agent Directories'
condition: always()