mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-23 22:13:38 +00:00
Nuget packaging no omp (#5666)
* create new nuget packaging pipeline without openmp * rename package * update image name * rename package name * rename managed package * reset project attribute * merge master * set package name * set NoOpenMP as cpu build * shorten line length Co-authored-by: Randy Shuai <rashuai@microsoft.com>
This commit is contained in:
parent
77b1eea9cf
commit
71f90e08f1
3 changed files with 348 additions and 1 deletions
|
|
@ -0,0 +1,17 @@
|
|||
schedules:
|
||||
- cron: "0 8 * * *"
|
||||
displayName: Daily Build
|
||||
branches:
|
||||
include:
|
||||
- master
|
||||
always: true
|
||||
|
||||
variables:
|
||||
PackageName: 'Microsoft.ML.OnnxRuntime.NoOpenMP'
|
||||
|
||||
jobs:
|
||||
- template: templates/cpu-noopenmp.yml
|
||||
parameters:
|
||||
AgentPool : 'Win-CPU-2019'
|
||||
DoEsrp: 'true'
|
||||
DoCompliance: 'true'
|
||||
|
|
@ -0,0 +1,330 @@
|
|||
parameters:
|
||||
DoEsrp: 'false'
|
||||
PackageName: 'Microsoft.ML.OnnxRuntime.NoOpenMP'
|
||||
DoCompliance: 'false'
|
||||
|
||||
jobs:
|
||||
- template: ../../templates/win-ci-2019.yml
|
||||
parameters:
|
||||
AgentPool : 'Win-CPU-2019'
|
||||
ArtifactName: 'drop-nuget'
|
||||
JobName: 'Windows_CI_Dev'
|
||||
BuildCommand: '--build_dir $(Build.BinariesDirectory) --skip_submodule_sync --build_shared_lib --enable_onnx_tests --enable_wcos --use_telemetry --use_winml --cmake_generator "Visual Studio 16 2019"'
|
||||
BuildArch: 'x64'
|
||||
EnvSetupScript: 'setup_env.bat'
|
||||
sln_platform: 'x64'
|
||||
DoDebugBuild: 'false'
|
||||
DoNugetPack : 'true'
|
||||
DoCompliance: ${{ parameters.DoCompliance }}
|
||||
DoEsrp: ${{ parameters.DoEsrp }}
|
||||
OrtPackageId: 'Microsoft.ML.OnnxRuntime.NoOpenMP'
|
||||
NuPackScript: |
|
||||
msbuild $(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.proj /p:Configuration=RelWithDebInfo /t:CreatePackage /p:OrtPackageId=Microsoft.ML.OnnxRuntime.NoOpenMP
|
||||
copy $(Build.SourcesDirectory)\csharp\src\Microsoft.ML.OnnxRuntime\bin\RelWithDebInfo\*.nupkg $(Build.ArtifactStagingDirectory)
|
||||
copy $(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo\*.nupkg $(Build.ArtifactStagingDirectory)
|
||||
mkdir $(Build.ArtifactStagingDirectory)\testdata
|
||||
copy $(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo\custom_op_library.* $(Build.ArtifactStagingDirectory)\testdata
|
||||
|
||||
- template: ../../templates/win-ci-2019.yml
|
||||
parameters:
|
||||
AgentPool : 'Win-CPU-2019'
|
||||
ArtifactName: 'drop-win-x86-zip'
|
||||
JobName: 'Windows_CI_Dev_x86'
|
||||
BuildCommand: '--build_dir $(Build.BinariesDirectory) --skip_submodule_sync --build_shared_lib --enable_onnx_tests --enable_wcos --x86 --use_telemetry --use_winml --cmake_generator "Visual Studio 16 2019"'
|
||||
BuildArch: 'x86'
|
||||
EnvSetupScript: 'setup_env_x86.bat'
|
||||
sln_platform: 'Win32'
|
||||
DoDebugBuild: 'false'
|
||||
DoNugetPack : 'true'
|
||||
DoCompliance: ${{ parameters.DoCompliance }}
|
||||
DoEsrp: ${{ parameters.DoEsrp }}
|
||||
OrtPackageId: 'Microsoft.ML.OnnxRuntime.NoOpenMP'
|
||||
NuPackScript: |
|
||||
msbuild $(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.proj /p:Configuration=RelWithDebInfo /p:TargetArchitecture=x86 /t:CreatePackage /p:OrtPackageId=Microsoft.ML.OnnxRuntime.NoOpenMP
|
||||
cd $(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo\
|
||||
ren *.nupkg win-x86.zip
|
||||
copy $(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo\*zip $(Build.ArtifactStagingDirectory)
|
||||
mkdir $(Build.ArtifactStagingDirectory)\testdata
|
||||
copy $(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo\custom_op_library.* $(Build.ArtifactStagingDirectory)\testdata
|
||||
|
||||
- template: ../../templates/win-ci-2019.yml
|
||||
parameters:
|
||||
AgentPool : 'Win-CPU-2019'
|
||||
ArtifactName: 'drop-win-arm64-zip'
|
||||
JobName: 'Windows_CI_Dev_arm64'
|
||||
BuildCommand: '--build_dir $(Build.BinariesDirectory) --skip_submodule_sync --build_shared_lib --enable_onnx_tests --enable_wcos --arm64 --use_telemetry --use_winml --cmake_generator "Visual Studio 16 2019"'
|
||||
BuildArch: 'x64'
|
||||
EnvSetupScript: 'setup_env.bat'
|
||||
sln_platform: 'arm64'
|
||||
DoDebugBuild: 'false'
|
||||
DoNugetPack : 'true'
|
||||
DoCompliance: ${{ parameters.DoCompliance }}
|
||||
DoEsrp: ${{ parameters.DoEsrp }}
|
||||
OrtPackageId: 'Microsoft.ML.OnnxRuntime.NoOpenMP'
|
||||
NuPackScript: |
|
||||
msbuild $(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.proj /p:Configuration=RelWithDebInfo /p:TargetArchitecture=arm64 /p:ProtocDirectory=$(Build.BinariesDirectory)\host_protoc\Release /t:CreatePackage /p:OrtPackageId=Microsoft.ML.OnnxRuntime.NoOpenMP
|
||||
cd $(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo\
|
||||
ren *.nupkg win-arm64.zip
|
||||
copy $(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo\*zip $(Build.ArtifactStagingDirectory)
|
||||
mkdir $(Build.ArtifactStagingDirectory)\testdata
|
||||
copy $(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo\custom_op_library.* $(Build.ArtifactStagingDirectory)\testdata
|
||||
|
||||
- template: ../../templates/win-ci-2019.yml
|
||||
parameters:
|
||||
AgentPool : 'Win-CPU-2019'
|
||||
ArtifactName: 'drop-win-arm-zip'
|
||||
JobName: 'Windows_CI_Dev_arm'
|
||||
BuildCommand: '--build_dir $(Build.BinariesDirectory) --skip_submodule_sync --build_shared_lib --enable_onnx_tests --enable_wcos --arm --use_telemetry --use_winml --cmake_generator "Visual Studio 16 2019"'
|
||||
BuildArch: 'x64'
|
||||
EnvSetupScript: 'setup_env.bat'
|
||||
sln_platform: 'arm'
|
||||
DoDebugBuild: 'false'
|
||||
DoNugetPack : 'true'
|
||||
DoCompliance: ${{ parameters.DoCompliance }}
|
||||
DoEsrp: ${{ parameters.DoEsrp }}
|
||||
OrtPackageId: 'Microsoft.ML.OnnxRuntime.NoOpenMP'
|
||||
NuPackScript: |
|
||||
msbuild $(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.proj /p:Configuration=RelWithDebInfo /p:TargetArchitecture=arm /p:ProtocDirectory=$(Build.BinariesDirectory)\host_protoc\Release /t:CreatePackage /p:OrtPackageId=Microsoft.ML.OnnxRuntime.NoOpenMP
|
||||
cd $(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo\
|
||||
ren *.nupkg win-arm.zip
|
||||
copy $(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo\*zip $(Build.ArtifactStagingDirectory)
|
||||
mkdir $(Build.ArtifactStagingDirectory)\testdata
|
||||
copy $(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo\custom_op_library.* $(Build.ArtifactStagingDirectory)\testdata
|
||||
|
||||
- job: 'Linux_CI_Dev'
|
||||
workspace:
|
||||
clean: all
|
||||
timeoutInMinutes: 120
|
||||
pool: $(AgentPoolLinux)
|
||||
steps:
|
||||
- template: ../../templates/set-version-number-variables-step.yml
|
||||
- template: ../../templates/linux-set-variables-and-download.yml
|
||||
- task: Docker@2
|
||||
displayName: login
|
||||
inputs:
|
||||
containerRegistry: onnxruntimeregistry
|
||||
command: login
|
||||
addPipelineData: false
|
||||
- task: CmdLine@2
|
||||
inputs:
|
||||
script: |
|
||||
mkdir -p $HOME/.onnx
|
||||
docker run --rm --volume /data/onnx:/data/onnx:ro --volume $(Build.SourcesDirectory):/onnxruntime_src --volume $(Build.BinariesDirectory):/build --volume /data/models:/build/models:ro --volume $HOME/.onnx:/home/onnxruntimedev/.onnx -e NIGHTLY_BUILD onnxruntimeregistry.azurecr.io/internal/azureml/onnxruntimecentoscpubuild:chaq /bin/bash -c "python3 /onnxruntime_src/tools/ci_build/build.py --build_dir /build --config Release --skip_submodule_sync --parallel --build_shared_lib --enable_onnx_tests && cd /build/Release && make install DESTDIR=/build/linux-x64"
|
||||
workingDirectory: $(Build.SourcesDirectory)
|
||||
- task: Docker@2
|
||||
displayName: logout
|
||||
inputs:
|
||||
containerRegistry: onnxruntimeregistry
|
||||
command: logout
|
||||
addPipelineData: false
|
||||
- script: |
|
||||
set -e -x
|
||||
mv $(Build.BinariesDirectory)/linux-x64/usr/local/lib64 $(Build.BinariesDirectory)/linux-x64/linux-x64
|
||||
cd $(Build.BinariesDirectory)/linux-x64
|
||||
zip -r linux-x64.zip linux-x64
|
||||
cp $(Build.BinariesDirectory)/linux-x64/linux*.zip $(Build.ArtifactStagingDirectory)
|
||||
mkdir $(Build.ArtifactStagingDirectory)/testdata
|
||||
cp $(Build.BinariesDirectory)/Release/libcustom_op_library.so* $(Build.ArtifactStagingDirectory)/testdata
|
||||
ls -al $(Build.ArtifactStagingDirectory)
|
||||
displayName: 'Create Artifacts'
|
||||
- task: PublishPipelineArtifact@0
|
||||
displayName: 'Publish Pipeline Artifact'
|
||||
inputs:
|
||||
artifactName: 'drop-linux'
|
||||
targetPath: '$(Build.ArtifactStagingDirectory)'
|
||||
- template: ../../templates/component-governance-component-detection-steps.yml
|
||||
parameters :
|
||||
condition : 'succeeded'
|
||||
- template: ../../templates/clean-agent-build-directory-step.yml
|
||||
|
||||
- template: ../../templates/mac-ci.yml
|
||||
parameters:
|
||||
AgentPool : $(AgentPoolMacOS)
|
||||
JobName: 'MacOS_CI_Dev'
|
||||
BuildCommand: 'python3 $(Build.SourcesDirectory)/tools/ci_build/build.py --build_dir $(Build.BinariesDirectory) --skip_submodule_sync --parallel --build_shared_lib --config RelWithDebInfo'
|
||||
DoNugetPack : 'true'
|
||||
NuPackScript: |
|
||||
set -e -x
|
||||
mkdir $(Build.BinariesDirectory)/osx-x64
|
||||
find $(Build.BinariesDirectory)
|
||||
cp $(Build.BinariesDirectory)/RelWithDebInfo/libonnxruntime.dylib $(Build.BinariesDirectory)/osx-x64/
|
||||
dsymutil $(Build.BinariesDirectory)/osx-x64/libonnxruntime.dylib -o $(Build.BinariesDirectory)/osx-x64/libonnxruntime.dylib.dSYM
|
||||
strip -S -x $(Build.BinariesDirectory)/osx-x64/libonnxruntime.dylib
|
||||
find $(Build.BinariesDirectory)/osx-x64 -ls
|
||||
cwd=`pwd`
|
||||
cd $(Build.BinariesDirectory)
|
||||
zip -r osx-x64.zip osx-x64
|
||||
cp $(Build.BinariesDirectory)/osx-x64.zip $(Build.ArtifactStagingDirectory)
|
||||
mkdir $(Build.ArtifactStagingDirectory)/testdata
|
||||
cp $(Build.BinariesDirectory)/RelWithDebInfo/libcustom_op_library.dylib $(Build.ArtifactStagingDirectory)/testdata
|
||||
cd $cwd
|
||||
|
||||
- job: NuGet_Packaging
|
||||
workspace:
|
||||
clean: all
|
||||
pool: 'Win-CPU-2019'
|
||||
dependsOn:
|
||||
- Windows_CI_Dev
|
||||
- Windows_CI_Dev_x86
|
||||
- Linux_CI_Dev
|
||||
- MacOS_CI_Dev
|
||||
condition: succeeded()
|
||||
steps:
|
||||
|
||||
- task: DownloadPipelineArtifact@0
|
||||
displayName: 'Download Pipeline Artifact - NuGet'
|
||||
inputs:
|
||||
artifactName: 'drop-nuget'
|
||||
targetPath: '$(Build.BinariesDirectory)/nuget-artifact'
|
||||
|
||||
|
||||
- task: DownloadPipelineArtifact@0
|
||||
displayName: 'Download Pipeline Artifact - Win-x86'
|
||||
inputs:
|
||||
artifactName: 'drop-win-x86-zip'
|
||||
targetPath: '$(Build.BinariesDirectory)/nuget-artifact'
|
||||
|
||||
- task: DownloadPipelineArtifact@0
|
||||
displayName: 'Download Pipeline Artifact - Win-arm64'
|
||||
inputs:
|
||||
artifactName: 'drop-win-arm64-zip'
|
||||
targetPath: '$(Build.BinariesDirectory)/nuget-artifact'
|
||||
|
||||
- task: DownloadPipelineArtifact@0
|
||||
displayName: 'Download Pipeline Artifact - Win-arm'
|
||||
inputs:
|
||||
artifactName: 'drop-win-arm-zip'
|
||||
targetPath: '$(Build.BinariesDirectory)/nuget-artifact'
|
||||
|
||||
- task: DownloadPipelineArtifact@0
|
||||
displayName: 'Download Pipeline Artifact - Linux'
|
||||
inputs:
|
||||
artifactName: 'drop-linux'
|
||||
targetPath: '$(Build.BinariesDirectory)/nuget-artifact'
|
||||
|
||||
- task: DownloadPipelineArtifact@0
|
||||
displayName: 'Download Pipeline Artifact - MacOS'
|
||||
inputs:
|
||||
artifactName: 'drop-osx'
|
||||
targetPath: '$(Build.BinariesDirectory)/nuget-artifact'
|
||||
|
||||
- template: bundle_dlls.yml
|
||||
|
||||
- template: ../../templates/esrp_nuget.yml
|
||||
parameters:
|
||||
DisplayName: 'ESRP - sign NuGet package'
|
||||
FolderPath: '$(Build.ArtifactStagingDirectory)'
|
||||
DoEsrp: ${{ parameters.DoEsrp }}
|
||||
|
||||
- template: ../../templates/validate-nuget.yml
|
||||
parameters:
|
||||
NugetPath: '$(Build.ArtifactStagingDirectory)'
|
||||
NugetPackage: 'Microsoft.ML.OnnxRuntime.NoOpenMP*nupkg'
|
||||
PlatformsSupported: 'win-x64,win-x86,linux-x64,osx-x64'
|
||||
VerifyNugetSigning: ${{ parameters.DoEsrp }}
|
||||
|
||||
- task: PublishPipelineArtifact@0
|
||||
displayName: 'Publish Pipeline NuGet Artifact'
|
||||
inputs:
|
||||
artifactName: 'drop-signed-nuget'
|
||||
targetPath: '$(Build.ArtifactStagingDirectory)'
|
||||
|
||||
- task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3
|
||||
displayName: 'Clean Agent Directories'
|
||||
condition: always()
|
||||
|
||||
- template: test_all_os.yml
|
||||
|
||||
- job: Publish_NuGet_Package_And_Report
|
||||
workspace:
|
||||
clean: all
|
||||
variables:
|
||||
- group: Dashboard_MySQL_Secret
|
||||
- name: GDN_CODESIGN_TARGETDIRECTORY
|
||||
value: '$(Build.BinariesDirectory)/nuget-artifact/final-package'
|
||||
pool: 'Win-CPU-2019'
|
||||
condition: and (succeeded(), and (${{ parameters.DoEsrp }}, eq(variables['Build.SourceBranch'], 'refs/heads/master')))
|
||||
dependsOn:
|
||||
- NuGet_Test_Win
|
||||
- NuGet_Test_Linux
|
||||
- NuGet_Test_MacOS
|
||||
steps:
|
||||
|
||||
- template: ../../templates/set-version-number-variables-step.yml
|
||||
|
||||
- template: upload-binary-sizes-from-nuget-package.yml
|
||||
parameters:
|
||||
downloadPath: $(Build.BinariesDirectory)/nuget-artifact/final-package
|
||||
gitCommitHash: $(OnnxRuntimeGitCommitHashShort)
|
||||
|
||||
- template: get-nuget-package-version-as-variable.yml
|
||||
parameters:
|
||||
packageFolder: '$(Build.BinariesDirectory)/nuget-artifact/final-package'
|
||||
|
||||
- task: PowerShell@2
|
||||
displayName: 'Get Current Date'
|
||||
inputs:
|
||||
targetType: 'inline'
|
||||
script: |
|
||||
$date = $(Get-Date -Format "yyyy-MM-dd")
|
||||
Write-Host "##vso[task.setvariable variable=CurrentDate]$date"
|
||||
|
||||
- task: AzureFileCopy@3
|
||||
displayName: 'Copy Signed Native NuGet Package to Blob Store'
|
||||
condition: ne(variables['IsReleaseBuild'], 'true') # release build has a different package naming scheme
|
||||
inputs:
|
||||
sourcePath: '$(Build.BinariesDirectory)/nuget-artifact/final-package/Microsoft.ML.OnnxRuntime.NoOpenMP.$(NuGetPackageVersionNumber).nupkg'
|
||||
azureSubscription: 'AIInfraBuildOnnxRuntimeOSS'
|
||||
destination: azureBlob
|
||||
storage: ortpackages
|
||||
containerName: ortpackages
|
||||
blobPrefix: '$(CurrentDate)/'
|
||||
continueOnError: true
|
||||
|
||||
- task: AzureFileCopy@3
|
||||
displayName: 'Copy Signed Managed NuGet Package to Blob Store'
|
||||
condition: ne(variables['IsReleaseBuild'], 'true') # release build has a different package naming scheme
|
||||
inputs:
|
||||
sourcePath: '$(Build.BinariesDirectory)/nuget-artifact/final-package/Microsoft.ML.OnnxRuntime.Managed.$(NuGetPackageVersionNumber).nupkg'
|
||||
azureSubscription: 'AIInfraBuildOnnxRuntimeOSS'
|
||||
destination: azureBlob
|
||||
storage: ortpackages
|
||||
containerName: ortpackages
|
||||
blobPrefix: '$(CurrentDate)/'
|
||||
continueOnError: true
|
||||
|
||||
- task: DotNetCoreCLI@2
|
||||
displayName: 'Copy Signed Native NuGet Package to Internal NuGet Feed'
|
||||
condition: ne(variables['IsReleaseBuild'], 'true') # release build has a different package naming scheme
|
||||
inputs:
|
||||
command: 'push'
|
||||
searchPatternPush: '$(Build.BinariesDirectory)/nuget-artifact/final-package/Microsoft.ML.OnnxRuntime.NoOpenMP.$(NuGetPackageVersionNumber).nupkg'
|
||||
feedPublish: 'OnnxRuntime'
|
||||
|
||||
- task: DotNetCoreCLI@2
|
||||
displayName: 'Copy Signed Managed NuGet Package to Internal NuGet Feed'
|
||||
condition: ne(variables['IsReleaseBuild'], 'true') # release build has a different package naming scheme
|
||||
inputs:
|
||||
command: 'push'
|
||||
searchPatternPush: '$(Build.BinariesDirectory)/nuget-artifact/final-package/Microsoft.ML.OnnxRuntime.Managed.$(NuGetPackageVersionNumber).nupkg'
|
||||
feedPublish: 'OnnxRuntime'
|
||||
|
||||
- task: NuGetCommand@2
|
||||
displayName: 'Copy Signed Native NuGet Package to ORT-NIGHTLY'
|
||||
condition: ne(variables['IsReleaseBuild'], 'true') # release build has a different package naming scheme
|
||||
inputs:
|
||||
command: 'push'
|
||||
packagesToPush: '$(Build.BinariesDirectory)/nuget-artifact/final-package/Microsoft.ML.OnnxRuntime.NoOpenMP.$(NuGetPackageVersionNumber).nupkg'
|
||||
publishVstsFeed: '2692857e-05ef-43b4-ba9c-ccf1c22c437c/7982ae20-ed19-4a35-a362-a96ac99897b7'
|
||||
|
||||
- task: NuGetCommand@2
|
||||
displayName: 'Copy Signed Managed NuGet Package to ORT-NIGHTLY'
|
||||
condition: ne(variables['IsReleaseBuild'], 'true') # release build has a different package naming scheme
|
||||
inputs:
|
||||
command: 'push'
|
||||
packagesToPush: '$(Build.BinariesDirectory)/nuget-artifact/final-package/Microsoft.ML.OnnxRuntime.Managed.$(NuGetPackageVersionNumber).nupkg'
|
||||
publishVstsFeed: '2692857e-05ef-43b4-ba9c-ccf1c22c437c/7982ae20-ed19-4a35-a362-a96ac99897b7'
|
||||
|
||||
- task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3
|
||||
displayName: 'Clean Agent Directories'
|
||||
condition: always()
|
||||
|
|
@ -162,7 +162,7 @@ def generate_metadata(list, args):
|
|||
def generate_files(list, args):
|
||||
files_list = ['<files>']
|
||||
|
||||
is_cpu_package = args.package_name == 'Microsoft.ML.OnnxRuntime'
|
||||
is_cpu_package = args.package_name in ['Microsoft.ML.OnnxRuntime', 'Microsoft.ML.OnnxRuntime.NoOpenMP']
|
||||
is_mklml_package = args.package_name == 'Microsoft.ML.OnnxRuntime.MKLML'
|
||||
is_cuda_gpu_package = args.package_name == 'Microsoft.ML.OnnxRuntime.Gpu'
|
||||
is_dml_package = args.package_name == 'Microsoft.ML.OnnxRuntime.DirectML'
|
||||
|
|
|
|||
Loading…
Reference in a new issue