From b1b8cb05dc53dcd6ebe50e72cda4abf9ba192832 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Mon, 27 May 2024 07:59:19 -0700 Subject: [PATCH] Adding java build and packaging stage to cuda-packaging-pipeline.yml (#20812) ### Description Adding java build/packaging stage to `cuda-packaging-pipeline.yml` ### Motivation and Context This way we can enable publishing the Java Cuda 12 along with Nuget CUDA 12 --- .../c-api-noopenmp-packaging-pipelines.yml | 30 +------------------ .../cuda-packaging-pipeline.yml | 10 ++++++- .../stages/download-java-tools-stage.yml | 30 +++++++++++++++++++ 3 files changed, 40 insertions(+), 30 deletions(-) create mode 100644 tools/ci_build/github/azure-pipelines/stages/download-java-tools-stage.yml diff --git a/tools/ci_build/github/azure-pipelines/c-api-noopenmp-packaging-pipelines.yml b/tools/ci_build/github/azure-pipelines/c-api-noopenmp-packaging-pipelines.yml index 4408e3d24466..4be14880a63d 100644 --- a/tools/ci_build/github/azure-pipelines/c-api-noopenmp-packaging-pipelines.yml +++ b/tools/ci_build/github/azure-pipelines/c-api-noopenmp-packaging-pipelines.yml @@ -144,35 +144,7 @@ stages: parameters : condition : 'succeeded' -- stage: Download_Java_Tools - dependsOn: [] - jobs: - - job: Download_Java_Tools - pool: - name: 'onnxruntime-Ubuntu2204-AMD-CPU' - steps: - - checkout: none - - task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3 - displayName: 'Clean Agent Directories' - condition: always() - - task: CmdLine@2 - displayName: Download Java Tools - inputs: - script: | - mkdir -p java-tools - pushd java-tools - wget --tries=3 https://oss.sonatype.org/service/local/repositories/releases/content/org/junit/platform/junit-platform-console-standalone/1.6.2/junit-platform-console-standalone-1.6.2.jar -P ./ - wget --tries=3 https://oss.sonatype.org/service/local/repositories/releases/content/com/google/protobuf/protobuf-java/3.21.7/protobuf-java-3.21.7.jar -P ./ - popd - workingDirectory: '$(Agent.TempDirectory)' - - task: PublishPipelineArtifact@1 - displayName: 'Publish Pipeline Java Tools Artifact' - inputs: - targetPath: '$(Agent.TempDirectory)/java-tools' - artifact: 'onnxruntime-java-tools' - - template: templates/component-governance-component-detection-steps.yml - parameters : - condition : 'succeeded' +- template: stages/download-java-tools-stage.yml - template: templates/c-api-cpu.yml parameters: diff --git a/tools/ci_build/github/azure-pipelines/cuda-packaging-pipeline.yml b/tools/ci_build/github/azure-pipelines/cuda-packaging-pipeline.yml index c8f6116348dd..71e8cbcd1989 100644 --- a/tools/ci_build/github/azure-pipelines/cuda-packaging-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/cuda-packaging-pipeline.yml @@ -127,7 +127,15 @@ stages: win_cuda_home: ${{ variables.win_cuda_home }} DoEsrp: ${{ parameters.DoEsrp }} IsReleaseBuild: ${{ parameters.IsReleaseBuild }} - buildJava: false + buildJava: true buildNodejs: false SpecificArtifact: ${{ parameters.SpecificArtifact }} BuildId: ${{ parameters.BuildId }} + + - template: stages/download-java-tools-stage.yml + + - template: stages/java-cuda-packaging-stage.yml + parameters: + CudaVersion: ${{ parameters.CudaVersion }} + SpecificArtifact: ${{ parameters.SpecificArtifact }} + BuildId: ${{ parameters.BuildId }} diff --git a/tools/ci_build/github/azure-pipelines/stages/download-java-tools-stage.yml b/tools/ci_build/github/azure-pipelines/stages/download-java-tools-stage.yml new file mode 100644 index 000000000000..40a4885e6c18 --- /dev/null +++ b/tools/ci_build/github/azure-pipelines/stages/download-java-tools-stage.yml @@ -0,0 +1,30 @@ +stages: +- stage: Download_Java_Tools + dependsOn: [] + jobs: + - job: Download_Java_Tools + pool: + name: 'onnxruntime-Ubuntu2204-AMD-CPU' + steps: + - checkout: none + - task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3 + displayName: 'Clean Agent Directories' + condition: always() + - task: CmdLine@2 + displayName: Download Java Tools + inputs: + script: | + mkdir -p java-tools + pushd java-tools + wget --tries=3 https://oss.sonatype.org/service/local/repositories/releases/content/org/junit/platform/junit-platform-console-standalone/1.6.2/junit-platform-console-standalone-1.6.2.jar -P ./ + wget --tries=3 https://oss.sonatype.org/service/local/repositories/releases/content/com/google/protobuf/protobuf-java/3.21.7/protobuf-java-3.21.7.jar -P ./ + popd + workingDirectory: '$(Agent.TempDirectory)' + - task: PublishPipelineArtifact@1 + displayName: 'Publish Pipeline Java Tools Artifact' + inputs: + targetPath: '$(Agent.TempDirectory)/java-tools' + artifact: 'onnxruntime-java-tools' + - template: ../templates/component-governance-component-detection-steps.yml + parameters : + condition : 'succeeded' \ No newline at end of file