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

Migrate Zip-Nuget Package Pipeline to 1ES #23609

Open
wants to merge 45 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
702ed1c
Migrate Zip-Nuget Package Pipeline to 1ES
jchen351 Feb 7, 2025
d9dda06
Migrate Zip-Nuget Package Pipeline to 1ES
jchen351 Feb 7, 2025
0469e15
Migrate Zip-Nuget Package Pipeline to 1ES
jchen351 Feb 7, 2025
33e6ebf
Migrate Zip-Nuget Package Pipeline to 1ES
jchen351 Feb 7, 2025
9efa0b4
Migrate Zip-Nuget Package Pipeline to 1ES
jchen351 Feb 7, 2025
361c41e
Try to skip ESRP
jchen351 Feb 7, 2025
5cf3f47
Try to skip validate-package.yml
jchen351 Feb 7, 2025
60749a2
Try to skip validate-package.yml
jchen351 Feb 7, 2025
f9aa616
Try to skip validate-package.yml
jchen351 Feb 7, 2025
6e45a7b
Try to skip validate-package.yml
jchen351 Feb 7, 2025
39ab306
publish
jchen351 Feb 7, 2025
7e22fb6
1ES
jchen351 Feb 7, 2025
05dae73
Disable dml
jchen351 Feb 7, 2025
7711069
Disable nuget-combine-cuda-stage.yml
jchen351 Feb 7, 2025
471f287
Disable c-api-cpu.yml
jchen351 Feb 7, 2025
41f2aa3
Disable java-cuda-packaging-stage.yml
jchen351 Feb 7, 2025
1b3dcc8
Update c-api-cpu.yml
jchen351 Feb 7, 2025
de9ce65
Disable c-api-cpu.yml
jchen351 Feb 7, 2025
faa38bf
Binary c-api-cpu.yml
jchen351 Feb 7, 2025
165d968
Binary c-api-cpu.yml 2
jchen351 Feb 7, 2025
10355d7
Binary c-api-cpu.yml 2
jchen351 Feb 7, 2025
27eadb1
Binary c-api-cpu.yml 2
jchen351 Feb 7, 2025
4bdec8e
Binary c-api-cpu.yml 3
jchen351 Feb 7, 2025
b16aac3
undo Binary c-api-cpu.yml 3
jchen351 Feb 7, 2025
073a6c5
undo Binary c-api-cpu.yml 3
jchen351 Feb 7, 2025
503b159
undo Binary c-api-cpu.yml 2
jchen351 Feb 7, 2025
7913042
undo Binary c-api-cpu.yml 1
jchen351 Feb 7, 2025
9746f1c
undo Binary c-api-cpu.yml 1.5
jchen351 Feb 7, 2025
bcb0652
undo Binary c-api-cpu.yml 1.75
jchen351 Feb 7, 2025
73b7200
undo Binary c-api-cpu.yml 1.5
jchen351 Feb 7, 2025
abb6848
undo Binary c-api-cpu.yml 1.25
jchen351 Feb 7, 2025
645f237
undo Binary c-api-cpu.yml 1.25
jchen351 Feb 7, 2025
3d8da4d
undo Binary c-api-cpu.yml 1
jchen351 Feb 7, 2025
979a1a7
undo dml-vs-2022.yml
jchen351 Feb 7, 2025
5108e87
undo dml-vs-2022.yml
jchen351 Feb 7, 2025
c17734e
onnxruntime-inference-examples
jchen351 Feb 7, 2025
7d2e988
undo binary
jchen351 Feb 7, 2025
8705d20
undo pool
jchen351 Feb 7, 2025
293d96f
undo templates
jchen351 Feb 7, 2025
58183eb
Adding a new stage
jchen351 Feb 7, 2025
0714630
Adding a new stage
jchen351 Feb 7, 2025
67c2221
Adding a new stage
jchen351 Feb 7, 2025
15347b8
Update os
jchen351 Feb 7, 2025
16c8269
Update os
jchen351 Feb 7, 2025
bb75778
Update os
jchen351 Feb 7, 2025
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

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ stages:
displayName: 'Create NuGet Package'
failOnStderr: true
- task: PublishPipelineArtifact@0
- task: 1ES.PublishPipelineArtifact@1
displayName: 'Publish Pipeline Artifact: ${{ parameters.ArtifactName }}'
inputs:
artifactName: ${{ parameters.ArtifactName }}
Expand Down Expand Up @@ -182,7 +182,7 @@ stages:
workingDirectory: '$(Build.SourcesDirectory)\js\node'
displayName: 'Create NPM Package'
- task: PublishPipelineArtifact@0
- task: 1ES.PublishPipelineArtifact@1
displayName: 'Publish Pipeline Artifact: ${{ parameters.ArtifactName }}'
inputs:
artifactName: ${{ parameters.ArtifactName }}
Expand All @@ -208,7 +208,7 @@ stages:
DisplayName: 'ESRP - Sign Node.js binding binaries'
DoEsrp: ${{ parameters.DoEsrp }}
Pattern: '*.node'
- task: PublishPipelineArtifact@1
- task: 1ES.PublishPipelineArtifact@1
inputs:
targetPath: '$(Build.SourcesDirectory)\js\node\bin\napi-v3\win32\${{ parameters.sln_platform }}'
artifactName: 'drop-onnxruntime-nodejs-win-${{ parameters.sln_platform }}-dml'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ stages:
- job: Download_Java_Tools
pool:
name: 'onnxruntime-Ubuntu2204-AMD-CPU'
os: linux
steps:
- checkout: none
- task: CmdLine@2
Expand All @@ -17,11 +18,13 @@ stages:
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

