Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combine JAR Packages for Windows, Linux, and MacOS #669

Merged
merged 29 commits into from
Mar 15, 2024
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
4b603dc
unpack all JARs
Mar 7, 2024
8a6adaa
fix macos job
Mar 12, 2024
fddf1cd
remove -f for macos tree
Mar 12, 2024
70b4786
move build files from java and linux into macos directory for combine…
Mar 12, 2024
692a3f7
test with download and publish pipeline artifacts instead
Mar 12, 2024
7b17f20
use full download task name rather than shortcut
Mar 12, 2024
59b47d1
add job dependencies
Mar 12, 2024
9ba3a2c
combine JAR packages into one
Mar 12, 2024
f8ebad8
Merge branch 'main' of https://github.com/microsoft/onnxruntime-exten…
Mar 13, 2024
32773aa
update version from version.txt
Mar 13, 2024
23afa32
change relative path for version.txt
Mar 13, 2024
8cc3919
test
Mar 13, 2024
934b6f0
typo
Mar 13, 2024
906a429
Update java_packaging.yml for Azure Pipelines
sayanshaw24 Mar 13, 2024
49ab380
Update java_packaging.yml for Azure Pipelines
sayanshaw24 Mar 13, 2024
bd48e7d
test without output variable
sayanshaw24 Mar 14, 2024
7a15e5d
Update java_packaging.yml for Azure Pipelines
sayanshaw24 Mar 14, 2024
8a0bcf1
test with type rather than cat command
sayanshaw24 Mar 14, 2024
9b5397f
Update java_packaging.yml for Azure Pipelines
sayanshaw24 Mar 14, 2024
bfe1cb2
Update java_packaging.yml for Azure Pipelines
sayanshaw24 Mar 14, 2024
f5a5fb3
Update java_packaging.yml for Azure Pipelines
sayanshaw24 Mar 14, 2024
c191e05
Update java_packaging.yml for Azure Pipelines
sayanshaw24 Mar 14, 2024
e1bf969
Update java_packaging.yml for Azure Pipelines
sayanshaw24 Mar 14, 2024
21bc654
Merge branch 'main' of https://github.com/microsoft/onnxruntime-exten…
Mar 14, 2024
207625f
set version in each job
Mar 14, 2024
13bb072
Update java_packaging.yml for Azure Pipelines
sayanshaw24 Mar 14, 2024
f35b469
Update java_packaging.yml for Azure Pipelines
sayanshaw24 Mar 14, 2024
0c9a786
add back dependencies
sayanshaw24 Mar 14, 2024
d9555d7
final
sayanshaw24 Mar 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 76 additions & 19 deletions .pipelines/java_packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ stages:
pool: {name: 'onnxruntime-Win-CPU-2022'}

steps:
- task: PowerShell@2
displayName: 'Set version'
inputs:
targetType: 'inline'
script: |
$_ExtVersion=(cat version.txt)
echo "##vso[task.setvariable variable=OrtExtVersion;]$_ExtVersion"
workingDirectory: '$(Build.SourcesDirectory)'

- script: |
call .\build.bat -DOCOS_BUILD_JAVA=ON
displayName: build the extensions java package
Expand All @@ -25,7 +34,7 @@ stages:

- script: |
cd $(Build.ArtifactStagingDirectory)
jar xvf onnxruntime-extensions-0.11.0.jar
jar xvf onnxruntime-extensions-$(OrtExtVersion).jar
tree $(Build.ArtifactStagingDirectory) /f
displayName: Unpack JAR to sign DLL

Expand All @@ -35,18 +44,9 @@ stages:
DisplayName: 'Sign DLL'
DoEsrp: 'true'

- script: |
cd $(Build.ArtifactStagingDirectory)
rm onnxruntime-extensions-0.11.0.jar
jar cmf0 META-INF/MANIFEST.MF onnxruntime-extensions-0.11.0.jar *
tree $(Build.ArtifactStagingDirectory) /f
displayName: Repack JAR with signed DLL

- task: PublishPipelineArtifact@1
displayName: 'Publish Windows Artifact'
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)'
artifact: 'drop-signed-windows-onnxruntime-extensions-java-cpu'
- publish: $(Build.ArtifactStagingDirectory)/ai/onnxruntime/extensions/native/
displayName: 'Publish Windows Binaries for Combined JAR'
artifact: WindowsBinaries

