mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-25 22:26:24 +00:00
### Description 1. Add a Memory Profiling build job 2. Remove no absl build job since the feature will be removed 3. Simplify post-merge-jobs.yml by unifying the pool names ### Motivation and Context To catch build errors in #16124
111 lines
4.3 KiB
YAML
111 lines
4.3 KiB
YAML
# 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: BaseImage
|
|
type: string
|
|
|
|
- name: OnnxruntimeArch
|
|
type: string
|
|
|
|
- name: OnnxruntimeCFlags
|
|
type: string
|
|
|
|
- name: OnnxruntimeCXXFlags
|
|
type: string
|
|
|
|
- name: OnnxruntimeNodejsBindingArch
|
|
type: string
|
|
|
|
- name: PoolName
|
|
type: string
|
|
default: 'onnxruntime-Ubuntu2004-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
|
|
variables:
|
|
- name: skipComponentGovernanceDetection
|
|
value: ${{eq('${{parameters.OnnxruntimeNodejsBindingArch}}', 'arm64')}}
|
|
timeoutInMinutes: 210
|
|
pool: ${{parameters.PoolName}}
|
|
steps:
|
|
- checkout: self
|
|
clean: true
|
|
submodules: none
|
|
- template: set-version-number-variables-step.yml
|
|
- template: get-docker-image-steps.yml
|
|
parameters:
|
|
Dockerfile: tools/ci_build/github/linux/docker/inference/${{parameters.OnnxruntimeArch}}/default/cpu/Dockerfile
|
|
Context: tools/ci_build/github/linux/docker/inference/${{parameters.OnnxruntimeArch}}/default/cpu
|
|
DockerBuildArgs: "--build-arg BUILD_UID=$( id -u ) --build-arg BASEIMAGE=${{parameters.BaseImage}}"
|
|
Repository: onnxruntimecpubuildcentos7${{parameters.OnnxruntimeArch}}
|
|
${{ if eq(parameters.OnnxruntimeArch, 'aarch64') }}:
|
|
UpdateDepsTxt: false
|
|
|
|
- task: CmdLine@2
|
|
inputs:
|
|
script: |
|
|
mkdir -p $HOME/.onnx
|
|
docker run --rm -e CFLAGS="${{parameters.OnnxruntimeCFlags}}" -e CXXFLAGS="${{parameters.OnnxruntimeCXXFlags}}" --volume /data/onnx:/data/onnx:ro --volume $(Build.SourcesDirectory):/onnxruntime_src --volume $(Build.BinariesDirectory):/build \
|
|
--volume $HOME/.onnx:/home/onnxruntimedev/.onnx -e NIGHTLY_BUILD onnxruntimecpubuildcentos7${{parameters.OnnxruntimeArch}} /bin/bash -c "python3 \
|
|
/onnxruntime_src/tools/ci_build/build.py --build_java --build_nodejs --build_dir /build --config Release \
|
|
--skip_submodule_sync --parallel --build_shared_lib ${{ parameters.AdditionalBuildFlags }} && cd /build/Release && make install DESTDIR=/build/linux-${{parameters.OnnxruntimeArch}}"
|
|
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'
|
|
- task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3
|
|
displayName: 'Clean Agent Directories'
|
|
condition: always()
|