- task: 1ES.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'
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ stages:
SourceFolder: '$(Build.BinariesDirectory)\java-artifact\onnxruntime-java-win-x64'
TargetFolder: '$(Build.ArtifactStagingDirectory)'

- task: PublishPipelineArtifact@1
- task: 1ES.PublishPipelineArtifact@1
displayName: 'Publish Pipeline Artifact'
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)'
path: '$(Build.ArtifactStagingDirectory)'
artifact: 'onnxruntime-java-gpu'

- template: ../templates/component-governance-component-detection-steps.yml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ stages:
parameters:
condition: 'succeeded'

- task: PublishPipelineArtifact@0
- task: 1ES.PublishPipelineArtifact@1
displayName: 'Publish Pipeline NuGet Artifact'
inputs:
artifactName: 'drop-signed-nuget-GPU'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ stages:
/src_dir/onnxruntime-inference-examples/c_cxx/squeezenet/run_capi_application.sh -o /src_dir/onnxruntime -p /artifact_src/onnxruntime-linux-x64-gpu-$(OnnxRuntimeVersion).tgz -w /src_dir/onnxruntime-inference-examples/c_cxx/squeezenet
workingDirectory: '$(Build.ArtifactStagingDirectory)'

- task: PublishPipelineArtifact@1
- task: 1ES.PublishPipelineArtifact@1
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)/onnxruntime-linux-x64-gpu-$(OnnxRuntimeVersion).tgz'
artifactName: 'onnxruntime-linux-x64-gpu'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ stages:
arguments: $(Build.SourcesDirectory)\onnxruntime $(Build.ArtifactStagingDirectory)\onnxruntime-win-x64-gpu-$(OnnxRuntimeVersion).zip $(Build.SourcesDirectory)\onnxruntime-inference-examples\c_cxx\squeezenet
workingFolder: '$(Build.ArtifactStagingDirectory)'

- task: PublishPipelineArtifact@0
- task: 1ES.PublishPipelineArtifact@1
displayName: 'Publish Pipeline Combined GPU Package Artifact'
inputs:
artifactName: 'onnxruntime-win-x64-gpu'
Expand Down
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1ES.Official.PipelineTemplate.yml@1esPipelines doesn't allow multiple level of -templates. That is why I move this stage into its own file

Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
parameters:
- name: DoEsrp
type: boolean
default: true