- template: templates/component-governance-component-detection-steps.yml
parameters :
Expand All @@ -62,6 +62,15 @@ stages:
pool: {name: 'Azure-Pipelines-EO-Ubuntu-2004-aiinfra'}

steps:
- task: PowerShell@2
displayName: 'Set version'
inputs:
targetType: 'inline'
script: |
$_ExtVersion=(cat version.txt)
echo "##vso[task.setvariable variable=OrtExtVersion;]$_ExtVersion"
workingDirectory: '$(Build.SourcesDirectory)'

- script: |
sh ./build.sh -DOCOS_BUILD_JAVA=ON
displayName: build the extensions java package
Expand All @@ -72,11 +81,16 @@ stages:
SourceFolder: 'out/$(Agent.OS)/RelWithDebInfo/java/build/libs'
TargetFolder: '$(Build.ArtifactStagingDirectory)'

- task: PublishPipelineArtifact@1
displayName: 'Publish Linux Artifact'
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)'
artifact: 'drop-linux-onnxruntime-extensions-java-cpu'
- script: |
cd $(Build.ArtifactStagingDirectory)
echo $(OrtExtVersion)
jar xvf onnxruntime-extensions-$(OrtExtVersion).jar
tree $(Build.ArtifactStagingDirectory) /f
displayName: Unpack JAR

- publish: $(Build.ArtifactStagingDirectory)/ai/onnxruntime/extensions/native/
displayName: 'Publish Linux Binaries for Combined JAR'
artifact: LinuxBinaries

- template: templates/component-governance-component-detection-steps.yml
parameters :
Expand All @@ -87,12 +101,24 @@ stages:
condition: always()

- job: MacOS_CPU_Java_Packaging
dependsOn:
- Windows_CPU_Java_Packaging
- Linux_CPU_Java_Packaging
workspace:
clean: all
pool:
vmImage: 'macOS-13'

steps:
- task: PowerShell@2
displayName: 'Set version'
inputs:
targetType: 'inline'
script: |
$_ExtVersion=(cat version.txt)
echo "##vso[task.setvariable variable=OrtExtVersion;]$_ExtVersion"
workingDirectory: '$(Build.SourcesDirectory)'

- script: |
sh ./build.sh -DOCOS_BUILD_JAVA=ON
displayName: build the extensions java package
Expand All @@ -103,11 +129,42 @@ stages:
SourceFolder: 'out/$(Agent.OS)/RelWithDebInfo/java/build/libs'
TargetFolder: '$(Build.ArtifactStagingDirectory)'

- script: |
cd $(Build.ArtifactStagingDirectory)
echo $(OrtExtVersion)
jar xvf onnxruntime-extensions-$(OrtExtVersion).jar
brew install tree
tree $(Build.ArtifactStagingDirectory)
displayName: Unpack JAR to view contents

- task: DownloadPipelineArtifact@0
sayanshaw24 marked this conversation as resolved.
Show resolved Hide resolved
displayName: 'Download Windows Pipeline Artifact'
inputs:
artifactName: 'WindowsBinaries'
targetPath: '$(Build.ArtifactStagingDirectory)/ai/onnxruntime/extensions/native/'

- task: DownloadPipelineArtifact@0
displayName: 'Download Linux Pipeline Artifact'
inputs:
artifactName: 'LinuxBinaries'
targetPath: '$(Build.ArtifactStagingDirectory)/ai/onnxruntime/extensions/native/'

- script: |
brew install tree
tree $(Build.ArtifactStagingDirectory)
displayName: Print contents

- script: |
cd $(Build.ArtifactStagingDirectory)
rm onnxruntime-extensions-$(OrtExtVersion).jar
jar cmf0 META-INF/MANIFEST.MF onnxruntime-extensions-$(OrtExtVersion).jar *
displayName: Combine and pack JAR with Windows, Linux and MacOS Binaries

- task: PublishPipelineArtifact@1
displayName: 'Publish MacOS Artifact'
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)'
artifact: 'drop-macos-onnxruntime-extensions-java-cpu'
artifact: 'drop-onnxruntime-extensions-java-cpu'

- template: templates/component-governance-component-detection-steps.yml
parameters :
Expand Down
Loading