onnxruntime/tools/ci_build/github/azure-pipelines/py-package-test-pipeline.yml
Yi Zhang 68209307da
Replace all Azure-Pipelines-EO-Windows2022-aiinfrat to Onnxruntime-Win-CPU-2022 (#18614)
### Description
Replace all Azure-Pipelines-EO-Windows2022-aiinfrat to
Onnxruntime-Win-CPU-2022


### Motivation and Context
Reduce the maintenance cost
2023-11-29 10:32:42 -08:00

100 lines
3.8 KiB
YAML

resources:
pipelines:
- pipeline: build
source: 'Python packaging pipeline'
trigger: true
branch: main # branch to pick the artifact, Used only for manual triggered pipeline runs for testing the pipeline itself
#TODO: Remove the following dependency. Running python tests should not need to use manylinux.
repositories:
- repository: manylinux # The name used to reference this repository in the checkout step
type: Github
endpoint: Microsoft
name: pypa/manylinux
ref: 5eda9aded5462201e6310105728d33016e637ea7
stages:
- stage: Linux_Test_CPU_x86_64_stage
jobs:
- template: templates/py-packaging-linux-test-cpu.yml
parameters:
arch: 'x86_64'
machine_pool: 'onnxruntime-Ubuntu2004-AMD-CPU'
base_image: 'registry.access.redhat.com/ubi8/ubi'
devtoolset_rootpath: /opt/rh/gcc-toolset-12/root
ld_library_path_arg: /opt/rh/gcc-toolset-12/root/usr/lib64:/opt/rh/gcc-toolset-12/root/usr/lib:/opt/rh/gcc-toolset-12/root/usr/lib64/dyninst:/opt/rh/gcc-toolset-12/root/usr/lib/dyninst:/usr/local/lib64
prepend_path: '/opt/rh/gcc-toolset-12/root/usr/bin:'
- stage: Linux_Test_CPU_aarch64_stage
dependsOn: []
jobs:
- template: templates/py-packaging-linux-test-cpu.yml
parameters:
arch: 'aarch64'
machine_pool: 'onnxruntime-linux-ARM64-CPU-2019'
base_image: 'arm64v8/almalinux:8'
devtoolset_rootpath: /opt/rh/gcc-toolset-12/root
ld_library_path_arg: /opt/rh/gcc-toolset-12/root/usr/lib64:/opt/rh/gcc-toolset-12/root/usr/lib:/opt/rh/gcc-toolset-12/root/usr/lib64/dyninst:/opt/rh/gcc-toolset-12/root/usr/lib/dyninst:/usr/local/lib64
prepend_path: '/opt/rh/gcc-toolset-12/root/usr/bin:'
- stage: Packages_Somking_Test
dependsOn: []
jobs:
- template: templates/py-package-smoking-test.yml
parameters:
job_name: Test_MAC_Wheels
machine_pool:
vmImage: 'macOS-13'
itemPattern: '*/*mac*x86_64.whl'
- template: templates/py-package-smoking-test.yml
parameters:
job_name: Test_LINUX_x86_64_Wheels
itemPattern: '*/*manylinux*x86_64.whl'
machine_pool:
vmImage: 'ubuntu-22.04'
# ****The following Stage depend on all previous tags. ***
# GPU resources are very limited,
# To utilize gpu resource more efficiently, run GPU job only after all cpus jobs succeed
- stage: Linux_Test_GPU_x86_64_stage
dependsOn:
- Linux_Test_CPU_x86_64_stage
- Linux_Test_CPU_aarch64_stage
- Packages_Somking_Test
jobs:
- template: templates/py-packaging-linux-test-cuda.yml
parameters:
arch: 'x86_64'
machine_pool: 'Onnxruntime-Linux-GPU'
device: 'GPU'
python_wheel_suffix: '_gpu'
timeout: 480
# if final job not extecuted, it will not run nightlly build
- stage: Final
dependsOn:
- Linux_Test_GPU_x86_64_stage
jobs:
- job: Final
# Run this step only if all previous steps are succeeded and (this build was triggered by a resource trigger or it was triggered by another build).
condition: and(succeeded(), eq(variables['Build.Reason'], 'ResourceTrigger'))
timeoutInMinutes: 60
variables:
skipComponentGovernanceDetection: true
workspace:
clean: all
pool: Onnxruntime-Win-CPU-2022
steps:
- task: PowerShell@2
displayName: 'Add Build Tag'
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
inputs:
targetType: inline
script: |
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Authorization", "Bearer $env:SYSTEM_ACCESSTOKEN")
$headers.Add("Content-Type", "application/json")
$uri = "https://dev.azure.com/aiinfra/Lotus/_apis/build/builds/$(resources.pipeline.build.runID)/tags/test%20pass?api-version=6.0"
Invoke-RestMethod -Uri $uri -Headers $headers -Method PUT