onnxruntime/tools/ci_build/github/azure-pipelines/templates/py-packaging-linux-test-cpu.yml
Changming Sun 5f6a3158f8
Enable VCPKG in CI build (#23426)
### Description
1. Enable VCPKG flag in Windows CPU CI build pipelines. 
2. Increased the min supported cmake version from 3.26 to 3.28. Because
of it, drop the support for the old way of finding python by
"find_package(PythonLibs)". Therefore, in build.py we no longer set
"PYTHON_EXECUTABLE" cmake var when doing cmake configure.
3. Added "xnnpack-ep" as a feature for ORT's vcpkg config.
4. Added asset cache support for ORT's vcpkg build
5. Added VCPKG triplet files for Android build.
6. Set VCPKG triplet to "universal2-osx" if CMAKE_OSX_ARCHITECTURES was
found in cmake extra defines.
7. Removed a small piece of code in build.py, which was for support CUDA
version < 11.8.
8. Fixed an issue that CMAKE_OSX_ARCHITECTURES sometimes got specified
twice when build.py invoked cmake.
9. Added more model tests to Android build. After this change, we will
test all ONNX versions instead of just the latest one.
10. Fixed issues that are related to build.py's "--build_nuget"
parameter. Also, enable the flag in most Windows CPU CI build jobs.
11. Removed a restriction in build.py that disallowed cross-compiling
Windows ARM64 nuget package on Windows x86.
 
### Motivation and Context
Adopt vcpkg.
2025-02-05 10:58:53 -08:00

104 lines
3.7 KiB
YAML

parameters:
- name: arch
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
- name: ep
type: string
default: 'cpu'
jobs:
- job: Linux_Test_CPU${{ parameters.extra_job_id }}_${{ parameters.arch }}
timeoutInMinutes: ${{ parameters.timeout }}
variables:
skipComponentGovernanceDetection: true
workspace:
clean: all
pool: ${{ parameters.machine_pool }}
steps:
- checkout: self
clean: true
submodules: none
# The public ADO project
- ${{ if eq(variables['System.CollectionId'], 'f3ad12f2-e480-4533-baf2-635c95467d29') }}:
- download: current # pipeline resource identifier.
artifact: 'drop-linux-cpu-${{ parameters.arch }}-${{parameters.ep}}'
- download: current # pipeline resource identifier.
artifact: 'onnxruntime${{ parameters.python_wheel_suffix }}-${{ parameters.ep }}'
- bash: |
set -e -x
mv "$(Pipeline.Workspace)/drop-linux-cpu-${{ parameters.arch }}-${{parameters.ep}}" $(Build.BinariesDirectory)/${{parameters.cmake_build_type}}
mv "$(Pipeline.Workspace)/onnxruntime${{ parameters.python_wheel_suffix }}-${{parameters.ep}}" "$(Build.BinariesDirectory)/whl"
cp -r "$(Build.BinariesDirectory)/whl" $(Build.BinariesDirectory)/tmp
find "$(Build.BinariesDirectory)/tmp" -name '*.whl' -exec bash -c 'unzip -d "${1%.*}" "$1"' _ {} \;
# The private ADO project
- ${{ if eq(variables['System.CollectionId'], 'bc038106-a83b-4dab-9dd3-5a41bc58f34c') }}:
- download: build # pipeline resource identifier.
artifact: 'drop-linux-cpu-${{ parameters.arch }}-${{parameters.ep}}'
- download: build # pipeline resource identifier.
artifact: 'onnxruntime${{ parameters.python_wheel_suffix }}-${{ parameters.ep }}'
- bash: |
set -e -x
ls $(Pipeline.Workspace)/build
mv "$(Pipeline.Workspace)/build/drop-linux-cpu-${{ parameters.arch }}-${{parameters.ep}}" $(Build.BinariesDirectory)/${{parameters.cmake_build_type}}
mv "$(Pipeline.Workspace)/build/onnxruntime${{ parameters.python_wheel_suffix }}-${{parameters.ep}}" "$(Build.BinariesDirectory)/whl"
cp -r "$(Build.BinariesDirectory)/whl" $(Build.BinariesDirectory)/tmp
find "$(Build.BinariesDirectory)/tmp" -name '*.whl' -exec bash -c 'unzip -d "${1%.*}" "$1"' _ {} \;
# The BinSkim task uses a dotnet program which doesn't support ARM CPUs yet
- ${{ if eq(parameters.arch, 'x86_64') }}:
- task: BinSkim@4
displayName: 'Run BinSkim'
inputs:
AnalyzeTargetGlob: '$(Build.BinariesDirectory)/tmp/**/*.so'
continueOnError: true
#- task: PostAnalysis@2
# inputs:
# GdnBreakAllTools: true
# GdnBreakPolicy: M365
# GdnBreakPolicyMinSev: Error
- template: get-docker-image-steps.yml
parameters:
Dockerfile: tools/ci_build/github/linux/docker/inference/${{ parameters.arch }}/python/cpu/Dockerfile
Context: tools/ci_build/github/linux/docker/inference/${{ parameters.arch }}/python/cpu
DockerBuildArgs: "--build-arg BUILD_UID=$( id -u )"
Repository: onnxruntimecpubuildpython${{ parameters.arch }}
- task: Bash@3
displayName: 'Bash Script'
inputs:
targetType: filePath
filePath: tools/ci_build/github/linux/run_python_dockertest.sh
arguments: -d CPU -c ${{parameters.cmake_build_type}} -i onnxruntimecpubuildpython${{ parameters.arch }}