stages:
- stage: NuGet_Packaging_DML
dependsOn:
- Windows_CI_GPU_DML_Dev
- Windows_CI_GPU_DML_Dev_x86
- Windows_CI_GPU_DML_Dev_arm64
condition: succeeded()
jobs:
- job: NuGet_Packaging_DML
workspace:
clean: all
pool: 'onnxruntime-Win2022-GPU-dml-A10'
steps:
- task: DownloadPipelineArtifact@0
displayName: 'Download Pipeline Artifact - NuGet DirectML'
inputs:
artifactName: 'drop-nuget-dml'
targetPath: '$(Build.BinariesDirectory)/nuget-artifact-dml'

- task: DownloadPipelineArtifact@0
displayName: 'Download Pipeline Artifact - NuGet DirectML x86'
inputs:
artifactName: 'drop-win-dml-x86-zip'
targetPath: '$(Build.BinariesDirectory)/nuget-artifact-dml'

- task: DownloadPipelineArtifact@0
displayName: 'Download Pipeline Artifact - NuGet DirectML arm64'
inputs:
artifactName: 'drop-win-dml-arm64-zip'
targetPath: '$(Build.BinariesDirectory)/nuget-artifact-dml'

- script: |
pushd $(Build.BinariesDirectory)\nuget-artifact-dml
dir
powershell -Command "Invoke-WebRequest http://stahlworks.com/dev/unzip.exe -OutFile unzip.exe"
powershell -Command "Invoke-WebRequest http://stahlworks.com/dev/zip.exe -OutFile zip.exe"
set PATH=%CD%;%PATH%
SETLOCAL EnableDelayedExpansion
FOR /R %%i IN (*.nupkg) do (
set filename=%%~ni
IF NOT "!filename:~25,7!"=="Managed" (
rename %%~ni.nupkg %%~ni.zip
unzip %%~ni.zip -d %%~ni
del /Q %%~ni.zip
unzip win-dml-x86.zip -d win-x86
mkdir %%~ni\runtimes\win-x86
mkdir %%~ni\runtimes\win-x86\native
move win-x86\runtimes\win-x86\native\onnxruntime.dll %%~ni\runtimes\win-x86\native\onnxruntime.dll
move win-x86\runtimes\win-x86\native\onnxruntime.lib %%~ni\runtimes\win-x86\native\onnxruntime.lib
move win-x86\runtimes\win-x86\native\onnxruntime.pdb %%~ni\runtimes\win-x86\native\onnxruntime.pdb
unzip win-dml-arm64.zip -d win-arm64
mkdir %%~ni\runtimes\win-arm64
mkdir %%~ni\runtimes\win-arm64\native
move win-arm64\runtimes\win-arm64\native\onnxruntime.dll %%~ni\runtimes\win-arm64\native\onnxruntime.dll
move win-arm64\runtimes\win-arm64\native\onnxruntime.lib %%~ni\runtimes\win-arm64\native\onnxruntime.lib
move win-arm64\runtimes\win-arm64\native\onnxruntime.pdb %%~ni\runtimes\win-arm64\native\onnxruntime.pdb
pushd %%~ni
zip -r ..\%%~ni.zip .
popd
move %%~ni.zip %%~ni.nupkg
)
)
popd
copy $(Build.BinariesDirectory)\nuget-artifact-dml\Microsoft.ML.OnnxRuntime.DirectML*nupkg $(Build.ArtifactStagingDirectory)
displayName: 'Bundle DML NuGet and other binaries'
- template: ../templates/esrp_nuget.yml
parameters:
DisplayName: 'ESRP - sign NuGet package'
FolderPath: '$(Build.ArtifactStagingDirectory)'
DoEsrp: ${{ parameters.DoEsrp }}

