-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Expand file tree
/
Copy pathpy-linux.yml
More file actions
131 lines (113 loc) · 3.97 KB
/
py-linux.yml
File metadata and controls
131 lines (113 loc) · 3.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
parameters:
- name: arch
type: string
- name: machine_pool
type: string
- name: cmake_build_type
type: string
default: 'Release'
values:
- Debug
- Release
- RelWithDebInfo
- MinSizeRel
- name: device
type: string
default: 'CPU'
- name: with_cache
type: boolean
default: false
- name: extra_build_arg
type: string
default: ''
- name: ep
type: string
default: 'cpu'
- name: python_exe_path
type: string
default: ''
- name: is1ES
displayName: 'Whether the pipeline is running in 1ES'
type: boolean
default: false
jobs:
- job: Linux_py_Wheels_${{ parameters.arch }}_${{parameters.ep}}
timeoutInMinutes: 240
workspace:
clean: all
pool:
name: ${{ parameters.machine_pool }}
os: 'linux'
${{ if eq(parameters.arch, 'aarch64') }}:
hostArchitecture: Arm64
variables:
# The build machine pool doesn't have dotnet, so it can't run CG.
- name: skipComponentGovernanceDetection
value: true
- name: ORT_CACHE_DIR
value: $(Agent.TempDirectory)/ort_ccache
- name: TODAY
value: $[format('{0:dd}{0:MM}{0:yyyy}', pipeline.startTime)]
- name: extra_build_args
${{ if ne(parameters.extra_build_arg, '') }}:
value: '-x ${{ parameters.extra_build_arg }}'
${{ if eq(parameters.extra_build_arg, '') }}:
value: ''
- name: python_exe_path
${{ if ne(parameters.python_exe_path, '') }}:
value: '-p ${{ parameters.python_exe_path }}'
${{ if eq(parameters.python_exe_path, '') }}:
value: ''
steps:
- checkout: self
clean: true
submodules: none
- template: set-nightly-build-option-variable-step.yml
- 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 }}
- template: linux-build-step-with-cache.yml
parameters:
WithCache: ${{parameters.with_cache}}
Today: $(TODAY)
AdditionalKey: Linux_py_Wheels_${{ parameters.arch }}
CacheDir: $(ORT_CACHE_DIR)
ChangeEveryCommit: true
BuildStep:
- task: Bash@3
displayName: 'Build Python Wheel'
inputs:
targetType: filePath
filePath: tools/ci_build/github/linux/run_python_dockerbuild.sh
arguments: -i onnxruntimecpubuildpython${{ parameters.arch }} -d "${{ parameters.device }}" -c ${{ parameters.cmake_build_type }} $(extra_build_args) $(python_exe_path)
${{ if eq(parameters.with_cache, 'true') }}:
env:
ADDITIONAL_DOCKER_PARAMETER: "--volume $(ORT_CACHE_DIR):/cache -e CCACHE_DIR=/cache -e ORT_BUILD_WITH_CACHE=1"
- ${{ if eq(parameters.is1ES, true) }}:
- task: 1ES.PublishPipelineArtifact@1
displayName: 'Publish Artifact: ONNXRuntime python wheel'
inputs:
targetPath: '$(Build.BinariesDirectory)/dist'
artifactName: onnxruntime-${{ parameters.ep }}-${{ parameters.arch }}
- task: 1ES.PublishPipelineArtifact@1
displayName: 'Publish Test Binaries'
inputs:
artifactName: 'drop-linux-cpu-${{ parameters.arch }}-${{ parameters.ep }}'
targetPath: '$(Build.BinariesDirectory)/${{ parameters.cmake_build_type }}'
- ${{ if eq(parameters.is1ES, false) }}:
- task: PublishPipelineArtifact@1
displayName: 'Publish Artifact: ONNXRuntime python wheel'
inputs:
targetPath: '$(Build.BinariesDirectory)/dist'
artifactName: onnxruntime-${{ parameters.ep }}-${{ parameters.arch }}
- task: PublishPipelineArtifact@1
displayName: 'Publish Test Binaries'
inputs:
artifactName: 'drop-linux-cpu-${{ parameters.arch }}-${{ parameters.ep }}'
targetPath: '$(Build.BinariesDirectory)/${{ parameters.cmake_build_type }}'
- template: component-governance-component-detection-steps.yml
parameters:
condition: 'succeeded'