onnxruntime/tools/ci_build/github/azure-pipelines/c-api-packaging-pipelines.yml
shahasad 51273b48f6 Use cuda9 1 in c api packaging (#571)
* use CUDA 9.1 for both linux and windows

* added powershell scripts for cuda props setup/cleanup

* fix yml syntax

* set path to cuda9.1 bin

* correct label

* ad --cuda_version

* added some log to browse the directory

* disabled jobs other than win gpu to save some resource while testing

* add msvc_toolset=14.11

* added more logs

* log the props file

* remove setting vcvarsall

* try some modificationi n build.py

* fix typo

* let the config Step modify envoronment

* set some more env vars manually

* try reordering vcvars after cuda props copying

* use single script for build and test

* single line script

* remove extra quote

* cleanup trial changes
2019-03-08 00:48:18 -08:00

179 lines
6.9 KiB
YAML

jobs:
- job: Linux_C_API_Packaging_CPU_x64
pool: Linux-CPU
steps:
- template: templates/set-test-data-variables-step.yml
- script: 'tools/ci_build/github/linux/run_dockerbuild.sh -o ubuntu16.04 -d cpu -r $(Build.BinariesDirectory) -x " --test_data_url $(TestDataUrl) --test_data_checksum $(TestDataChecksum)"'
displayName: 'Build and Test Linux on Docker'
- template: templates/c-api-artifacts-package-and-publish-steps-posix.yml
parameters:
buildConfig: 'Release'
artifactName: 'onnxruntime-linux-x64'
libraryName: 'libonnxruntime.so'
- template: templates/clean-agent-build-directory-step.yml
- job: Linux_C_API_Packaging_CPU_x86
pool: Linux-CPU
steps:
- template: templates/set-test-data-variables-step.yml
- script: 'tools/ci_build/github/linux/run_dockerbuild.sh -o ubuntu16.04 -d cpu -r $(Build.BinariesDirectory) -x " --x86 --test_data_url $(TestDataUrl) --test_data_checksum $(TestDataChecksum)"'
displayName: 'Build and Test Linux on Docker'
- template: templates/c-api-artifacts-package-and-publish-steps-posix.yml
parameters:
buildConfig: 'Release'
artifactName: 'onnxruntime-linux-x86'
libraryName: 'libonnxruntime.so'
- template: templates/clean-agent-build-directory-step.yml
- job: Linux_C_API_Packaging_GPU_x64
pool: Linux-GPU
steps:
- template: templates/set-test-data-variables-step.yml
- script: 'tools/ci_build/github/linux/run_dockerbuild.sh -o ubuntu16.04 -d gpu -c cuda9.1-cudnn7.1 -r $(Build.BinariesDirectory) -x " --test_data_url $(TestDataUrl) --test_data_checksum $(TestDataChecksum)"'
displayName: 'Build and Test Linux on Docker'
- template: templates/c-api-artifacts-package-and-publish-steps-posix.yml
parameters:
buildConfig: 'Release'
artifactName: 'onnxruntime-linux-x64-gpu'
libraryName: 'libonnxruntime.so'
- template: templates/clean-agent-build-directory-step.yml
- job: MacOS_C_API_Packaging_CPU_x64
pool:
vmImage: 'macOS-10.13'
steps:
- template: templates/set-test-data-variables-step.yml
- script: |
sudo xcode-select --switch /Applications/Xcode_10.app/Contents/Developer
python3 $(Build.SourcesDirectory)/tools/ci_build/build.py --use_openmp --build_dir $(Build.BinariesDirectory) --skip_submodule_sync --parallel --build_shared_lib --config RelWithDebInfo --enable_onnx_tests --test_data_url $(TestDataUrl) --test_data_checksum $(TestDataChecksum)
displayName: 'Build and Test MacOS'
- template: templates/c-api-artifacts-package-and-publish-steps-posix.yml
parameters:
buildConfig: 'RelWithDebInfo'
artifactName: 'onnxruntime-osx-x64'
libraryName: 'libonnxruntime.dylib'
- template: templates/clean-agent-build-directory-step.yml
- job: Windows_Packaging_CPU_x64
pool: 'Win-CPU'
variables:
buildDirectory: '$(Build.BinariesDirectory)'
buildConfig: 'RelWithDebInfo'
buildArch: 'x64'
steps:
- template: templates/set-test-data-variables-step.yml
- template: templates/windows-build-tools-setup-steps.yml
parameters:
EnvSetupScript: 'setup_env.bat'
buildArch: 'amd64' # amd64 is needed for vcvars target arch
setVcvars: false
- template: templates/windows-build-and-test-steps.yml
parameters:
buildAdditionalParams: ' --use_openmp '
buildArch: $(buildArch)
msbuildPlatform: $(buildArch)
buildConfig: $(buildConfig)
- template: templates/c-api-artifacts-package-and-publish-steps-windows.yml
parameters:
buildConfig: $(buildConfig)
artifactName: 'onnxruntime-win-$(buildArch)'
- template: templates/clean-agent-build-directory-step.yml
- job: Windows_Packaging_CPU_x86
pool: 'Win-CPU'
variables:
buildDirectory: '$(Build.BinariesDirectory)'
buildConfig: 'RelWithDebInfo'
buildArch: 'x86'
steps:
- template: templates/set-test-data-variables-step.yml
- template: templates/windows-build-tools-setup-steps.yml
parameters:
EnvSetupScript: 'setup_env.bat'
buildArch: $(buildArch)
setVcVars: false
- template: templates/windows-build-and-test-steps.yml
parameters:
buildAdditionalParams: ' --use_openmp --x86 '
buildArch: $(buildArch)
msbuildPlatform: 'Win32'
buildConfig: $(buildConfig)
- template: templates/c-api-artifacts-package-and-publish-steps-windows.yml
parameters:
buildConfig: $(buildConfig)
artifactName: 'onnxruntime-win-$(buildArch)'
- template: templates/clean-agent-build-directory-step.yml
- job: Windows_Packaging_GPU_x64
pool: 'Win-GPU'
variables:
buildDirectory: '$(Build.BinariesDirectory)'
buildConfig: 'RelWithDebInfo'
buildArch: 'x64'
steps:
- template: templates/set-test-data-variables-step.yml
- task: CmdLine@2
displayName: 'Set CUDA 9.1 path'
inputs:
script: |
set PATH=C:\local\cuda-9.1.85-windows10-x64-0\bin;C:\local\cudnn-9.1-windows10-x64-v7.1\cuda\bin;%PATH%
modifyEnvironment: true
workingDirectory: '$(Build.BinariesDirectory)'
- task: PowerShell@2
displayName: 'Set CUDA 9.1 MSBuild properties'
inputs:
targetType: 'filePath'
filePath: '$(Build.SourcesDirectory)/tools/ci_build/github/windows/set_cuda_path.ps1'
arguments: '-CudaMsbuildPath C:\local\cudaMsbuildIntegration-9.1.85-windows10-x64-0 -CudaVersion 9.1'
- template: templates/windows-build-tools-setup-steps.yml
parameters:
EnvSetupScript: 'setup_env.bat'
buildArch: 'amd64' # amd64 is needed for vcvars target arch
setVcvars: true
- task: CmdLine@2
displayName: 'Build and Test OnnxRuntime'
inputs:
script: |
$(Build.BinariesDirectory)\packages\python\python.exe $(Build.SourcesDirectory)\tools\ci_build\build.py --config $(buildConfig) --build_dir $(Build.BinariesDirectory) --skip_submodule_sync --build_shared_lib --cmake_path $(Build.BinariesDirectory)\cmake\bin\cmake.exe --ctest_path $(Build.BinariesDirectory)\cmake\bin\ctest.exe --enable_onnx_tests --test_data_url $(TestDataUrl) --test_data_checksum $(TestDataChecksum) --use_openmp --msvc_toolset=14.11 --use_cuda --cuda_version 9.1 --cuda_home="C:\local\cuda-9.1.85-windows10-x64-0" --cudnn_home="C:\local\cudnn-9.1-windows10-x64-v7.1\cuda"
workingDirectory: '$(Build.BinariesDirectory)'
- template: templates/c-api-artifacts-package-and-publish-steps-windows.yml
parameters:
buildConfig: $(buildConfig)
artifactName: 'onnxruntime-win-gpu-$(buildArch)'
- task: PowerShell@2
displayName: 'Clean up Cuda Path 9.1'
inputs:
targetType: 'filePath'
filePath: '$(Build.SourcesDirectory)/tools/ci_build/github/windows/clean_up_cuda_prop_files.ps1'
arguments: '-CudaVersion 9.1'
- template: templates/clean-agent-build-directory-step.yml