- template: ../templates/validate-package.yml
parameters:
PackageType: 'nuget'
PackagePath: '$(Build.ArtifactStagingDirectory)'
PackageName: 'Microsoft.ML.OnnxRuntime.DirectML*nupkg'
PlatformsSupported: 'win-x64,win-x86,win-arm64'
VerifyNugetSigning: ${{ parameters.DoEsrp }}

- task: 1ES.PublishPipelineArtifact@1
displayName: 'Publish Pipeline NuGet Artifact'
inputs:
artifactName: 'drop-signed-nuget-dml'
targetPath: '$(Build.ArtifactStagingDirectory)'
- template: ../templates/component-governance-component-detection-steps.yml
parameters:
condition: 'succeeded'
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ jobs:
parameters:
JarFileDirectory: '$(artifacts_directory)'

- task: PublishBuildArtifacts@1
- task: 1ES.PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(artifacts_directory)'
PathtoPublish: '$(artifacts_directory)'
artifactName: '${{parameters.artifactName}}'
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ steps:
archiveFile: '$(Build.ArtifactStagingDirectory)/${{parameters.artifactName}}.tgz'
replaceExistingArchive: true

- task: PublishPipelineArtifact@1
- task: 1ES.PublishPipelineArtifact@1
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)'
artifactName: '${{parameters.artifactNameNoVersionString}}'
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ steps:
archiveFile: '$(Build.ArtifactStagingDirectory)\${{parameters.artifactName}}.zip'
replaceExistingArchive: true

- task: PublishPipelineArtifact@1
- task: 1ES.PublishPipelineArtifact@1
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)\${{parameters.artifactName}}.zip'
artifactName: '${{parameters.artifactNameNoVersionString}}'
21 changes: 11 additions & 10 deletions tools/ci_build/github/azure-pipelines/templates/c-api-cpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ stages:
--mac_catalyst_enabled
displayName: "Test Apple framework"

- task: PublishBuildArtifacts@1
- task: 1ES.PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.BinariesDirectory)/artifacts'
PathtoPublish: '$(Build.BinariesDirectory)/artifacts'
artifactName: 'onnxruntime-ios-full-xcframework'

- template: component-governance-component-detection-steps.yml
Expand Down Expand Up @@ -282,10 +282,10 @@ stages:
SourceFolder: '$(Build.BinariesDirectory)\java-artifact\onnxruntime-java-win-x64'
TargetFolder: '$(Build.ArtifactStagingDirectory)'

- task: PublishPipelineArtifact@1
- task: 1ES.PublishPipelineArtifact@1
displayName: 'Publish Pipeline Artifact'
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)'
path: '$(Build.ArtifactStagingDirectory)'
artifact: 'onnxruntime-java'

- template: component-governance-component-detection-steps.yml
Expand Down Expand Up @@ -488,11 +488,12 @@ stages:
PlatformsSupported: 'win-x64,win-x86,linux-x64,linux-arm64,osx-x64'
VerifyNugetSigning: false

- task: PublishPipelineArtifact@0
- task: 1ES.PublishPipelineArtifact@1
displayName: 'Publish Pipeline NuGet Artifact'
inputs:
artifactName: 'drop-signed-nuget-CPU'
targetPath: '$(Build.ArtifactStagingDirectory)'
path: '$(Build.ArtifactStagingDirectory)'
artifact: 'drop-signed-nuget-CPU'



- task: MSBuild@1
Expand Down Expand Up @@ -767,11 +768,11 @@ stages:
Contents: 'onnxruntime-node-*.tgz'
TargetFolder: '$(Build.ArtifactStagingDirectory)'

- task: PublishPipelineArtifact@0
- task: 1ES.PublishPipelineArtifact@1
displayName: 'Publish NPM packages files'
inputs:
artifactName: 'NPM_packages'
targetPath: '$(Build.ArtifactStagingDirectory)'
path: '$(Build.ArtifactStagingDirectory)'
artifact: 'NPM_packages'

