onnxruntime/tools/ci_build/github/azure-pipelines/templates/final-jar-testing.yml
Changming Sun b04adcc381
Update copy_strip_binary.sh: use "make install" instead (#21464)
### Description
Before this change, copy_strip_binary.sh manually copies each file from
onnx runtime's build folder to an artifact folder. It can be hard when
dealing with symbolic link for shared libraries.
This PR will change the packaging pipelines to run "make install" first,
before packaging shared libs .


### Motivation and Context

Recently because of feature request #21281 , we changed
libonnxruntime.so's SONAME. Now every package that contains this shared
library must also contains libonnxruntime.so.1. Therefore we need to
change the packaging scripts to include this file. Instead of manually
construct the symlink layout, using `make install` is much easier and
will make things more consistent because it is a standard way of making
packages.

**Breaking change:**
After this change, our **inference** tarballs that are published to our
Github release pages will be not contain ORT **training** headers.
2024-07-24 10:02:00 -07:00

96 lines
3.2 KiB
YAML

parameters:
- name: OS
displayName: Opserating System
type: string
- name: SpecificArtifact
displayName: Specific Artifact
type: string
default: ''
- name: BuildId
displayName: Build Id
type: string
default: ''
- name: PoolName
type: string
stages:
- stage: Final_Jar_Testing_${{parameters.OS}}
dependsOn:
Jar_Packaging
jobs:
- job: Final_Jar_Testing_${{parameters.OS}}
workspace:
clean: all
${{ if eq(parameters.OS, 'MacOS') }}:
pool:
vmImage: ${{ parameters.PoolName }}
${{ else }}:
pool: ${{ parameters.PoolName }}
variables:
- name: runCodesignValidationInjection
value: false
timeoutInMinutes: 60
steps:
- template: set-version-number-variables-step.yml
- template: flex-downloadPipelineArtifact.yml
parameters:
StepName: 'Download Final Jar'
ArtifactName: onnxruntime-java
TargetPath: '$(Build.BinariesDirectory)/final-jar'
SpecificArtifact: ${{ parameters.SpecificArtifact }}
BuildId: ${{ parameters.BuildId }}
- template: flex-downloadPipelineArtifact.yml
parameters:
StepName: 'Download Jar Tools'
ArtifactName: onnxruntime-java-tools
TargetPath: '$(Build.BinariesDirectory)/final-jar'
SpecificArtifact: ${{ parameters.SpecificArtifact }}
BuildId: ${{ parameters.BuildId }}
- ${{ if eq(parameters.OS, 'Windows') }}:
- task: CmdLine@2
inputs:
script: |
mkdir test
pushd test
jar xf $(Build.BinariesDirectory)\final-jar\testing.jar
popd
java -jar junit-platform-console-standalone-1.6.2.jar -cp .;.\test;protobuf-java-3.21.7.jar;onnxruntime-$(OnnxRuntimeVersion).jar --scan-class-path --fail-if-no-tests --disable-banner
workingDirectory: '$(Build.BinariesDirectory)\final-jar'
- ${{ else }}:
- task: Bash@3
inputs:
targetType: 'inline'
script: |
set -e -x
echo "Java Version"
java -version
mkdir test
pushd test
jar xf '$(Build.BinariesDirectory)/final-jar/testing.jar'
popd
# if you want to run the tests in the power shell, you need to replace ':' to ';', that is, "-cp .;.\test;protobuf-java-3.21.7.jar;onnxruntime-$(OnnxRuntimeVersion).jar"
java -jar ./junit-platform-console-standalone-1.6.2.jar -cp .:./test:./protobuf-java-3.21.7.jar:./onnxruntime-$(OnnxRuntimeVersion).jar --scan-class-path --fail-if-no-tests --disable-banner
workingDirectory: '$(Build.BinariesDirectory)/final-jar'
env:
${{ if eq(parameters.OS, 'MacOS') }}:
DYLD_LIBRARY_PATH: '$(Build.BinariesDirectory)/final-jar/test:$(DYLD_LIBRARY_PATH)'
${{ if eq(parameters.OS, 'Linux') }}:
LD_LIBRARY_PATH: '$(Build.BinariesDirectory)/final-jar/test:$(LD_LIBRARY_PATH)'
- ${{ if eq(parameters['OS'], 'MacOS') }}:
- template: use-xcode-version.yml
- template: component-governance-component-detection-steps.yml
parameters :
condition : 'succeeded'
- task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3
displayName: 'Clean Agent Directories'
condition: always()