onnxruntime/tools/ci_build/github/azure-pipelines/post-merge-jobs.yml
Changming Sun 4a0b86eba6
Update the post-merge pipeline (#14965)
### Description
1.  Remove Linux jobs for ORT-Extension combined build
2.  Add a macOS build job for ORT-Extension combined build
3. Adjust the yaml file so that it can support two different ADO
instances.


### Motivation and Context
To test our code better. And it will enable us to run such tests for
every commit in the main branch. It would be easier for us to figure out
which change caused a build break.

See
[AB#13435](https://aiinfra.visualstudio.com/6a833879-cd9b-44a4-a9de-adc2d818f13c/_workitems/edit/13435)
2023-03-29 13:12:07 -07:00

232 lines
9.2 KiB
YAML

variables:
- name: WIN_CPU_BUILD_MACHINE_POOL_NAME # name of a variable
# The public ADO project
${{ if startsWith(variables['System.CollectionUri'], 'https://dev.azure.com/onnxruntime/') }}:
value: 'Win-CPU-2019'
# The private ADO project
${{ if or(startsWith(variables['System.CollectionUri'], 'https://dev.azure.com/aiinfra/'),startsWith(variables['System.CollectionUri'], 'https://aiinfra.visualstudio.com/')) }}:
value: 'Win-CPU-2021'
- name: LINUX_CPU_BUILD_MACHINE_POOL_NAME # name of a variable
# The public ADO project
${{ if startsWith(variables['System.CollectionUri'], 'https://dev.azure.com/onnxruntime/') }}:
value: 'Linux-CPU-2019'
# The private ADO project
${{ if or(startsWith(variables['System.CollectionUri'], 'https://dev.azure.com/aiinfra/'),startsWith(variables['System.CollectionUri'], 'https://aiinfra.visualstudio.com/')) }}:
value: 'Linux-CPU'
stages:
# This stage is to test if the combined build works on
# o Windows ARM64
# o Windows ARM64EC
# o Windows x64
# o Windows x86
# Now we don't have coverage for ARM64EC yet. Will add it.
- template: templates/win-ci.yml
parameters:
DoCompliance: false
DoEsrp: false
stage_name_suffix: CPU_x86_default
EnvSetupScript: setup_env_x86.bat
buildArch: x86
msbuildPlatform: Win32
packageName: x86
buildparameter: --use_extensions --enable_onnx_tests
runTests: true
buildJava: false
buildNodejs: false
ort_build_pool_name: ${{variables.WIN_CPU_BUILD_MACHINE_POOL_NAME}}
- template: templates/win-ci.yml
parameters:
DoCompliance: false
DoEsrp: false
stage_name_suffix: CPU_arm64_default
EnvSetupScript: setup_env.bat
buildArch: x64
msbuildPlatform: arm64
packageName: arm64
buildparameter: --build_nodejs --arm64 --use_extensions --enable_onnx_tests --path_to_protoc_exe $(Build.BinariesDirectory)\RelWithDebInfo\installed\bin\protoc.exe
runTests: false
buildJava: false
buildNodejs: true
ort_build_pool_name: ${{variables.WIN_CPU_BUILD_MACHINE_POOL_NAME}}
- template: templates/win-ci.yml
parameters:
DoCompliance: false
DoEsrp: false
stage_name_suffix: CPU_x64_default
EnvSetupScript: setup_env.bat
buildArch: x64
msbuildPlatform: x64
packageName: x64
buildparameter: --build_java --build_nodejs --use_extensions --enable_onnx_tests
runTests: true
buildJava: true
buildNodejs: true
ort_build_pool_name: ${{variables.WIN_CPU_BUILD_MACHINE_POOL_NAME}}
- stage: Mimalloc
dependsOn: [ ]
jobs:
- template: templates/win-ci-vs-2019.yml
parameters:
BuildConfig: 'Debug'
EnvSetupScript: setup_env.bat
buildArch: x64
additionalBuildFlags: --disable_memleak_checker --use_mimalloc
msbuildPlatform: x64
isX86: false
job_name_suffix: x64_mimalloc
RunOnnxRuntimeTests: true
RunStaticCodeAnalysis: false
isTraining: false
ORT_EP_NAME: CPU
GenerateDocumentation: false
EnablePython: false
MachinePool: ${{variables.WIN_CPU_BUILD_MACHINE_POOL_NAME}}
- stage: NoAbseil
dependsOn: [ ]
jobs:
- template: templates/win-ci-vs-2019.yml
parameters:
BuildConfig: 'Debug'
EnvSetupScript: setup_env.bat
buildArch: x64
additionalBuildFlags: --cmake_extra_defines onnxruntime_DISABLE_ABSEIL=ON
msbuildPlatform: x64
isX86: false
job_name_suffix: x64_no_absl
RunOnnxRuntimeTests: true
RunStaticCodeAnalysis: false
isTraining: false
ORT_EP_NAME: CPU
GenerateDocumentation: false
EnablePython: false
MachinePool: ${{variables.WIN_CPU_BUILD_MACHINE_POOL_NAME}}
- stage: MinimalBuildWithNoExceptions
dependsOn: [ ]
jobs:
- template: templates/win-ci-vs-2019.yml
parameters:
BuildConfig: 'Debug'
EnvSetupScript: setup_env.bat
buildArch: x64
additionalBuildFlags: --build_shared_lib --minimal_build --disable_exceptions
msbuildPlatform: x64
isX86: false
job_name_suffix: x64_minimal_no_exception
RunOnnxRuntimeTests: true
RunStaticCodeAnalysis: false
isTraining: false
ORT_EP_NAME: CPU
GenerateDocumentation: false
EnablePython: false
MachinePool: ${{variables.WIN_CPU_BUILD_MACHINE_POOL_NAME}}
- stage: DebugNodeInputsOutputs
dependsOn: [ ]
jobs:
- template: templates/win-ci-vs-2019.yml
parameters:
BuildConfig: 'Debug'
EnvSetupScript: setup_env.bat
buildArch: x64
additionalBuildFlags: --build_shared_lib --cmake_extra_defines onnxruntime_DEBUG_NODE_INPUTS_OUTPUTS=ON
msbuildPlatform: x64
isX86: false
job_name_suffix: x64_debug_node_input_output
RunOnnxRuntimeTests: true
RunStaticCodeAnalysis: false
isTraining: false
ORT_EP_NAME: CPU
GenerateDocumentation: false
EnablePython: false
MachinePool: ${{variables.WIN_CPU_BUILD_MACHINE_POOL_NAME}}
#Generate test coverage report and publish the data to a Cloud database. Only runs daily.
- stage: CodeCoverage
dependsOn: [ ]
jobs:
- job: CodeCoverage
workspace:
clean: all
timeoutInMinutes: 150
variables:
skipComponentGovernanceDetection: true
pool: ${{variables.LINUX_CPU_BUILD_MACHINE_POOL_NAME}}
steps:
- template: templates/set-version-number-variables-step.yml
- task: CmdLine@2
inputs:
script: |
set -e
ln -s /data/models .
#Build onnxruntime and run the instrumented program(unitests)
LLVM_PROFILE_FILE="%p.profraw" CFLAGS="-g -fprofile-instr-generate -fcoverage-mapping" CXXFLAGS="-g -fprofile-instr-generate -fcoverage-mapping" CC=clang CXX=clang++ python3 $(Build.SourcesDirectory)/tools/ci_build/build.py --build_dir=$(Build.BinariesDirectory) --config Debug --parallel --skip_submodule_sync --build_shared_lib --enable_onnx_tests --cmake_extra_defines RUN_MODELTEST_IN_DEBUG_MODE=ON
cd Debug
./onnxruntime_mlas_test
#Merge the multiple prof data into a single indexed profile data file
llvm-profdata merge -sparse -o ort.profdata *.profraw
#Create coverage report, output the result to 'report.json'
llvm-cov export -summary-only -instr-profile=ort.profdata onnxruntime_test_all -object onnxruntime_mlas_test -object onnxruntime_api_tests_without_env -object onnx_test_runner -object onnxruntime_shared_lib_test -object onnxruntime_global_thread_pools_test -object onnxruntime_api_tests_without_env $(Build.SourcesDirectory)/include/onnxruntime $(Build.SourcesDirectory)/onnxruntime/core $(Build.SourcesDirectory)/onnxruntime/contrib_ops > $(Build.BinariesDirectory)/report.json
llvm-cov show -instr-profile=ort.profdata onnxruntime_test_all -object onnxruntime_mlas_test -object onnxruntime_api_tests_without_env -object onnx_test_runner -object onnxruntime_shared_lib_test -object onnxruntime_global_thread_pools_test -object onnxruntime_api_tests_without_env $(Build.SourcesDirectory)/include/onnxruntime $(Build.SourcesDirectory)/onnxruntime/core $(Build.SourcesDirectory)/onnxruntime/contrib_ops --format=html -output-dir=$(Build.ArtifactStagingDirectory)
workingDirectory: $(Build.BinariesDirectory)
- ${{ if or(startsWith(variables['System.CollectionUri'], 'https://dev.azure.com/aiinfra/'),startsWith(variables['System.CollectionUri'], 'https://aiinfra.visualstudio.com/')) }}:
- task: AzureCLI@2
displayName: 'Azure CLI'
inputs:
azureSubscription: AIInfraBuildOnnxRuntimeOSS
scriptType: bash
scriptPath: $(Build.SourcesDirectory)/tools/ci_build/github/linux/upload_code_coverage_data.sh
arguments: '"$(Build.BinariesDirectory)/report.json" "https://aiinfra.visualstudio.com/Lotus/_build/results?buildId=$(Build.BuildId)" x64 linux default'
workingDirectory: '$(Build.BinariesDirectory)'
- task: PublishPipelineArtifact@1
displayName: 'Publish Pipeline Artifact'
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)'
artifact: html
- ${{ if or(startsWith(variables['System.CollectionUri'], 'https://dev.azure.com/aiinfra/'),startsWith(variables['System.CollectionUri'], 'https://aiinfra.visualstudio.com/')) }}:
- template: templates/upload-code-coverage-data.yml
- stage: AndroidCustomBuildScript
dependsOn: [ ]
jobs:
- job: AndroidCustomBuildScript
workspace:
clean: all
pool: ${{variables.LINUX_CPU_BUILD_MACHINE_POOL_NAME}}
variables:
dockerImageTag: onnxruntime-android-custom-build
steps:
- checkout: self
submodules: false
- task: UsePythonVersion@0
inputs:
versionSpec: '3.8'
addToPath: true
architecture: x64
- task: CmdLine@2
displayName: 'Run build_custom_android_package.py'
inputs:
script: |
"$(Build.SourcesDirectory)/tools/android_custom_build/build_custom_android_package.py" \
--docker_image_tag=$(dockerImageTag) \
"$(Build.BinariesDirectory)/custom_android_package"
workingDirectory: '$(Build.BinariesDirectory)'
- task: CmdLine@2
displayName: 'Clean up docker image'
inputs:
script: docker image rm $(dockerImageTag)
workingDirectory: '$(Build.BinariesDirectory)'
condition: succeededOrFailed()