From 6cab18ce7dd2441ccaa4ddfa7473cb24ab178c5c Mon Sep 17 00:00:00 2001 From: Erik Date: Fri, 27 Feb 2026 09:15:42 -0500 Subject: [PATCH 01/14] Move jar testing to 1es --- .../azure-pipelines/jar_package_testing.yml | 370 ++++++++++-------- .../templates/final-jar-testing-win.yml | 2 + 2 files changed, 207 insertions(+), 165 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/jar_package_testing.yml b/tools/ci_build/github/azure-pipelines/jar_package_testing.yml index 275d911b7cca2..e9bfe2144c1bd 100644 --- a/tools/ci_build/github/azure-pipelines/jar_package_testing.yml +++ b/tools/ci_build/github/azure-pipelines/jar_package_testing.yml @@ -4,173 +4,213 @@ resources: source: 'Zip-Nuget-Java-Nodejs Packaging Pipeline' trigger: true branch: main + - repository: 1esPipelines + type: git + name: 1ESPipelineTemplates/1ESPipelineTemplates + ref: refs/tags/release variables: mavenVersion: '3.9.8' -stages: -- template: templates/final-jar-testing-win.yml +extends: + # The pipeline extends the 1ES PT which will inject different SDL and compliance tasks. + # For non-production pipelines, use "Unofficial" as defined below. + # For productions pipelines, use "Official". + template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines parameters: - PoolName: 'onnxruntime-Win-CPU-VS2022-Latest' - -- template: templates/final-jar-testing-linux.yml - parameters: - OS: Linux - PoolName: 'onnxruntime-Ubuntu2204-AMD-CPU' - -- template: templates/final-jar-testing-linux.yml - parameters: - OS: MacOS - PoolName: 'AcesShared' - PoolDemands: 'ImageOverride -equals ACES_VM_SharedPool_Sequoia' - -- stage: GPU_JAR_Testing - dependsOn: [] - jobs: - - job: Final_Jar_Testing_Windows_GPU - workspace: - clean: all - pool: 'onnxruntime-Win2022-GPU-A10' - timeoutInMinutes: 60 - variables: - - name: runCodesignValidationInjection - value: false - - steps: - - template: templates/set-version-number-variables-step.yml - - - template: templates/jobs/download_win_gpu_library.yml - parameters: - CudaVersion: 12.8 - DownloadCUDA: true - DownloadTRT: true - - - template: templates/setup-maven.yml - - - task: Maven@4 - displayName: 'Download Java Dependencies' - inputs: - mavenPomFile: '$(Build.SourcesDirectory)/tools/ci_build/java/pom.xml' - goals: 'dependency:copy-dependencies' - options: '-DoutputDirectory=$(Pipeline.Workspace)/build/onnxruntime-java' - publishJUnitTestResults: false - javaHomeOption: 'JDKVersion' - jdkVersionOption: '1.17' - mavenVersionOption: 'Default' - - download: build - artifact: 'onnxruntime-java-gpu' - displayName: 'Download Final Jar' - - script: | - move $(Pipeline.Workspace)\build\onnxruntime-java-gpu\*.jar $(Pipeline.Workspace)\build\onnxruntime-java\ - - - task: PowerShell@2 - displayName: 'Run Java Tests with PowerShell' - inputs: - targetType: 'inline' - script: | - # Exit script on any error - $ErrorActionPreference = "Stop" - - cd $(Pipeline.Workspace)/build/onnxruntime-java - del *.asc - del *.sha256 - del *.sha512 - del *.pom - del *.sha1 - del *.pom - cd .. - mkdir tests - cd tests - jar xf $(Pipeline.Workspace)/build/onnxruntime-java/testing.jar - del $(Pipeline.Workspace)/build/onnxruntime-java/testing.jar - dir $(Pipeline.Workspace)/build/tests - Write-Host "Running JUnit Tests..." - & java -DUSE_CUDA=1 ` - -cp "$(Pipeline.Workspace)\build\tests;$(Pipeline.Workspace)\build\onnxruntime-java\*" org.junit.platform.console.ConsoleLauncher --scan-classpath=$(Pipeline.Workspace)\build\tests ` - --fail-if-no-tests --disable-banner --reports-dir "$($env:Build_ArtifactStagingDirectory)/TestResults" - - - task: PublishTestResults@2 - displayName: 'Publish Test Results' - inputs: - testResultsFormat: 'JUnit' - testResultsFiles: '$(Build.ArtifactStagingDirectory)/TestResults/TEST-junit-jupiter.xml' - failTaskOnFailedTests: true - - - - job: Final_Jar_Testing_Linux_GPU - workspace: - clean: all - pool: - name: 'Onnxruntime-Linux-GPU-A10' - variables: - - name: runCodesignValidationInjection - value: false - - name: docker_base_image - value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_almalinux8_gcc14:20251017.1 - timeoutInMinutes: 60 - steps: - - checkout: self - submodules: false - - - template: templates/set-version-number-variables-step.yml - - - bash: | - sudo apt-get install -y msopenjdk-17 - dpkg -l msopenjdk-17 - - - bash: | - echo "Downloading and installing Maven $(mavenVersion) for Linux..." - MAVEN_DIR="$(Agent.TempDirectory)/apache-maven-$(mavenVersion)" - # Download Maven binary - wget https://archive.apache.org/dist/maven/maven-3/$(mavenVersion)/binaries/apache-maven-$(mavenVersion)-bin.tar.gz -O $(Agent.TempDirectory)/maven.tar.gz - - # Extract to the temp directory - mkdir -p ${MAVEN_DIR} - tar -xzf $(Agent.TempDirectory)/maven.tar.gz -C $(Agent.TempDirectory) - - # Add Maven's bin directory to the PATH for subsequent tasks in the job - echo "##vso[task.prependpath]${MAVEN_DIR}/bin" - displayName: 'Install Maven (Linux)' - - - script: | - echo "Maven is now on the PATH." - mvn --version - - - download: build - artifact: 'onnxruntime-java-gpu' - displayName: 'Download Final Jar' - - # Rename the downloaded folder - - script: | - mv $(Pipeline.Workspace)/build/onnxruntime-java-gpu $(Pipeline.Workspace)/build/onnxruntime-java - - - task: Maven@4 - displayName: 'Download Dependencies' - inputs: - mavenPomFile: '$(Build.SourcesDirectory)/tools/ci_build/java/pom.xml' - goals: 'dependency:copy-dependencies' - options: '-DoutputDirectory=$(Pipeline.Workspace)/build/onnxruntime-java' - publishJUnitTestResults: false - javaHomeOption: 'Path' - jdkDirectory: '/usr/lib/jvm/msopenjdk-17-amd64' - jdkVersionOption: 'Default' - mavenVersionOption: 'Default' - - # Now all the jars are in the $(Pipeline.Workspace)/build folder - - - template: templates/get-docker-image-steps.yml - parameters: - Dockerfile: tools/ci_build/github/linux/docker/Dockerfile.package_ubi8_cuda_tensorrt10_0 - Context: tools/ci_build/github/linux/docker/ - DockerBuildArgs: "--build-arg BUILD_UID=$( id -u ) --build-arg BASEIMAGE=${{ variables.docker_base_image }} --build-arg TRT_VERSION=${{ variables.linux_trt_version }}" - Repository: onnxruntimeubi8packagestest - - - bash: | - docker run --network=none --rm \ - --gpus all \ - --volume $(Build.SourcesDirectory):/onnxruntime_src \ - --volume $(Pipeline.Workspace)/build:/build \ - --volume /data/models:/build/models:ro \ - onnxruntimeubi8packagestest \ - /bin/bash /onnxruntime_src/tools/ci_build/github/linux/java_linux_final_test.sh -r /build -v $(OnnxRuntimeVersion) - displayName: 'Test' + featureFlags: + binskimScanAllExtensions: true + sdl: + binskim: + enabled: true + scanOutputDirectoryOnly: true + sourceAnalysisPool: + name: onnxruntime-Win-CPU-VS2022-Latest + os: windows + componentgovernance: + ignoreDirectories: '$(Build.Repository.LocalPath)/cmake/external/emsdk/upstream/emscripten/tests,$(Build.Repository.LocalPath)/cmake/external/onnx/third_party/benchmark,$(Build.Repository.LocalPath)/cmake/external/onnx/third_party/pybind11,$(Build.Repository.LocalPath)/cmake/external/onnx/third_party/pybind11/tests,$(Build.Repository.LocalPath)/cmake/external/onnxruntime-extensions,$(Build.Repository.LocalPath)/js/react_native/e2e/node_modules,$(Build.Repository.LocalPath)/js/node_modules,$(Build.Repository.LocalPath)/onnxruntime-inference-examples,$(Build.SourcesDirectory)/cmake/external/emsdk/upstream/emscripten/tests,$(Build.SourcesDirectory)/cmake/external/onnx/third_party/benchmark,$(Build.SourcesDirectory)/cmake/external/onnx/third_party/pybind11,$(Build.SourcesDirectory)/cmake/external/onnx/third_party/pybind11/tests,$(Build.SourcesDirectory)/cmake/external/onnxruntime-extensions,$(Build.SourcesDirectory)/js/react_native/e2e/node_modules,$(Build.SourcesDirectory)/js/node_modules,$(Build.SourcesDirectory)/onnxruntime-inference-examples,$(Build.BinariesDirectory)' + sourceRepositoriesToScan: + exclude: + - repository: onnxruntime-inference-examples + spotBugs: + enabled: false + justificationForDisabling: "Getting ##[error]1. SpotBugs Error gdn.unknownFormatResult - File: spotbugs.xml, which indicates that SpotBugs found one or more errors, which are not handled by the Guardian right now." + codeql: + compiled: + enabled: false + justificationForDisabling: 'CodeQL is taking nearly 6 hours resulting in timeouts in our production pipelines' + tsa: + enabled: true + codeSignValidation: + enabled: true + break: true + policheck: + enabled: true + exclusionsFile: '$(Build.SourcesDirectory)\tools\ci_build\policheck_exclusions.xml' + + stages: + - template: templates/final-jar-testing-win.yml + parameters: + PoolName: 'onnxruntime-Win-CPU-VS2022-Latest' + + - template: templates/final-jar-testing-linux.yml + parameters: + OS: Linux + PoolName: 'onnxruntime-Ubuntu2204-AMD-CPU' + + # - template: templates/final-jar-testing-linux.yml + # parameters: + # OS: MacOS + # PoolName: 'AcesShared' + # PoolDemands: 'ImageOverride -equals ACES_VM_SharedPool_Sequoia' + + # - stage: GPU_JAR_Testing + # dependsOn: [] + # jobs: + # - job: Final_Jar_Testing_Windows_GPU + # workspace: + # clean: all + # pool: 'onnxruntime-Win2022-GPU-A10' + # timeoutInMinutes: 60 + # variables: + # - name: runCodesignValidationInjection + # value: false + + # steps: + # - template: templates/set-version-number-variables-step.yml + + # - template: templates/jobs/download_win_gpu_library.yml + # parameters: + # CudaVersion: 12.8 + # DownloadCUDA: true + # DownloadTRT: true + + # - template: templates/setup-maven.yml + + # - task: Maven@4 + # displayName: 'Download Java Dependencies' + # inputs: + # mavenPomFile: '$(Build.SourcesDirectory)/tools/ci_build/java/pom.xml' + # goals: 'dependency:copy-dependencies' + # options: '-DoutputDirectory=$(Pipeline.Workspace)/build/onnxruntime-java' + # publishJUnitTestResults: false + # javaHomeOption: 'JDKVersion' + # jdkVersionOption: '1.17' + # mavenVersionOption: 'Default' + # - download: build + # artifact: 'onnxruntime-java-gpu' + # displayName: 'Download Final Jar' + # - script: | + # move $(Pipeline.Workspace)\build\onnxruntime-java-gpu\*.jar $(Pipeline.Workspace)\build\onnxruntime-java\ + + # - task: PowerShell@2 + # displayName: 'Run Java Tests with PowerShell' + # inputs: + # targetType: 'inline' + # script: | + # # Exit script on any error + # $ErrorActionPreference = "Stop" + + # cd $(Pipeline.Workspace)/build/onnxruntime-java + # del *.asc + # del *.sha256 + # del *.sha512 + # del *.pom + # del *.sha1 + # del *.pom + # cd .. + # mkdir tests + # cd tests + # jar xf $(Pipeline.Workspace)/build/onnxruntime-java/testing.jar + # del $(Pipeline.Workspace)/build/onnxruntime-java/testing.jar + # dir $(Pipeline.Workspace)/build/tests + # Write-Host "Running JUnit Tests..." + # & java -DUSE_CUDA=1 ` + # -cp "$(Pipeline.Workspace)\build\tests;$(Pipeline.Workspace)\build\onnxruntime-java\*" org.junit.platform.console.ConsoleLauncher --scan-classpath=$(Pipeline.Workspace)\build\tests ` + # --fail-if-no-tests --disable-banner --reports-dir "$($env:Build_ArtifactStagingDirectory)/TestResults" + + # - task: PublishTestResults@2 + # displayName: 'Publish Test Results' + # inputs: + # testResultsFormat: 'JUnit' + # testResultsFiles: '$(Build.ArtifactStagingDirectory)/TestResults/TEST-junit-jupiter.xml' + # failTaskOnFailedTests: true + + + # - job: Final_Jar_Testing_Linux_GPU + # workspace: + # clean: all + # pool: + # name: 'Onnxruntime-Linux-GPU-A10' + # variables: + # - name: runCodesignValidationInjection + # value: false + # - name: docker_base_image + # value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_almalinux8_gcc14:20251017.1 + # timeoutInMinutes: 60 + # steps: + # - checkout: self + # submodules: false + + # - template: templates/set-version-number-variables-step.yml + + # - bash: | + # sudo apt-get install -y msopenjdk-17 + # dpkg -l msopenjdk-17 + + # - bash: | + # echo "Downloading and installing Maven $(mavenVersion) for Linux..." + # MAVEN_DIR="$(Agent.TempDirectory)/apache-maven-$(mavenVersion)" + # # Download Maven binary + # wget https://archive.apache.org/dist/maven/maven-3/$(mavenVersion)/binaries/apache-maven-$(mavenVersion)-bin.tar.gz -O $(Agent.TempDirectory)/maven.tar.gz + + # # Extract to the temp directory + # mkdir -p ${MAVEN_DIR} + # tar -xzf $(Agent.TempDirectory)/maven.tar.gz -C $(Agent.TempDirectory) + + # # Add Maven's bin directory to the PATH for subsequent tasks in the job + # echo "##vso[task.prependpath]${MAVEN_DIR}/bin" + # displayName: 'Install Maven (Linux)' + + # - script: | + # echo "Maven is now on the PATH." + # mvn --version + + # - download: build + # artifact: 'onnxruntime-java-gpu' + # displayName: 'Download Final Jar' + + # # Rename the downloaded folder + # - script: | + # mv $(Pipeline.Workspace)/build/onnxruntime-java-gpu $(Pipeline.Workspace)/build/onnxruntime-java + + # - task: Maven@4 + # displayName: 'Download Dependencies' + # inputs: + # mavenPomFile: '$(Build.SourcesDirectory)/tools/ci_build/java/pom.xml' + # goals: 'dependency:copy-dependencies' + # options: '-DoutputDirectory=$(Pipeline.Workspace)/build/onnxruntime-java' + # publishJUnitTestResults: false + # javaHomeOption: 'Path' + # jdkDirectory: '/usr/lib/jvm/msopenjdk-17-amd64' + # jdkVersionOption: 'Default' + # mavenVersionOption: 'Default' + + # # Now all the jars are in the $(Pipeline.Workspace)/build folder + + # - template: templates/get-docker-image-steps.yml + # parameters: + # Dockerfile: tools/ci_build/github/linux/docker/Dockerfile.package_ubi8_cuda_tensorrt10_0 + # Context: tools/ci_build/github/linux/docker/ + # DockerBuildArgs: "--build-arg BUILD_UID=$( id -u ) --build-arg BASEIMAGE=${{ variables.docker_base_image }} --build-arg TRT_VERSION=${{ variables.linux_trt_version }}" + # Repository: onnxruntimeubi8packagestest + + # - bash: | + # docker run --network=none --rm \ + # --gpus all \ + # --volume $(Build.SourcesDirectory):/onnxruntime_src \ + # --volume $(Pipeline.Workspace)/build:/build \ + # --volume /data/models:/build/models:ro \ + # onnxruntimeubi8packagestest \ + # /bin/bash /onnxruntime_src/tools/ci_build/github/linux/java_linux_final_test.sh -r /build -v $(OnnxRuntimeVersion) + # displayName: 'Test' diff --git a/tools/ci_build/github/azure-pipelines/templates/final-jar-testing-win.yml b/tools/ci_build/github/azure-pipelines/templates/final-jar-testing-win.yml index de07e9e89dc81..73fe7e9797295 100644 --- a/tools/ci_build/github/azure-pipelines/templates/final-jar-testing-win.yml +++ b/tools/ci_build/github/azure-pipelines/templates/final-jar-testing-win.yml @@ -11,6 +11,8 @@ stages: clean: all pool: name: ${{ parameters.PoolName }} + templateContext: + type: validationJob variables: - name: runCodesignValidationInjection value: false From 7ac2e49a880fecad0fb4c139360e78109c1b35a8 Mon Sep 17 00:00:00 2001 From: Erik Date: Fri, 27 Feb 2026 09:18:55 -0500 Subject: [PATCH 02/14] Move jar testing to 1es --- tools/ci_build/github/azure-pipelines/jar_package_testing.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/jar_package_testing.yml b/tools/ci_build/github/azure-pipelines/jar_package_testing.yml index e9bfe2144c1bd..183be5d1c3679 100644 --- a/tools/ci_build/github/azure-pipelines/jar_package_testing.yml +++ b/tools/ci_build/github/azure-pipelines/jar_package_testing.yml @@ -4,6 +4,7 @@ resources: source: 'Zip-Nuget-Java-Nodejs Packaging Pipeline' trigger: true branch: main + repositories: - repository: 1esPipelines type: git name: 1ESPipelineTemplates/1ESPipelineTemplates @@ -29,9 +30,6 @@ extends: os: windows componentgovernance: ignoreDirectories: '$(Build.Repository.LocalPath)/cmake/external/emsdk/upstream/emscripten/tests,$(Build.Repository.LocalPath)/cmake/external/onnx/third_party/benchmark,$(Build.Repository.LocalPath)/cmake/external/onnx/third_party/pybind11,$(Build.Repository.LocalPath)/cmake/external/onnx/third_party/pybind11/tests,$(Build.Repository.LocalPath)/cmake/external/onnxruntime-extensions,$(Build.Repository.LocalPath)/js/react_native/e2e/node_modules,$(Build.Repository.LocalPath)/js/node_modules,$(Build.Repository.LocalPath)/onnxruntime-inference-examples,$(Build.SourcesDirectory)/cmake/external/emsdk/upstream/emscripten/tests,$(Build.SourcesDirectory)/cmake/external/onnx/third_party/benchmark,$(Build.SourcesDirectory)/cmake/external/onnx/third_party/pybind11,$(Build.SourcesDirectory)/cmake/external/onnx/third_party/pybind11/tests,$(Build.SourcesDirectory)/cmake/external/onnxruntime-extensions,$(Build.SourcesDirectory)/js/react_native/e2e/node_modules,$(Build.SourcesDirectory)/js/node_modules,$(Build.SourcesDirectory)/onnxruntime-inference-examples,$(Build.BinariesDirectory)' - sourceRepositoriesToScan: - exclude: - - repository: onnxruntime-inference-examples spotBugs: enabled: false justificationForDisabling: "Getting ##[error]1. SpotBugs Error gdn.unknownFormatResult - File: spotbugs.xml, which indicates that SpotBugs found one or more errors, which are not handled by the Guardian right now." From 067a29104f0bd8cf85aafcb8343ab096975af542 Mon Sep 17 00:00:00 2001 From: Erik Date: Fri, 27 Feb 2026 09:19:41 -0500 Subject: [PATCH 03/14] Move jar testing to 1es --- .../azure-pipelines/jar_package_testing.yml | 332 +++++++++--------- 1 file changed, 166 insertions(+), 166 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/jar_package_testing.yml b/tools/ci_build/github/azure-pipelines/jar_package_testing.yml index 183be5d1c3679..be01d06722507 100644 --- a/tools/ci_build/github/azure-pipelines/jar_package_testing.yml +++ b/tools/ci_build/github/azure-pipelines/jar_package_testing.yml @@ -46,169 +46,169 @@ extends: enabled: true exclusionsFile: '$(Build.SourcesDirectory)\tools\ci_build\policheck_exclusions.xml' - stages: - - template: templates/final-jar-testing-win.yml - parameters: - PoolName: 'onnxruntime-Win-CPU-VS2022-Latest' - - - template: templates/final-jar-testing-linux.yml - parameters: - OS: Linux - PoolName: 'onnxruntime-Ubuntu2204-AMD-CPU' - - # - template: templates/final-jar-testing-linux.yml - # parameters: - # OS: MacOS - # PoolName: 'AcesShared' - # PoolDemands: 'ImageOverride -equals ACES_VM_SharedPool_Sequoia' - - # - stage: GPU_JAR_Testing - # dependsOn: [] - # jobs: - # - job: Final_Jar_Testing_Windows_GPU - # workspace: - # clean: all - # pool: 'onnxruntime-Win2022-GPU-A10' - # timeoutInMinutes: 60 - # variables: - # - name: runCodesignValidationInjection - # value: false - - # steps: - # - template: templates/set-version-number-variables-step.yml - - # - template: templates/jobs/download_win_gpu_library.yml - # parameters: - # CudaVersion: 12.8 - # DownloadCUDA: true - # DownloadTRT: true - - # - template: templates/setup-maven.yml - - # - task: Maven@4 - # displayName: 'Download Java Dependencies' - # inputs: - # mavenPomFile: '$(Build.SourcesDirectory)/tools/ci_build/java/pom.xml' - # goals: 'dependency:copy-dependencies' - # options: '-DoutputDirectory=$(Pipeline.Workspace)/build/onnxruntime-java' - # publishJUnitTestResults: false - # javaHomeOption: 'JDKVersion' - # jdkVersionOption: '1.17' - # mavenVersionOption: 'Default' - # - download: build - # artifact: 'onnxruntime-java-gpu' - # displayName: 'Download Final Jar' - # - script: | - # move $(Pipeline.Workspace)\build\onnxruntime-java-gpu\*.jar $(Pipeline.Workspace)\build\onnxruntime-java\ - - # - task: PowerShell@2 - # displayName: 'Run Java Tests with PowerShell' - # inputs: - # targetType: 'inline' - # script: | - # # Exit script on any error - # $ErrorActionPreference = "Stop" - - # cd $(Pipeline.Workspace)/build/onnxruntime-java - # del *.asc - # del *.sha256 - # del *.sha512 - # del *.pom - # del *.sha1 - # del *.pom - # cd .. - # mkdir tests - # cd tests - # jar xf $(Pipeline.Workspace)/build/onnxruntime-java/testing.jar - # del $(Pipeline.Workspace)/build/onnxruntime-java/testing.jar - # dir $(Pipeline.Workspace)/build/tests - # Write-Host "Running JUnit Tests..." - # & java -DUSE_CUDA=1 ` - # -cp "$(Pipeline.Workspace)\build\tests;$(Pipeline.Workspace)\build\onnxruntime-java\*" org.junit.platform.console.ConsoleLauncher --scan-classpath=$(Pipeline.Workspace)\build\tests ` - # --fail-if-no-tests --disable-banner --reports-dir "$($env:Build_ArtifactStagingDirectory)/TestResults" - - # - task: PublishTestResults@2 - # displayName: 'Publish Test Results' - # inputs: - # testResultsFormat: 'JUnit' - # testResultsFiles: '$(Build.ArtifactStagingDirectory)/TestResults/TEST-junit-jupiter.xml' - # failTaskOnFailedTests: true - - - # - job: Final_Jar_Testing_Linux_GPU - # workspace: - # clean: all - # pool: - # name: 'Onnxruntime-Linux-GPU-A10' - # variables: - # - name: runCodesignValidationInjection - # value: false - # - name: docker_base_image - # value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_almalinux8_gcc14:20251017.1 - # timeoutInMinutes: 60 - # steps: - # - checkout: self - # submodules: false - - # - template: templates/set-version-number-variables-step.yml - - # - bash: | - # sudo apt-get install -y msopenjdk-17 - # dpkg -l msopenjdk-17 - - # - bash: | - # echo "Downloading and installing Maven $(mavenVersion) for Linux..." - # MAVEN_DIR="$(Agent.TempDirectory)/apache-maven-$(mavenVersion)" - # # Download Maven binary - # wget https://archive.apache.org/dist/maven/maven-3/$(mavenVersion)/binaries/apache-maven-$(mavenVersion)-bin.tar.gz -O $(Agent.TempDirectory)/maven.tar.gz - - # # Extract to the temp directory - # mkdir -p ${MAVEN_DIR} - # tar -xzf $(Agent.TempDirectory)/maven.tar.gz -C $(Agent.TempDirectory) - - # # Add Maven's bin directory to the PATH for subsequent tasks in the job - # echo "##vso[task.prependpath]${MAVEN_DIR}/bin" - # displayName: 'Install Maven (Linux)' - - # - script: | - # echo "Maven is now on the PATH." - # mvn --version - - # - download: build - # artifact: 'onnxruntime-java-gpu' - # displayName: 'Download Final Jar' - - # # Rename the downloaded folder - # - script: | - # mv $(Pipeline.Workspace)/build/onnxruntime-java-gpu $(Pipeline.Workspace)/build/onnxruntime-java - - # - task: Maven@4 - # displayName: 'Download Dependencies' - # inputs: - # mavenPomFile: '$(Build.SourcesDirectory)/tools/ci_build/java/pom.xml' - # goals: 'dependency:copy-dependencies' - # options: '-DoutputDirectory=$(Pipeline.Workspace)/build/onnxruntime-java' - # publishJUnitTestResults: false - # javaHomeOption: 'Path' - # jdkDirectory: '/usr/lib/jvm/msopenjdk-17-amd64' - # jdkVersionOption: 'Default' - # mavenVersionOption: 'Default' - - # # Now all the jars are in the $(Pipeline.Workspace)/build folder - - # - template: templates/get-docker-image-steps.yml - # parameters: - # Dockerfile: tools/ci_build/github/linux/docker/Dockerfile.package_ubi8_cuda_tensorrt10_0 - # Context: tools/ci_build/github/linux/docker/ - # DockerBuildArgs: "--build-arg BUILD_UID=$( id -u ) --build-arg BASEIMAGE=${{ variables.docker_base_image }} --build-arg TRT_VERSION=${{ variables.linux_trt_version }}" - # Repository: onnxruntimeubi8packagestest - - # - bash: | - # docker run --network=none --rm \ - # --gpus all \ - # --volume $(Build.SourcesDirectory):/onnxruntime_src \ - # --volume $(Pipeline.Workspace)/build:/build \ - # --volume /data/models:/build/models:ro \ - # onnxruntimeubi8packagestest \ - # /bin/bash /onnxruntime_src/tools/ci_build/github/linux/java_linux_final_test.sh -r /build -v $(OnnxRuntimeVersion) - # displayName: 'Test' + stages: + - template: templates/final-jar-testing-win.yml + parameters: + PoolName: 'onnxruntime-Win-CPU-VS2022-Latest' + + - template: templates/final-jar-testing-linux.yml + parameters: + OS: Linux + PoolName: 'onnxruntime-Ubuntu2204-AMD-CPU' + + # - template: templates/final-jar-testing-linux.yml + # parameters: + # OS: MacOS + # PoolName: 'AcesShared' + # PoolDemands: 'ImageOverride -equals ACES_VM_SharedPool_Sequoia' + + # - stage: GPU_JAR_Testing + # dependsOn: [] + # jobs: + # - job: Final_Jar_Testing_Windows_GPU + # workspace: + # clean: all + # pool: 'onnxruntime-Win2022-GPU-A10' + # timeoutInMinutes: 60 + # variables: + # - name: runCodesignValidationInjection + # value: false + + # steps: + # - template: templates/set-version-number-variables-step.yml + + # - template: templates/jobs/download_win_gpu_library.yml + # parameters: + # CudaVersion: 12.8 + # DownloadCUDA: true + # DownloadTRT: true + + # - template: templates/setup-maven.yml + + # - task: Maven@4 + # displayName: 'Download Java Dependencies' + # inputs: + # mavenPomFile: '$(Build.SourcesDirectory)/tools/ci_build/java/pom.xml' + # goals: 'dependency:copy-dependencies' + # options: '-DoutputDirectory=$(Pipeline.Workspace)/build/onnxruntime-java' + # publishJUnitTestResults: false + # javaHomeOption: 'JDKVersion' + # jdkVersionOption: '1.17' + # mavenVersionOption: 'Default' + # - download: build + # artifact: 'onnxruntime-java-gpu' + # displayName: 'Download Final Jar' + # - script: | + # move $(Pipeline.Workspace)\build\onnxruntime-java-gpu\*.jar $(Pipeline.Workspace)\build\onnxruntime-java\ + + # - task: PowerShell@2 + # displayName: 'Run Java Tests with PowerShell' + # inputs: + # targetType: 'inline' + # script: | + # # Exit script on any error + # $ErrorActionPreference = "Stop" + + # cd $(Pipeline.Workspace)/build/onnxruntime-java + # del *.asc + # del *.sha256 + # del *.sha512 + # del *.pom + # del *.sha1 + # del *.pom + # cd .. + # mkdir tests + # cd tests + # jar xf $(Pipeline.Workspace)/build/onnxruntime-java/testing.jar + # del $(Pipeline.Workspace)/build/onnxruntime-java/testing.jar + # dir $(Pipeline.Workspace)/build/tests + # Write-Host "Running JUnit Tests..." + # & java -DUSE_CUDA=1 ` + # -cp "$(Pipeline.Workspace)\build\tests;$(Pipeline.Workspace)\build\onnxruntime-java\*" org.junit.platform.console.ConsoleLauncher --scan-classpath=$(Pipeline.Workspace)\build\tests ` + # --fail-if-no-tests --disable-banner --reports-dir "$($env:Build_ArtifactStagingDirectory)/TestResults" + + # - task: PublishTestResults@2 + # displayName: 'Publish Test Results' + # inputs: + # testResultsFormat: 'JUnit' + # testResultsFiles: '$(Build.ArtifactStagingDirectory)/TestResults/TEST-junit-jupiter.xml' + # failTaskOnFailedTests: true + + + # - job: Final_Jar_Testing_Linux_GPU + # workspace: + # clean: all + # pool: + # name: 'Onnxruntime-Linux-GPU-A10' + # variables: + # - name: runCodesignValidationInjection + # value: false + # - name: docker_base_image + # value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_almalinux8_gcc14:20251017.1 + # timeoutInMinutes: 60 + # steps: + # - checkout: self + # submodules: false + + # - template: templates/set-version-number-variables-step.yml + + # - bash: | + # sudo apt-get install -y msopenjdk-17 + # dpkg -l msopenjdk-17 + + # - bash: | + # echo "Downloading and installing Maven $(mavenVersion) for Linux..." + # MAVEN_DIR="$(Agent.TempDirectory)/apache-maven-$(mavenVersion)" + # # Download Maven binary + # wget https://archive.apache.org/dist/maven/maven-3/$(mavenVersion)/binaries/apache-maven-$(mavenVersion)-bin.tar.gz -O $(Agent.TempDirectory)/maven.tar.gz + + # # Extract to the temp directory + # mkdir -p ${MAVEN_DIR} + # tar -xzf $(Agent.TempDirectory)/maven.tar.gz -C $(Agent.TempDirectory) + + # # Add Maven's bin directory to the PATH for subsequent tasks in the job + # echo "##vso[task.prependpath]${MAVEN_DIR}/bin" + # displayName: 'Install Maven (Linux)' + + # - script: | + # echo "Maven is now on the PATH." + # mvn --version + + # - download: build + # artifact: 'onnxruntime-java-gpu' + # displayName: 'Download Final Jar' + + # # Rename the downloaded folder + # - script: | + # mv $(Pipeline.Workspace)/build/onnxruntime-java-gpu $(Pipeline.Workspace)/build/onnxruntime-java + + # - task: Maven@4 + # displayName: 'Download Dependencies' + # inputs: + # mavenPomFile: '$(Build.SourcesDirectory)/tools/ci_build/java/pom.xml' + # goals: 'dependency:copy-dependencies' + # options: '-DoutputDirectory=$(Pipeline.Workspace)/build/onnxruntime-java' + # publishJUnitTestResults: false + # javaHomeOption: 'Path' + # jdkDirectory: '/usr/lib/jvm/msopenjdk-17-amd64' + # jdkVersionOption: 'Default' + # mavenVersionOption: 'Default' + + # # Now all the jars are in the $(Pipeline.Workspace)/build folder + + # - template: templates/get-docker-image-steps.yml + # parameters: + # Dockerfile: tools/ci_build/github/linux/docker/Dockerfile.package_ubi8_cuda_tensorrt10_0 + # Context: tools/ci_build/github/linux/docker/ + # DockerBuildArgs: "--build-arg BUILD_UID=$( id -u ) --build-arg BASEIMAGE=${{ variables.docker_base_image }} --build-arg TRT_VERSION=${{ variables.linux_trt_version }}" + # Repository: onnxruntimeubi8packagestest + + # - bash: | + # docker run --network=none --rm \ + # --gpus all \ + # --volume $(Build.SourcesDirectory):/onnxruntime_src \ + # --volume $(Pipeline.Workspace)/build:/build \ + # --volume /data/models:/build/models:ro \ + # onnxruntimeubi8packagestest \ + # /bin/bash /onnxruntime_src/tools/ci_build/github/linux/java_linux_final_test.sh -r /build -v $(OnnxRuntimeVersion) + # displayName: 'Test' From 91542102aa0e36d0ca4ff0b58920d9fdf7e488a9 Mon Sep 17 00:00:00 2001 From: Erik Date: Fri, 27 Feb 2026 09:40:43 -0500 Subject: [PATCH 04/14] . --- .../templates/final-jar-testing-linux.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/templates/final-jar-testing-linux.yml b/tools/ci_build/github/azure-pipelines/templates/final-jar-testing-linux.yml index 738ac27bafde2..bbb664a2de602 100644 --- a/tools/ci_build/github/azure-pipelines/templates/final-jar-testing-linux.yml +++ b/tools/ci_build/github/azure-pipelines/templates/final-jar-testing-linux.yml @@ -4,6 +4,10 @@ parameters: - name: OS displayName: Operating System type: string + values: + - linux + - macOS + - windows - name: PoolName type: string @@ -17,10 +21,13 @@ stages: dependsOn: [] jobs: - job: Final_Jar_Testing_${{parameters.OS}} + templateContext: + type: validationJob workspace: clean: all - ${{ if eq(parameters.OS, 'MacOS') }}: + ${{ if eq(parameters.OS, 'macOS') }}: pool: + os: macOS # Use PoolName if provided, otherwise fallback to macOS-15 ${{ if ne(parameters.PoolName, '') }}: ${{ if contains(parameters.PoolName, '-') }}: @@ -31,8 +38,9 @@ stages: demands: ${{ parameters.PoolDemands }} ${{ else }}: vmImage: 'macOS-15' - ${{ if eq(parameters.OS, 'Linux') }}: + ${{ if eq(parameters.OS, 'linux') }}: pool: + os: linux name: ${{ parameters.PoolName }} variables: - name: runCodesignValidationInjection @@ -89,10 +97,10 @@ stages: options: '-DoutputDirectory=$(Pipeline.Workspace)/build/onnxruntime-java' publishJUnitTestResults: false mavenVersionOption: 'Default' - ${{ if eq(parameters.OS, 'MacOS') }}: + ${{ if eq(parameters.OS, 'macOS') }}: javaHomeOption: 'Path' jdkDirectory: '$(JAVA_HOME)' - ${{ if eq(parameters.OS, 'Linux') }}: + ${{ if eq(parameters.OS, 'linux') }}: javaHomeOption: 'JDKVersion' jdkVersionOption: '1.17' From b2223475b8c37e7dc0336b2e92c4d9d897aec9b9 Mon Sep 17 00:00:00 2001 From: Erik Date: Fri, 27 Feb 2026 09:41:12 -0500 Subject: [PATCH 05/14] Update --- .../github/azure-pipelines/jar_package_testing.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/jar_package_testing.yml b/tools/ci_build/github/azure-pipelines/jar_package_testing.yml index be01d06722507..bbe1fe0df8ecf 100644 --- a/tools/ci_build/github/azure-pipelines/jar_package_testing.yml +++ b/tools/ci_build/github/azure-pipelines/jar_package_testing.yml @@ -53,14 +53,14 @@ extends: - template: templates/final-jar-testing-linux.yml parameters: - OS: Linux + OS: linux PoolName: 'onnxruntime-Ubuntu2204-AMD-CPU' - # - template: templates/final-jar-testing-linux.yml - # parameters: - # OS: MacOS - # PoolName: 'AcesShared' - # PoolDemands: 'ImageOverride -equals ACES_VM_SharedPool_Sequoia' + - template: templates/final-jar-testing-linux.yml + parameters: + OS: macOS + PoolName: 'AcesShared' + PoolDemands: 'ImageOverride -equals ACES_VM_SharedPool_Sequoia' # - stage: GPU_JAR_Testing # dependsOn: [] From 1626c8558e200dfa71e7e184b868ef4b4e631390 Mon Sep 17 00:00:00 2001 From: Erik Date: Fri, 27 Feb 2026 09:48:13 -0500 Subject: [PATCH 06/14] All of them now --- .../azure-pipelines/jar_package_testing.yml | 307 +++++++++--------- 1 file changed, 157 insertions(+), 150 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/jar_package_testing.yml b/tools/ci_build/github/azure-pipelines/jar_package_testing.yml index bbe1fe0df8ecf..1a0a4ac25a172 100644 --- a/tools/ci_build/github/azure-pipelines/jar_package_testing.yml +++ b/tools/ci_build/github/azure-pipelines/jar_package_testing.yml @@ -62,153 +62,160 @@ extends: PoolName: 'AcesShared' PoolDemands: 'ImageOverride -equals ACES_VM_SharedPool_Sequoia' - # - stage: GPU_JAR_Testing - # dependsOn: [] - # jobs: - # - job: Final_Jar_Testing_Windows_GPU - # workspace: - # clean: all - # pool: 'onnxruntime-Win2022-GPU-A10' - # timeoutInMinutes: 60 - # variables: - # - name: runCodesignValidationInjection - # value: false - - # steps: - # - template: templates/set-version-number-variables-step.yml - - # - template: templates/jobs/download_win_gpu_library.yml - # parameters: - # CudaVersion: 12.8 - # DownloadCUDA: true - # DownloadTRT: true - - # - template: templates/setup-maven.yml - - # - task: Maven@4 - # displayName: 'Download Java Dependencies' - # inputs: - # mavenPomFile: '$(Build.SourcesDirectory)/tools/ci_build/java/pom.xml' - # goals: 'dependency:copy-dependencies' - # options: '-DoutputDirectory=$(Pipeline.Workspace)/build/onnxruntime-java' - # publishJUnitTestResults: false - # javaHomeOption: 'JDKVersion' - # jdkVersionOption: '1.17' - # mavenVersionOption: 'Default' - # - download: build - # artifact: 'onnxruntime-java-gpu' - # displayName: 'Download Final Jar' - # - script: | - # move $(Pipeline.Workspace)\build\onnxruntime-java-gpu\*.jar $(Pipeline.Workspace)\build\onnxruntime-java\ - - # - task: PowerShell@2 - # displayName: 'Run Java Tests with PowerShell' - # inputs: - # targetType: 'inline' - # script: | - # # Exit script on any error - # $ErrorActionPreference = "Stop" - - # cd $(Pipeline.Workspace)/build/onnxruntime-java - # del *.asc - # del *.sha256 - # del *.sha512 - # del *.pom - # del *.sha1 - # del *.pom - # cd .. - # mkdir tests - # cd tests - # jar xf $(Pipeline.Workspace)/build/onnxruntime-java/testing.jar - # del $(Pipeline.Workspace)/build/onnxruntime-java/testing.jar - # dir $(Pipeline.Workspace)/build/tests - # Write-Host "Running JUnit Tests..." - # & java -DUSE_CUDA=1 ` - # -cp "$(Pipeline.Workspace)\build\tests;$(Pipeline.Workspace)\build\onnxruntime-java\*" org.junit.platform.console.ConsoleLauncher --scan-classpath=$(Pipeline.Workspace)\build\tests ` - # --fail-if-no-tests --disable-banner --reports-dir "$($env:Build_ArtifactStagingDirectory)/TestResults" - - # - task: PublishTestResults@2 - # displayName: 'Publish Test Results' - # inputs: - # testResultsFormat: 'JUnit' - # testResultsFiles: '$(Build.ArtifactStagingDirectory)/TestResults/TEST-junit-jupiter.xml' - # failTaskOnFailedTests: true - - - # - job: Final_Jar_Testing_Linux_GPU - # workspace: - # clean: all - # pool: - # name: 'Onnxruntime-Linux-GPU-A10' - # variables: - # - name: runCodesignValidationInjection - # value: false - # - name: docker_base_image - # value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_almalinux8_gcc14:20251017.1 - # timeoutInMinutes: 60 - # steps: - # - checkout: self - # submodules: false - - # - template: templates/set-version-number-variables-step.yml - - # - bash: | - # sudo apt-get install -y msopenjdk-17 - # dpkg -l msopenjdk-17 - - # - bash: | - # echo "Downloading and installing Maven $(mavenVersion) for Linux..." - # MAVEN_DIR="$(Agent.TempDirectory)/apache-maven-$(mavenVersion)" - # # Download Maven binary - # wget https://archive.apache.org/dist/maven/maven-3/$(mavenVersion)/binaries/apache-maven-$(mavenVersion)-bin.tar.gz -O $(Agent.TempDirectory)/maven.tar.gz - - # # Extract to the temp directory - # mkdir -p ${MAVEN_DIR} - # tar -xzf $(Agent.TempDirectory)/maven.tar.gz -C $(Agent.TempDirectory) - - # # Add Maven's bin directory to the PATH for subsequent tasks in the job - # echo "##vso[task.prependpath]${MAVEN_DIR}/bin" - # displayName: 'Install Maven (Linux)' - - # - script: | - # echo "Maven is now on the PATH." - # mvn --version - - # - download: build - # artifact: 'onnxruntime-java-gpu' - # displayName: 'Download Final Jar' - - # # Rename the downloaded folder - # - script: | - # mv $(Pipeline.Workspace)/build/onnxruntime-java-gpu $(Pipeline.Workspace)/build/onnxruntime-java - - # - task: Maven@4 - # displayName: 'Download Dependencies' - # inputs: - # mavenPomFile: '$(Build.SourcesDirectory)/tools/ci_build/java/pom.xml' - # goals: 'dependency:copy-dependencies' - # options: '-DoutputDirectory=$(Pipeline.Workspace)/build/onnxruntime-java' - # publishJUnitTestResults: false - # javaHomeOption: 'Path' - # jdkDirectory: '/usr/lib/jvm/msopenjdk-17-amd64' - # jdkVersionOption: 'Default' - # mavenVersionOption: 'Default' - - # # Now all the jars are in the $(Pipeline.Workspace)/build folder - - # - template: templates/get-docker-image-steps.yml - # parameters: - # Dockerfile: tools/ci_build/github/linux/docker/Dockerfile.package_ubi8_cuda_tensorrt10_0 - # Context: tools/ci_build/github/linux/docker/ - # DockerBuildArgs: "--build-arg BUILD_UID=$( id -u ) --build-arg BASEIMAGE=${{ variables.docker_base_image }} --build-arg TRT_VERSION=${{ variables.linux_trt_version }}" - # Repository: onnxruntimeubi8packagestest - - # - bash: | - # docker run --network=none --rm \ - # --gpus all \ - # --volume $(Build.SourcesDirectory):/onnxruntime_src \ - # --volume $(Pipeline.Workspace)/build:/build \ - # --volume /data/models:/build/models:ro \ - # onnxruntimeubi8packagestest \ - # /bin/bash /onnxruntime_src/tools/ci_build/github/linux/java_linux_final_test.sh -r /build -v $(OnnxRuntimeVersion) - # displayName: 'Test' + - stage: GPU_JAR_Testing + dependsOn: [] + jobs: + - job: Final_Jar_Testing_Windows_GPU + templateContext: + type: validationJob + workspace: + clean: all + pool: + name: 'onnxruntime-Win2022-GPU-A10' + os: windows + timeoutInMinutes: 60 + variables: + - name: runCodesignValidationInjection + value: false + + steps: + - template: templates/set-version-number-variables-step.yml + + - template: templates/jobs/download_win_gpu_library.yml + parameters: + CudaVersion: 12.8 + DownloadCUDA: true + DownloadTRT: true + + - template: templates/setup-maven.yml + + - task: Maven@4 + displayName: 'Download Java Dependencies' + inputs: + mavenPomFile: '$(Build.SourcesDirectory)/tools/ci_build/java/pom.xml' + goals: 'dependency:copy-dependencies' + options: '-DoutputDirectory=$(Pipeline.Workspace)/build/onnxruntime-java' + publishJUnitTestResults: false + javaHomeOption: 'JDKVersion' + jdkVersionOption: '1.17' + mavenVersionOption: 'Default' + - download: build + artifact: 'onnxruntime-java-gpu' + displayName: 'Download Final Jar' + - script: | + move $(Pipeline.Workspace)\build\onnxruntime-java-gpu\*.jar $(Pipeline.Workspace)\build\onnxruntime-java\ + + - task: PowerShell@2 + displayName: 'Run Java Tests with PowerShell' + inputs: + targetType: 'inline' + script: | + # Exit script on any error + $ErrorActionPreference = "Stop" + + cd $(Pipeline.Workspace)/build/onnxruntime-java + del *.asc + del *.sha256 + del *.sha512 + del *.pom + del *.sha1 + del *.pom + cd .. + mkdir tests + cd tests + jar xf $(Pipeline.Workspace)/build/onnxruntime-java/testing.jar + del $(Pipeline.Workspace)/build/onnxruntime-java/testing.jar + dir $(Pipeline.Workspace)/build/tests + Write-Host "Running JUnit Tests..." + & java -DUSE_CUDA=1 ` + -cp "$(Pipeline.Workspace)\build\tests;$(Pipeline.Workspace)\build\onnxruntime-java\*" org.junit.platform.console.ConsoleLauncher --scan-classpath=$(Pipeline.Workspace)\build\tests ` + --fail-if-no-tests --disable-banner --reports-dir "$($env:Build_ArtifactStagingDirectory)/TestResults" + + - task: PublishTestResults@2 + displayName: 'Publish Test Results' + inputs: + testResultsFormat: 'JUnit' + testResultsFiles: '$(Build.ArtifactStagingDirectory)/TestResults/TEST-junit-jupiter.xml' + failTaskOnFailedTests: true + + + - job: Final_Jar_Testing_Linux_GPU + templateContext: + type: validationJob + workspace: + clean: all + pool: + name: 'Onnxruntime-Linux-GPU-A10' + os: linux + variables: + - name: runCodesignValidationInjection + value: false + - name: docker_base_image + value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_almalinux8_gcc14:20251017.1 + timeoutInMinutes: 60 + steps: + - checkout: self + submodules: false + + - template: templates/set-version-number-variables-step.yml + + - bash: | + sudo apt-get install -y msopenjdk-17 + dpkg -l msopenjdk-17 + + - bash: | + echo "Downloading and installing Maven $(mavenVersion) for Linux..." + MAVEN_DIR="$(Agent.TempDirectory)/apache-maven-$(mavenVersion)" + # Download Maven binary + wget https://archive.apache.org/dist/maven/maven-3/$(mavenVersion)/binaries/apache-maven-$(mavenVersion)-bin.tar.gz -O $(Agent.TempDirectory)/maven.tar.gz + + # Extract to the temp directory + mkdir -p ${MAVEN_DIR} + tar -xzf $(Agent.TempDirectory)/maven.tar.gz -C $(Agent.TempDirectory) + + # Add Maven's bin directory to the PATH for subsequent tasks in the job + echo "##vso[task.prependpath]${MAVEN_DIR}/bin" + displayName: 'Install Maven (Linux)' + + - script: | + echo "Maven is now on the PATH." + mvn --version + + - download: build + artifact: 'onnxruntime-java-gpu' + displayName: 'Download Final Jar' + + # Rename the downloaded folder + - script: | + mv $(Pipeline.Workspace)/build/onnxruntime-java-gpu $(Pipeline.Workspace)/build/onnxruntime-java + + - task: Maven@4 + displayName: 'Download Dependencies' + inputs: + mavenPomFile: '$(Build.SourcesDirectory)/tools/ci_build/java/pom.xml' + goals: 'dependency:copy-dependencies' + options: '-DoutputDirectory=$(Pipeline.Workspace)/build/onnxruntime-java' + publishJUnitTestResults: false + javaHomeOption: 'Path' + jdkDirectory: '/usr/lib/jvm/msopenjdk-17-amd64' + jdkVersionOption: 'Default' + mavenVersionOption: 'Default' + + # Now all the jars are in the $(Pipeline.Workspace)/build folder + + - template: templates/get-docker-image-steps.yml + parameters: + Dockerfile: tools/ci_build/github/linux/docker/Dockerfile.package_ubi8_cuda_tensorrt10_0 + Context: tools/ci_build/github/linux/docker/ + DockerBuildArgs: "--build-arg BUILD_UID=$( id -u ) --build-arg BASEIMAGE=${{ variables.docker_base_image }} --build-arg TRT_VERSION=${{ variables.linux_trt_version }}" + Repository: onnxruntimeubi8packagestest + + - bash: | + docker run --network=none --rm \ + --gpus all \ + --volume $(Build.SourcesDirectory):/onnxruntime_src \ + --volume $(Pipeline.Workspace)/build:/build \ + --volume /data/models:/build/models:ro \ + onnxruntimeubi8packagestest \ + /bin/bash /onnxruntime_src/tools/ci_build/github/linux/java_linux_final_test.sh -r /build -v $(OnnxRuntimeVersion) + displayName: 'Test' From 028134d95148a0b9af2afcbfc666c35cd74bfa76 Mon Sep 17 00:00:00 2001 From: Erik Date: Fri, 27 Feb 2026 09:50:43 -0500 Subject: [PATCH 07/14] Update --- tools/ci_build/github/azure-pipelines/jar_package_testing.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/jar_package_testing.yml b/tools/ci_build/github/azure-pipelines/jar_package_testing.yml index 1a0a4ac25a172..2d65e0c42944f 100644 --- a/tools/ci_build/github/azure-pipelines/jar_package_testing.yml +++ b/tools/ci_build/github/azure-pipelines/jar_package_testing.yml @@ -160,8 +160,8 @@ extends: - template: templates/set-version-number-variables-step.yml - bash: | - sudo apt-get install -y msopenjdk-17 - dpkg -l msopenjdk-17 + sudo apt-get install -y msopenjdk-17 + dpkg -l msopenjdk-17 - bash: | echo "Downloading and installing Maven $(mavenVersion) for Linux..." From 87a8ae8f2af7b96963cf3323d689fef1bbfd096c Mon Sep 17 00:00:00 2001 From: Erik Date: Fri, 27 Feb 2026 10:01:11 -0500 Subject: [PATCH 08/14] Try to isolate problem --- .../azure-pipelines/jar_package_testing.yml | 160 +++++++++--------- 1 file changed, 80 insertions(+), 80 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/jar_package_testing.yml b/tools/ci_build/github/azure-pipelines/jar_package_testing.yml index 2d65e0c42944f..4b026e68ea3c4 100644 --- a/tools/ci_build/github/azure-pipelines/jar_package_testing.yml +++ b/tools/ci_build/github/azure-pipelines/jar_package_testing.yml @@ -139,83 +139,83 @@ extends: failTaskOnFailedTests: true - - job: Final_Jar_Testing_Linux_GPU - templateContext: - type: validationJob - workspace: - clean: all - pool: - name: 'Onnxruntime-Linux-GPU-A10' - os: linux - variables: - - name: runCodesignValidationInjection - value: false - - name: docker_base_image - value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_almalinux8_gcc14:20251017.1 - timeoutInMinutes: 60 - steps: - - checkout: self - submodules: false - - - template: templates/set-version-number-variables-step.yml - - - bash: | - sudo apt-get install -y msopenjdk-17 - dpkg -l msopenjdk-17 - - - bash: | - echo "Downloading and installing Maven $(mavenVersion) for Linux..." - MAVEN_DIR="$(Agent.TempDirectory)/apache-maven-$(mavenVersion)" - # Download Maven binary - wget https://archive.apache.org/dist/maven/maven-3/$(mavenVersion)/binaries/apache-maven-$(mavenVersion)-bin.tar.gz -O $(Agent.TempDirectory)/maven.tar.gz - - # Extract to the temp directory - mkdir -p ${MAVEN_DIR} - tar -xzf $(Agent.TempDirectory)/maven.tar.gz -C $(Agent.TempDirectory) - - # Add Maven's bin directory to the PATH for subsequent tasks in the job - echo "##vso[task.prependpath]${MAVEN_DIR}/bin" - displayName: 'Install Maven (Linux)' - - - script: | - echo "Maven is now on the PATH." - mvn --version - - - download: build - artifact: 'onnxruntime-java-gpu' - displayName: 'Download Final Jar' - - # Rename the downloaded folder - - script: | - mv $(Pipeline.Workspace)/build/onnxruntime-java-gpu $(Pipeline.Workspace)/build/onnxruntime-java - - - task: Maven@4 - displayName: 'Download Dependencies' - inputs: - mavenPomFile: '$(Build.SourcesDirectory)/tools/ci_build/java/pom.xml' - goals: 'dependency:copy-dependencies' - options: '-DoutputDirectory=$(Pipeline.Workspace)/build/onnxruntime-java' - publishJUnitTestResults: false - javaHomeOption: 'Path' - jdkDirectory: '/usr/lib/jvm/msopenjdk-17-amd64' - jdkVersionOption: 'Default' - mavenVersionOption: 'Default' - - # Now all the jars are in the $(Pipeline.Workspace)/build folder - - - template: templates/get-docker-image-steps.yml - parameters: - Dockerfile: tools/ci_build/github/linux/docker/Dockerfile.package_ubi8_cuda_tensorrt10_0 - Context: tools/ci_build/github/linux/docker/ - DockerBuildArgs: "--build-arg BUILD_UID=$( id -u ) --build-arg BASEIMAGE=${{ variables.docker_base_image }} --build-arg TRT_VERSION=${{ variables.linux_trt_version }}" - Repository: onnxruntimeubi8packagestest - - - bash: | - docker run --network=none --rm \ - --gpus all \ - --volume $(Build.SourcesDirectory):/onnxruntime_src \ - --volume $(Pipeline.Workspace)/build:/build \ - --volume /data/models:/build/models:ro \ - onnxruntimeubi8packagestest \ - /bin/bash /onnxruntime_src/tools/ci_build/github/linux/java_linux_final_test.sh -r /build -v $(OnnxRuntimeVersion) - displayName: 'Test' + # - job: Final_Jar_Testing_Linux_GPU + # templateContext: + # type: validationJob + # workspace: + # clean: all + # pool: + # name: 'Onnxruntime-Linux-GPU-A10' + # os: linux + # variables: + # - name: runCodesignValidationInjection + # value: false + # - name: docker_base_image + # value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_almalinux8_gcc14:20251017.1 + # timeoutInMinutes: 60 + # steps: + # - checkout: self + # submodules: false + + # - template: templates/set-version-number-variables-step.yml + + # - bash: | + # sudo apt-get install -y msopenjdk-17 + # dpkg -l msopenjdk-17 + + # - bash: | + # echo "Downloading and installing Maven $(mavenVersion) for Linux..." + # MAVEN_DIR="$(Agent.TempDirectory)/apache-maven-$(mavenVersion)" + # # Download Maven binary + # wget https://archive.apache.org/dist/maven/maven-3/$(mavenVersion)/binaries/apache-maven-$(mavenVersion)-bin.tar.gz -O $(Agent.TempDirectory)/maven.tar.gz + + # # Extract to the temp directory + # mkdir -p ${MAVEN_DIR} + # tar -xzf $(Agent.TempDirectory)/maven.tar.gz -C $(Agent.TempDirectory) + + # # Add Maven's bin directory to the PATH for subsequent tasks in the job + # echo "##vso[task.prependpath]${MAVEN_DIR}/bin" + # displayName: 'Install Maven (Linux)' + + # - script: | + # echo "Maven is now on the PATH." + # mvn --version + + # - download: build + # artifact: 'onnxruntime-java-gpu' + # displayName: 'Download Final Jar' + + # # Rename the downloaded folder + # - script: | + # mv $(Pipeline.Workspace)/build/onnxruntime-java-gpu $(Pipeline.Workspace)/build/onnxruntime-java + + # - task: Maven@4 + # displayName: 'Download Dependencies' + # inputs: + # mavenPomFile: '$(Build.SourcesDirectory)/tools/ci_build/java/pom.xml' + # goals: 'dependency:copy-dependencies' + # options: '-DoutputDirectory=$(Pipeline.Workspace)/build/onnxruntime-java' + # publishJUnitTestResults: false + # javaHomeOption: 'Path' + # jdkDirectory: '/usr/lib/jvm/msopenjdk-17-amd64' + # jdkVersionOption: 'Default' + # mavenVersionOption: 'Default' + + # # Now all the jars are in the $(Pipeline.Workspace)/build folder + + # - template: templates/get-docker-image-steps.yml + # parameters: + # Dockerfile: tools/ci_build/github/linux/docker/Dockerfile.package_ubi8_cuda_tensorrt10_0 + # Context: tools/ci_build/github/linux/docker/ + # DockerBuildArgs: "--build-arg BUILD_UID=$( id -u ) --build-arg BASEIMAGE=${{ variables.docker_base_image }} --build-arg TRT_VERSION=${{ variables.linux_trt_version }}" + # Repository: onnxruntimeubi8packagestest + + # - bash: | + # docker run --network=none --rm \ + # --gpus all \ + # --volume $(Build.SourcesDirectory):/onnxruntime_src \ + # --volume $(Pipeline.Workspace)/build:/build \ + # --volume /data/models:/build/models:ro \ + # onnxruntimeubi8packagestest \ + # /bin/bash /onnxruntime_src/tools/ci_build/github/linux/java_linux_final_test.sh -r /build -v $(OnnxRuntimeVersion) + # displayName: 'Test' From 890223038f9d8694931b558b9639a22554faa0bf Mon Sep 17 00:00:00 2001 From: Erik Date: Fri, 27 Feb 2026 10:02:01 -0500 Subject: [PATCH 09/14] pathing --- .../ci_build/github/azure-pipelines/jar_package_testing.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/jar_package_testing.yml b/tools/ci_build/github/azure-pipelines/jar_package_testing.yml index 4b026e68ea3c4..3d11a41382e57 100644 --- a/tools/ci_build/github/azure-pipelines/jar_package_testing.yml +++ b/tools/ci_build/github/azure-pipelines/jar_package_testing.yml @@ -79,15 +79,15 @@ extends: value: false steps: - - template: templates/set-version-number-variables-step.yml + - template: ./templates/set-version-number-variables-step.yml - - template: templates/jobs/download_win_gpu_library.yml + - template: ./templates/jobs/download_win_gpu_library.yml parameters: CudaVersion: 12.8 DownloadCUDA: true DownloadTRT: true - - template: templates/setup-maven.yml + - template: ./templates/setup-maven.yml - task: Maven@4 displayName: 'Download Java Dependencies' From 1d6498fb9ebf66a070cceb185c51b1ab75f2d5c1 Mon Sep 17 00:00:00 2001 From: Erik Date: Fri, 27 Feb 2026 10:02:17 -0500 Subject: [PATCH 10/14] pathing --- .../ci_build/github/azure-pipelines/jar_package_testing.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/jar_package_testing.yml b/tools/ci_build/github/azure-pipelines/jar_package_testing.yml index 3d11a41382e57..25c44b308d6d2 100644 --- a/tools/ci_build/github/azure-pipelines/jar_package_testing.yml +++ b/tools/ci_build/github/azure-pipelines/jar_package_testing.yml @@ -79,15 +79,15 @@ extends: value: false steps: - - template: ./templates/set-version-number-variables-step.yml + - template: templates/set-version-number-variables-step.yml@self - - template: ./templates/jobs/download_win_gpu_library.yml + - template: templates/jobs/download_win_gpu_library.yml@self parameters: CudaVersion: 12.8 DownloadCUDA: true DownloadTRT: true - - template: ./templates/setup-maven.yml + - template: templates/setup-maven.yml@self - task: Maven@4 displayName: 'Download Java Dependencies' From 7e7f00915f75d2126880faf0f59a8e084bc5b098 Mon Sep 17 00:00:00 2001 From: Erik Date: Fri, 27 Feb 2026 10:02:48 -0500 Subject: [PATCH 11/14] pathing --- .../ci_build/github/azure-pipelines/jar_package_testing.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/jar_package_testing.yml b/tools/ci_build/github/azure-pipelines/jar_package_testing.yml index 25c44b308d6d2..3d11a41382e57 100644 --- a/tools/ci_build/github/azure-pipelines/jar_package_testing.yml +++ b/tools/ci_build/github/azure-pipelines/jar_package_testing.yml @@ -79,15 +79,15 @@ extends: value: false steps: - - template: templates/set-version-number-variables-step.yml@self + - template: ./templates/set-version-number-variables-step.yml - - template: templates/jobs/download_win_gpu_library.yml@self + - template: ./templates/jobs/download_win_gpu_library.yml parameters: CudaVersion: 12.8 DownloadCUDA: true DownloadTRT: true - - template: templates/setup-maven.yml@self + - template: ./templates/setup-maven.yml - task: Maven@4 displayName: 'Download Java Dependencies' From ebe53794f8fa800ceafffebebcde5c036bc2d1f4 Mon Sep 17 00:00:00 2001 From: Erik Date: Fri, 27 Feb 2026 10:05:41 -0500 Subject: [PATCH 12/14] Jar testing --- .../azure-pipelines/jar_package_testing.yml | 158 +----------------- .../templates/final-jar-testing-gpu.yml | 158 ++++++++++++++++++ 2 files changed, 159 insertions(+), 157 deletions(-) create mode 100644 tools/ci_build/github/azure-pipelines/templates/final-jar-testing-gpu.yml diff --git a/tools/ci_build/github/azure-pipelines/jar_package_testing.yml b/tools/ci_build/github/azure-pipelines/jar_package_testing.yml index 3d11a41382e57..8fcde9e88edd7 100644 --- a/tools/ci_build/github/azure-pipelines/jar_package_testing.yml +++ b/tools/ci_build/github/azure-pipelines/jar_package_testing.yml @@ -62,160 +62,4 @@ extends: PoolName: 'AcesShared' PoolDemands: 'ImageOverride -equals ACES_VM_SharedPool_Sequoia' - - stage: GPU_JAR_Testing - dependsOn: [] - jobs: - - job: Final_Jar_Testing_Windows_GPU - templateContext: - type: validationJob - workspace: - clean: all - pool: - name: 'onnxruntime-Win2022-GPU-A10' - os: windows - timeoutInMinutes: 60 - variables: - - name: runCodesignValidationInjection - value: false - - steps: - - template: ./templates/set-version-number-variables-step.yml - - - template: ./templates/jobs/download_win_gpu_library.yml - parameters: - CudaVersion: 12.8 - DownloadCUDA: true - DownloadTRT: true - - - template: ./templates/setup-maven.yml - - - task: Maven@4 - displayName: 'Download Java Dependencies' - inputs: - mavenPomFile: '$(Build.SourcesDirectory)/tools/ci_build/java/pom.xml' - goals: 'dependency:copy-dependencies' - options: '-DoutputDirectory=$(Pipeline.Workspace)/build/onnxruntime-java' - publishJUnitTestResults: false - javaHomeOption: 'JDKVersion' - jdkVersionOption: '1.17' - mavenVersionOption: 'Default' - - download: build - artifact: 'onnxruntime-java-gpu' - displayName: 'Download Final Jar' - - script: | - move $(Pipeline.Workspace)\build\onnxruntime-java-gpu\*.jar $(Pipeline.Workspace)\build\onnxruntime-java\ - - - task: PowerShell@2 - displayName: 'Run Java Tests with PowerShell' - inputs: - targetType: 'inline' - script: | - # Exit script on any error - $ErrorActionPreference = "Stop" - - cd $(Pipeline.Workspace)/build/onnxruntime-java - del *.asc - del *.sha256 - del *.sha512 - del *.pom - del *.sha1 - del *.pom - cd .. - mkdir tests - cd tests - jar xf $(Pipeline.Workspace)/build/onnxruntime-java/testing.jar - del $(Pipeline.Workspace)/build/onnxruntime-java/testing.jar - dir $(Pipeline.Workspace)/build/tests - Write-Host "Running JUnit Tests..." - & java -DUSE_CUDA=1 ` - -cp "$(Pipeline.Workspace)\build\tests;$(Pipeline.Workspace)\build\onnxruntime-java\*" org.junit.platform.console.ConsoleLauncher --scan-classpath=$(Pipeline.Workspace)\build\tests ` - --fail-if-no-tests --disable-banner --reports-dir "$($env:Build_ArtifactStagingDirectory)/TestResults" - - - task: PublishTestResults@2 - displayName: 'Publish Test Results' - inputs: - testResultsFormat: 'JUnit' - testResultsFiles: '$(Build.ArtifactStagingDirectory)/TestResults/TEST-junit-jupiter.xml' - failTaskOnFailedTests: true - - - # - job: Final_Jar_Testing_Linux_GPU - # templateContext: - # type: validationJob - # workspace: - # clean: all - # pool: - # name: 'Onnxruntime-Linux-GPU-A10' - # os: linux - # variables: - # - name: runCodesignValidationInjection - # value: false - # - name: docker_base_image - # value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_almalinux8_gcc14:20251017.1 - # timeoutInMinutes: 60 - # steps: - # - checkout: self - # submodules: false - - # - template: templates/set-version-number-variables-step.yml - - # - bash: | - # sudo apt-get install -y msopenjdk-17 - # dpkg -l msopenjdk-17 - - # - bash: | - # echo "Downloading and installing Maven $(mavenVersion) for Linux..." - # MAVEN_DIR="$(Agent.TempDirectory)/apache-maven-$(mavenVersion)" - # # Download Maven binary - # wget https://archive.apache.org/dist/maven/maven-3/$(mavenVersion)/binaries/apache-maven-$(mavenVersion)-bin.tar.gz -O $(Agent.TempDirectory)/maven.tar.gz - - # # Extract to the temp directory - # mkdir -p ${MAVEN_DIR} - # tar -xzf $(Agent.TempDirectory)/maven.tar.gz -C $(Agent.TempDirectory) - - # # Add Maven's bin directory to the PATH for subsequent tasks in the job - # echo "##vso[task.prependpath]${MAVEN_DIR}/bin" - # displayName: 'Install Maven (Linux)' - - # - script: | - # echo "Maven is now on the PATH." - # mvn --version - - # - download: build - # artifact: 'onnxruntime-java-gpu' - # displayName: 'Download Final Jar' - - # # Rename the downloaded folder - # - script: | - # mv $(Pipeline.Workspace)/build/onnxruntime-java-gpu $(Pipeline.Workspace)/build/onnxruntime-java - - # - task: Maven@4 - # displayName: 'Download Dependencies' - # inputs: - # mavenPomFile: '$(Build.SourcesDirectory)/tools/ci_build/java/pom.xml' - # goals: 'dependency:copy-dependencies' - # options: '-DoutputDirectory=$(Pipeline.Workspace)/build/onnxruntime-java' - # publishJUnitTestResults: false - # javaHomeOption: 'Path' - # jdkDirectory: '/usr/lib/jvm/msopenjdk-17-amd64' - # jdkVersionOption: 'Default' - # mavenVersionOption: 'Default' - - # # Now all the jars are in the $(Pipeline.Workspace)/build folder - - # - template: templates/get-docker-image-steps.yml - # parameters: - # Dockerfile: tools/ci_build/github/linux/docker/Dockerfile.package_ubi8_cuda_tensorrt10_0 - # Context: tools/ci_build/github/linux/docker/ - # DockerBuildArgs: "--build-arg BUILD_UID=$( id -u ) --build-arg BASEIMAGE=${{ variables.docker_base_image }} --build-arg TRT_VERSION=${{ variables.linux_trt_version }}" - # Repository: onnxruntimeubi8packagestest - - # - bash: | - # docker run --network=none --rm \ - # --gpus all \ - # --volume $(Build.SourcesDirectory):/onnxruntime_src \ - # --volume $(Pipeline.Workspace)/build:/build \ - # --volume /data/models:/build/models:ro \ - # onnxruntimeubi8packagestest \ - # /bin/bash /onnxruntime_src/tools/ci_build/github/linux/java_linux_final_test.sh -r /build -v $(OnnxRuntimeVersion) - # displayName: 'Test' + - template: templates/final-jar-testing-gpu.yml diff --git a/tools/ci_build/github/azure-pipelines/templates/final-jar-testing-gpu.yml b/tools/ci_build/github/azure-pipelines/templates/final-jar-testing-gpu.yml new file mode 100644 index 0000000000000..73c3bb361ce82 --- /dev/null +++ b/tools/ci_build/github/azure-pipelines/templates/final-jar-testing-gpu.yml @@ -0,0 +1,158 @@ +stages: + - stage: GPU_JAR_Testing + dependsOn: [] + jobs: + - job: Final_Jar_Testing_Windows_GPU + templateContext: + type: validationJob + workspace: + clean: all + pool: + name: 'onnxruntime-Win2022-GPU-A10' + os: windows + timeoutInMinutes: 60 + variables: + - name: runCodesignValidationInjection + value: false + + steps: + - template: set-version-number-variables-step.yml + + - template: jobs/download_win_gpu_library.yml + parameters: + CudaVersion: 12.8 + DownloadCUDA: true + DownloadTRT: true + + - template: setup-maven.yml + + - task: Maven@4 + displayName: 'Download Java Dependencies' + inputs: + mavenPomFile: '$(Build.SourcesDirectory)/tools/ci_build/java/pom.xml' + goals: 'dependency:copy-dependencies' + options: '-DoutputDirectory=$(Pipeline.Workspace)/build/onnxruntime-java' + publishJUnitTestResults: false + javaHomeOption: 'JDKVersion' + jdkVersionOption: '1.17' + mavenVersionOption: 'Default' + - download: build + artifact: 'onnxruntime-java-gpu' + displayName: 'Download Final Jar' + - script: | + move $(Pipeline.Workspace)\build\onnxruntime-java-gpu\*.jar $(Pipeline.Workspace)\build\onnxruntime-java\ + + - task: PowerShell@2 + displayName: 'Run Java Tests with PowerShell' + inputs: + targetType: 'inline' + script: | + # Exit script on any error + $ErrorActionPreference = "Stop" + + cd $(Pipeline.Workspace)/build/onnxruntime-java + del *.asc + del *.sha256 + del *.sha512 + del *.pom + del *.sha1 + del *.pom + cd .. + mkdir tests + cd tests + jar xf $(Pipeline.Workspace)/build/onnxruntime-java/testing.jar + del $(Pipeline.Workspace)/build/onnxruntime-java/testing.jar + dir $(Pipeline.Workspace)/build/tests + Write-Host "Running JUnit Tests..." + & java -DUSE_CUDA=1 ` + -cp "$(Pipeline.Workspace)\build\tests;$(Pipeline.Workspace)\build\onnxruntime-java\*" org.junit.platform.console.ConsoleLauncher --scan-classpath=$(Pipeline.Workspace)\build\tests ` + --fail-if-no-tests --disable-banner --reports-dir "$($env:Build_ArtifactStagingDirectory)/TestResults" + + - task: PublishTestResults@2 + displayName: 'Publish Test Results' + inputs: + testResultsFormat: 'JUnit' + testResultsFiles: '$(Build.ArtifactStagingDirectory)/TestResults/TEST-junit-jupiter.xml' + failTaskOnFailedTests: true + + + - job: Final_Jar_Testing_Linux_GPU + templateContext: + type: validationJob + workspace: + clean: all + pool: + name: 'Onnxruntime-Linux-GPU-A10' + os: linux + variables: + - name: runCodesignValidationInjection + value: false + - name: docker_base_image + value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_almalinux8_gcc14:20251017.1 + timeoutInMinutes: 60 + steps: + - checkout: self + submodules: false + + - template: set-version-number-variables-step.yml + + - bash: | + sudo apt-get install -y msopenjdk-17 + dpkg -l msopenjdk-17 + + - bash: | + echo "Downloading and installing Maven $(mavenVersion) for Linux..." + MAVEN_DIR="$(Agent.TempDirectory)/apache-maven-$(mavenVersion)" + # Download Maven binary + wget https://archive.apache.org/dist/maven/maven-3/$(mavenVersion)/binaries/apache-maven-$(mavenVersion)-bin.tar.gz -O $(Agent.TempDirectory)/maven.tar.gz + + # Extract to the temp directory + mkdir -p ${MAVEN_DIR} + tar -xzf $(Agent.TempDirectory)/maven.tar.gz -C $(Agent.TempDirectory) + + # Add Maven's bin directory to the PATH for subsequent tasks in the job + echo "##vso[task.prependpath]${MAVEN_DIR}/bin" + displayName: 'Install Maven (Linux)' + + - script: | + echo "Maven is now on the PATH." + mvn --version + + - download: build + artifact: 'onnxruntime-java-gpu' + displayName: 'Download Final Jar' + + # Rename the downloaded folder + - script: | + mv $(Pipeline.Workspace)/build/onnxruntime-java-gpu $(Pipeline.Workspace)/build/onnxruntime-java + + - task: Maven@4 + displayName: 'Download Dependencies' + inputs: + mavenPomFile: '$(Build.SourcesDirectory)/tools/ci_build/java/pom.xml' + goals: 'dependency:copy-dependencies' + options: '-DoutputDirectory=$(Pipeline.Workspace)/build/onnxruntime-java' + publishJUnitTestResults: false + javaHomeOption: 'Path' + jdkDirectory: '/usr/lib/jvm/msopenjdk-17-amd64' + jdkVersionOption: 'Default' + mavenVersionOption: 'Default' + + # Now all the jars are in the $(Pipeline.Workspace)/build folder + + - template: templates/get-docker-image-steps.yml + parameters: + Dockerfile: tools/ci_build/github/linux/docker/Dockerfile.package_ubi8_cuda_tensorrt10_0 + Context: tools/ci_build/github/linux/docker/ + DockerBuildArgs: "--build-arg BUILD_UID=$( id -u ) --build-arg BASEIMAGE=${{ variables.docker_base_image }} --build-arg TRT_VERSION=${{ variables.linux_trt_version }}" + Repository: onnxruntimeubi8packagestest + + - bash: | + docker run --network=none --rm \ + --gpus all \ + --volume $(Build.SourcesDirectory):/onnxruntime_src \ + --volume $(Pipeline.Workspace)/build:/build \ + --volume /data/models:/build/models:ro \ + onnxruntimeubi8packagestest \ + /bin/bash /onnxruntime_src/tools/ci_build/github/linux/java_linux_final_test.sh -r /build -v $(OnnxRuntimeVersion) + displayName: 'Test' From 722ad35f76c6d847d8822b5e8b7e50fa06c6107f Mon Sep 17 00:00:00 2001 From: Erik Date: Fri, 27 Feb 2026 10:06:32 -0500 Subject: [PATCH 13/14] Syntax error --- .../templates/final-jar-testing-gpu.yml | 160 +++++++++--------- 1 file changed, 80 insertions(+), 80 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/templates/final-jar-testing-gpu.yml b/tools/ci_build/github/azure-pipelines/templates/final-jar-testing-gpu.yml index 73c3bb361ce82..2d8cb91b642a2 100644 --- a/tools/ci_build/github/azure-pipelines/templates/final-jar-testing-gpu.yml +++ b/tools/ci_build/github/azure-pipelines/templates/final-jar-testing-gpu.yml @@ -76,83 +76,83 @@ stages: failTaskOnFailedTests: true - - job: Final_Jar_Testing_Linux_GPU - templateContext: - type: validationJob - workspace: - clean: all - pool: - name: 'Onnxruntime-Linux-GPU-A10' - os: linux - variables: - - name: runCodesignValidationInjection - value: false - - name: docker_base_image - value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_almalinux8_gcc14:20251017.1 - timeoutInMinutes: 60 - steps: - - checkout: self - submodules: false - - - template: set-version-number-variables-step.yml - - - bash: | - sudo apt-get install -y msopenjdk-17 - dpkg -l msopenjdk-17 - - - bash: | - echo "Downloading and installing Maven $(mavenVersion) for Linux..." - MAVEN_DIR="$(Agent.TempDirectory)/apache-maven-$(mavenVersion)" - # Download Maven binary - wget https://archive.apache.org/dist/maven/maven-3/$(mavenVersion)/binaries/apache-maven-$(mavenVersion)-bin.tar.gz -O $(Agent.TempDirectory)/maven.tar.gz - - # Extract to the temp directory - mkdir -p ${MAVEN_DIR} - tar -xzf $(Agent.TempDirectory)/maven.tar.gz -C $(Agent.TempDirectory) - - # Add Maven's bin directory to the PATH for subsequent tasks in the job - echo "##vso[task.prependpath]${MAVEN_DIR}/bin" - displayName: 'Install Maven (Linux)' - - - script: | - echo "Maven is now on the PATH." - mvn --version - - - download: build - artifact: 'onnxruntime-java-gpu' - displayName: 'Download Final Jar' - - # Rename the downloaded folder - - script: | - mv $(Pipeline.Workspace)/build/onnxruntime-java-gpu $(Pipeline.Workspace)/build/onnxruntime-java - - - task: Maven@4 - displayName: 'Download Dependencies' - inputs: - mavenPomFile: '$(Build.SourcesDirectory)/tools/ci_build/java/pom.xml' - goals: 'dependency:copy-dependencies' - options: '-DoutputDirectory=$(Pipeline.Workspace)/build/onnxruntime-java' - publishJUnitTestResults: false - javaHomeOption: 'Path' - jdkDirectory: '/usr/lib/jvm/msopenjdk-17-amd64' - jdkVersionOption: 'Default' - mavenVersionOption: 'Default' - - # Now all the jars are in the $(Pipeline.Workspace)/build folder - - - template: templates/get-docker-image-steps.yml - parameters: - Dockerfile: tools/ci_build/github/linux/docker/Dockerfile.package_ubi8_cuda_tensorrt10_0 - Context: tools/ci_build/github/linux/docker/ - DockerBuildArgs: "--build-arg BUILD_UID=$( id -u ) --build-arg BASEIMAGE=${{ variables.docker_base_image }} --build-arg TRT_VERSION=${{ variables.linux_trt_version }}" - Repository: onnxruntimeubi8packagestest - - - bash: | - docker run --network=none --rm \ - --gpus all \ - --volume $(Build.SourcesDirectory):/onnxruntime_src \ - --volume $(Pipeline.Workspace)/build:/build \ - --volume /data/models:/build/models:ro \ - onnxruntimeubi8packagestest \ - /bin/bash /onnxruntime_src/tools/ci_build/github/linux/java_linux_final_test.sh -r /build -v $(OnnxRuntimeVersion) - displayName: 'Test' + - job: Final_Jar_Testing_Linux_GPU + templateContext: + type: validationJob + workspace: + clean: all + pool: + name: 'Onnxruntime-Linux-GPU-A10' + os: linux + variables: + - name: runCodesignValidationInjection + value: false + - name: docker_base_image + value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_almalinux8_gcc14:20251017.1 + timeoutInMinutes: 60 + steps: + - checkout: self + submodules: false + + - template: set-version-number-variables-step.yml + + - bash: | + sudo apt-get install -y msopenjdk-17 + dpkg -l msopenjdk-17 + + - bash: | + echo "Downloading and installing Maven $(mavenVersion) for Linux..." + MAVEN_DIR="$(Agent.TempDirectory)/apache-maven-$(mavenVersion)" + # Download Maven binary + wget https://archive.apache.org/dist/maven/maven-3/$(mavenVersion)/binaries/apache-maven-$(mavenVersion)-bin.tar.gz -O $(Agent.TempDirectory)/maven.tar.gz + + # Extract to the temp directory + mkdir -p ${MAVEN_DIR} + tar -xzf $(Agent.TempDirectory)/maven.tar.gz -C $(Agent.TempDirectory) + + # Add Maven's bin directory to the PATH for subsequent tasks in the job + echo "##vso[task.prependpath]${MAVEN_DIR}/bin" + displayName: 'Install Maven (Linux)' + + - script: | + echo "Maven is now on the PATH." + mvn --version + + - download: build + artifact: 'onnxruntime-java-gpu' + displayName: 'Download Final Jar' + + # Rename the downloaded folder + - script: | + mv $(Pipeline.Workspace)/build/onnxruntime-java-gpu $(Pipeline.Workspace)/build/onnxruntime-java + + - task: Maven@4 + displayName: 'Download Dependencies' + inputs: + mavenPomFile: '$(Build.SourcesDirectory)/tools/ci_build/java/pom.xml' + goals: 'dependency:copy-dependencies' + options: '-DoutputDirectory=$(Pipeline.Workspace)/build/onnxruntime-java' + publishJUnitTestResults: false + javaHomeOption: 'Path' + jdkDirectory: '/usr/lib/jvm/msopenjdk-17-amd64' + jdkVersionOption: 'Default' + mavenVersionOption: 'Default' + + # Now all the jars are in the $(Pipeline.Workspace)/build folder + + - template: templates/get-docker-image-steps.yml + parameters: + Dockerfile: tools/ci_build/github/linux/docker/Dockerfile.package_ubi8_cuda_tensorrt10_0 + Context: tools/ci_build/github/linux/docker/ + DockerBuildArgs: "--build-arg BUILD_UID=$( id -u ) --build-arg BASEIMAGE=${{ variables.docker_base_image }} --build-arg TRT_VERSION=${{ variables.linux_trt_version }}" + Repository: onnxruntimeubi8packagestest + + - bash: | + docker run --network=none --rm \ + --gpus all \ + --volume $(Build.SourcesDirectory):/onnxruntime_src \ + --volume $(Pipeline.Workspace)/build:/build \ + --volume /data/models:/build/models:ro \ + onnxruntimeubi8packagestest \ + /bin/bash /onnxruntime_src/tools/ci_build/github/linux/java_linux_final_test.sh -r /build -v $(OnnxRuntimeVersion) + displayName: 'Test' From ddb0d1cc513b77db32a2638b8503c1e557541f6c Mon Sep 17 00:00:00 2001 From: Erik Date: Fri, 27 Feb 2026 10:06:58 -0500 Subject: [PATCH 14/14] Pathing --- .../github/azure-pipelines/templates/final-jar-testing-gpu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ci_build/github/azure-pipelines/templates/final-jar-testing-gpu.yml b/tools/ci_build/github/azure-pipelines/templates/final-jar-testing-gpu.yml index 2d8cb91b642a2..22f3621c89c64 100644 --- a/tools/ci_build/github/azure-pipelines/templates/final-jar-testing-gpu.yml +++ b/tools/ci_build/github/azure-pipelines/templates/final-jar-testing-gpu.yml @@ -140,7 +140,7 @@ stages: # Now all the jars are in the $(Pipeline.Workspace)/build folder - - template: templates/get-docker-image-steps.yml + - template: get-docker-image-steps.yml parameters: Dockerfile: tools/ci_build/github/linux/docker/Dockerfile.package_ubi8_cuda_tensorrt10_0 Context: tools/ci_build/github/linux/docker/