-
Notifications
You must be signed in to change notification settings - Fork 3k
/
Copy pathc-api-linux-cpu.yml
108 lines (93 loc) · 4.22 KB
/
c-api-linux-cpu.yml
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
# This file contains the ADO job that build libonnxruntime.so on Linux
parameters:
- name: AdditionalBuildFlags
displayName: Additional build flags for build.py
type: string
default: ''
- name: OnnxruntimeArch
type: string
- name: OnnxruntimeNodejsBindingArch
type: string
values:
- arm64
- x64
- name: PoolName
type: string
default: 'onnxruntime-Ubuntu2204-AMD-CPU'
- name: ArtifactNamePrefix
type: string
default: "onnxruntime"
- name: PackageJava
type: boolean
default: true
- name: PackageNodejs
type: boolean
default: true
jobs:
- job: Linux_C_API_Packaging_CPU_${{parameters.OnnxruntimeArch}}
workspace:
clean: all
timeoutInMinutes: 210
pool: ${{parameters.PoolName}}
steps:
- checkout: self
clean: true
submodules: none
- template: set-version-number-variables-step.yml
- ${{ if eq(parameters.OnnxruntimeArch, 'x64') }}:
- template: get-docker-image-steps.yml
parameters:
Dockerfile: tools/ci_build/github/linux/docker/inference/x86_64/default/cpu/Dockerfile
Context: tools/ci_build/github/linux/docker/inference/x86_64/default/cpu
DockerBuildArgs: "--build-arg BUILD_UID=$( id -u )"
Repository: onnxruntimecpubuildcentos8${{parameters.OnnxruntimeArch}}_packaging
- ${{ if eq(parameters.OnnxruntimeArch, 'aarch64') }}:
- template: get-docker-image-steps.yml
parameters:
Dockerfile: tools/ci_build/github/linux/docker/inference/aarch64/default/cpu/Dockerfile
Context: tools/ci_build/github/linux/docker/inference/aarch64/default/cpu
DockerBuildArgs: "--build-arg BUILD_UID=$( id -u )"
Repository: onnxruntimecpubuildcentos8${{parameters.OnnxruntimeArch}}_packaging
UpdateDepsTxt: false
- task: CmdLine@2
inputs:
script: |
set -e -x
mkdir -p $HOME/.onnx
docker run --rm --volume /data/onnx:/data/onnx:ro --volume $(Build.SourcesDirectory):/onnxruntime_src --volume $(Build.BinariesDirectory):/build \
--volume $HOME/.onnx:/home/onnxruntimedev/.onnx -e NIGHTLY_BUILD onnxruntimecpubuildcentos8${{parameters.OnnxruntimeArch}}_packaging /bin/bash -c "python3.12 \
/onnxruntime_src/tools/ci_build/build.py --enable_lto --build_java --build_nodejs --build_dir /build --config Release \
--skip_submodule_sync --parallel --use_binskim_compliant_compile_flags --build_shared_lib ${{ parameters.AdditionalBuildFlags }} && cd /build/Release && make install DESTDIR=/build/installed"
workingDirectory: $(Build.SourcesDirectory)
displayName: 'Build'
- script: |
set -e -x
mkdir $(Build.ArtifactStagingDirectory)/testdata
cp $(Build.BinariesDirectory)/Release/libcustom_op_library.so* $(Build.ArtifactStagingDirectory)/testdata
ls -al $(Build.ArtifactStagingDirectory)
displayName: 'Create Artifacts'
- ${{ if eq(parameters.PackageJava, 'true') }}:
- template: java-api-artifacts-package-and-publish-steps-posix.yml
parameters:
arch: 'linux-${{parameters.OnnxruntimeArch}}'
buildConfig: 'Release'
artifactName: 'onnxruntime-java-linux-${{parameters.OnnxruntimeArch}}'
version: '$(OnnxRuntimeVersion)'
libraryName: 'libonnxruntime.so'
nativeLibraryName: 'libonnxruntime4j_jni.so'
- template: c-api-artifacts-package-and-publish-steps-posix.yml
parameters:
buildConfig: 'Release'
artifactName: '${{parameters.ArtifactNamePrefix}}-linux-${{parameters.OnnxruntimeArch}}-$(OnnxRuntimeVersion)'
artifactNameNoVersionString: '${{parameters.ArtifactNamePrefix}}-linux-${{parameters.OnnxruntimeArch}}'
libraryName: 'libonnxruntime.so.$(OnnxRuntimeVersion)'
- ${{ if eq(parameters.PackageNodejs, 'true') }}:
- template: nodejs-artifacts-package-and-publish-steps-posix.yml
parameters:
arch: '${{parameters.OnnxruntimeNodejsBindingArch}}'
os: 'linux'
artifactName: 'drop-onnxruntime-nodejs-linux-${{parameters.OnnxruntimeArch}}'
- ${{ if not(eq(parameters.OnnxruntimeNodejsBindingArch, 'arm64')) }}:
- template: component-governance-component-detection-steps.yml
parameters:
condition: 'succeeded'