- template: component-governance-component-detection-steps.yml
parameters :
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ steps:
args: '-r $(Build.BinariesDirectory) -c ${{parameters.buildConfig}} -a ${{parameters.artifactName}} -l ${{parameters.libraryName}} -n ${{parameters.nativeLibraryName}} -v ${{parameters.version}} -h ${{parameters.arch}}'
workingDirectory: '$(Build.BinariesDirectory)/${{parameters.buildConfig}}'

- task: PublishBuildArtifacts@1
- task: 1ES.PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.BinariesDirectory)/${{parameters.artifactName}}'
PathtoPublish: '$(Build.BinariesDirectory)/${{parameters.artifactName}}'
artifactName: 'drop-${{parameters.artifactName}}'
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ stages:
rm -rf $(Agent.TempDirectory)/macpackage
displayName: 'Verify code signing'

- task: PublishPipelineArtifact@1
- task: 1ES.PublishPipelineArtifact@1
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)'
artifact: 'onnxruntime-osx'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,10 @@ steps:
displayName: 'Copy libcustom_op_library.dylib to ArtifactStagingDirectory'
condition: and(succeeded(), eq('${{ parameters.MacosArch }}', 'x86_64'))

- publish: '$(Build.ArtifactStagingDirectory)'
artifact: 'onnxruntime-osx-${{ parameters.MacosArch }}'
- task: 1ES.PublishPipelineArtifact@1
inputs:
path: '$(Build.ArtifactStagingDirectory)'
artifact: 'onnxruntime-osx-${{ parameters.MacosArch }}'

- ${{ if eq(parameters.BuildJava, true) }}:
- template: java-api-artifacts-package-and-publish-steps-posix.yml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ parameters:
default: ''

steps:
- task: PublishPipelineArtifact@1
- task: 1ES.PublishPipelineArtifact@1
inputs:
targetPath: '$(Build.SourcesDirectory)/js/node/bin/napi-v3/${{ parameters.os }}/${{ parameters.arch }}/onnxruntime_binding.node'
artifactName: '${{parameters.artifactName}}'
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ steps:
DoEsrp: ${{parameters.DoEsrp}}
Pattern: '*.node'

- task: PublishPipelineArtifact@1
- task: 1ES.PublishPipelineArtifact@1
inputs:
targetPath: '$(Build.SourcesDirectory)\js\node\bin\napi-v3\win32\${{ parameters.arch }}\onnxruntime_binding.node'
artifactName: '${{parameters.artifactName}}'
7 changes: 3 additions & 4 deletions tools/ci_build/github/azure-pipelines/templates/win-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,10 @@ stages:
${{ else }}:
buildOnly: false

- task: PublishBuildArtifacts@1
- task: 1ES.PublishBuildArtifacts@1
displayName: 'Publish Java temp binaries'
inputs:
pathtoPublish: '$(Build.BinariesDirectory)\onnxruntime-java-win-${{ parameters.msbuildPlatform }}'
PathtoPublish: '$(Build.BinariesDirectory)\onnxruntime-java-win-${{ parameters.msbuildPlatform }}'
artifactName: 'drop-onnxruntime-java-win-${{ parameters.packageName }}${{parameters.artifact_name_suffix}}'
# All GPU builds will be tested in the next stage with GPU machine
- ${{ if contains(parameters.ort_build_pool_name, 'CPU') }}:
Expand Down Expand Up @@ -213,11 +213,10 @@ stages:
displayName: 'Copy java pad and folder for java test'
workingDirectory: '$(Build.BinariesDirectory)'
- task: PublishPipelineArtifact@1
- task: 1ES.PublishPipelineArtifact@1
inputs:
targetPath: '$(Agent.TempDirectory)/RelWithDebInfo'
artifactName: 'Windows_Packaging_${{ parameters.stage_name_suffix }}_build_artifacts'
publishLocation: 'pipeline'

- script: |
dir *.dll
Expand Down
Loading