Skip to content

Commit

Permalink
utilizing 1es on cuda package pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
jchen351 committed Oct 22, 2024
1 parent c64a98c commit def835b
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 56 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
trigger: none
# The `resources` specify the location and version of the 1ES PT.
resources:
repositories:
- repository: 1esPipelines
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release

extends:
# The pipeline extends the 1ES PT which will inject different SDL and compliance tasks.
# For non-production pipelines, use "Unofficial" as defined below.
# For productions pipelines, use "Official".
template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines

parameters:
- name: enable_linux_cuda
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ jobs:
- checkout: self
- task: DownloadPipelineArtifact@2
inputs:
artifact: 'drop-linux-gpu-x86_64'
targetPath: '$(Build.SourcesDirectory)/drop-linux-gpu-x86_64'
artifact: 'linux_gpu_wheel_x86_64'
targetPath: '$(Build.SourcesDirectory)/linux_gpu_wheel_x86_64'
${{ if ne(parameters.build_id, 'latest') }}:
buildType: 'specific'
project: '${{ parameters.project }}'
pipeline: '${{ parameters.pipeline }}'
buildVersionToDownload: 'specific'
buildId: '${{ parameters.build_id }}'
displayName: 'Download Build Artifacts - drop-linux-gpu-x86_64'
displayName: 'Download Build Artifacts - linux_gpu_wheel_x86_64'

- task: DownloadPipelineArtifact@2
inputs:
Expand All @@ -82,7 +82,7 @@ jobs:
- bash: |
set -e -x
ls $(Build.SourcesDirectory)
mv "$(Build.SourcesDirectory)/drop-linux-gpu-x86_64" $(Build.BinariesDirectory)/${{parameters.cmake_build_type}}
mv "$(Build.SourcesDirectory)/linux_gpu_wheel_x86_64" $(Build.BinariesDirectory)/${{parameters.cmake_build_type}}
mv "$(Build.SourcesDirectory)/onnxruntime_gpu" "$(Build.BinariesDirectory)/whl"
cp -r "$(Build.BinariesDirectory)/whl" $(Build.BinariesDirectory)/tmp
find "$(Build.BinariesDirectory)/tmp" -name '*.whl' -exec bash -c 'unzip -d "${1%.*}" "$1"' _ {} \;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@ parameters:
displayName: 'QNN SDK version. Only for QNN packages.'
default: 2.27.0.240926

- name: publish_symbols
type: boolean
default: false

stages:
- ${{ if eq(parameters.enable_windows_cpu, true) }}:
- stage: Python_Packaging_Windows_CPU
Expand Down Expand Up @@ -170,22 +166,10 @@ stages:
--enable_pybind
--enable_onnx_tests
${{ parameters.build_py_parameters }}
--parallel --use_binskim_compliant_compile_flags --update
--parallel --use_binskim_compliant_compile_flags --update --build
$(TelemetryOption)
workingDirectory: '$(Build.BinariesDirectory)'

- task: VSBuild@1
displayName: 'Build'
inputs:
solution: '$(Build.BinariesDirectory)\${{ parameters.cmake_build_type }}\onnxruntime.sln'
platform: $(MsbuildPlatform)
configuration: ${{ parameters.cmake_build_type }}
msbuildArchitecture: $(buildArch)
maximumCpuCount: true
logProjectEvents: true
workingFolder: '$(Build.BinariesDirectory)\${{ parameters.cmake_build_type }}'
createLogFile: true

# Esrp signing
- template: ../templates/win-esrp-dll.yml
parameters:
Expand Down Expand Up @@ -241,27 +225,6 @@ stages:
python onnx_backend_test_series.py
workingDirectory: '$(Build.BinariesDirectory)\${{ parameters.cmake_build_type }}\${{ parameters.cmake_build_type }}'
displayName: 'Run Python Tests'
- ${{ if eq(parameters.publish_symbols, true) }}:
- task: PublishSymbols@2
displayName: 'Publish symbols'
condition: and (succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), startsWith(variables['Build.SourceBranch'], 'refs/heads/rel-')))
inputs:
SymbolsFolder: '$(Build.BinariesDirectory)\${{ parameters.cmake_build_type }}\${{ parameters.cmake_build_type }}'
SearchPattern: |
onnxruntime_pybind11_state.pdb
onnxruntime_providers_shared.pdb
IndexSources: true
SymbolServerType: TeamServices
SymbolExpirationInDays: 3650
SymbolsArtifactName: 'win_cpu_$(PythonVersion)_$(buildArch)_$(Build.BuildNumber)'

- task: TSAUpload@2
displayName: 'TSA upload'
condition: and(and (succeeded(), and(eq(variables['buildArch'], 'x64'), eq(variables['PythonVersion'], '3.8'))), eq(variables['Build.SourceBranch'], 'refs/heads/main'))
inputs:
GdnPublishTsaOnboard: false
GdnPublishTsaConfigFile: '$(Build.sourcesDirectory)\.gdn\.gdntsa'
continueOnError: true
- template: ../templates/component-governance-component-detection-steps.yml
parameters:
Expand Down
45 changes: 33 additions & 12 deletions tools/ci_build/github/azure-pipelines/stages/py-linux-gpu-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,27 @@ stages:
timeoutInMinutes: 240
workspace:
clean: all
pool: ${{ parameters.machine_pool }}
pool:
name: ${{ parameters.machine_pool }}
os: linux
templateContext:
codeSignValidation:
enabled: true
break: true
psscriptanalyzer:
enabled: true
sdl:
binskim:
enabled: true
scanOutputDirectoryOnly: true
targetPathPattern: '\".*.so\"'
outputs:
- output: pipelineArtifact
targetPath: $(Build.ArtifactStagingDirectory)/dist
artifactName: onnxruntime_gpu
- output: pipelineArtifact
targetPath: $(Build.ArtifactStagingDirectory)/${{ parameters.cmake_build_type }}
artifactName: linux_gpu_wheel_${{ parameters.arch }}
variables:
# The build machine pool doesn't have dotnet, so it can't run CG.
- name: skipComponentGovernanceDetection
Expand Down Expand Up @@ -73,17 +93,18 @@ stages:
filePath: tools/ci_build/github/linux/run_python_dockerbuild.sh
arguments: -i onnxruntimecuda${{ replace(parameters.cuda_version, '.', '') }}xtrt86build${{ parameters.arch }} -d "GPU" -c ${{ parameters.cmake_build_type }} $(extra_build_args)

- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: ONNXRuntime python wheel'
inputs:
PathtoPublish: '$(Build.BinariesDirectory)/dist'
ArtifactName: onnxruntime_gpu

- task: PublishPipelineArtifact@0
displayName: 'Publish Test Binaries'
inputs:
artifactName: 'drop-linux-gpu-${{ parameters.arch }}'
targetPath: '$(Build.BinariesDirectory)/Release'
- script: |
set -e -x
mv $(Build.BinariesDirectory)/${{ parameters.cmake_build_type }} ./${{ parameters.cmake_build_type }}
mv $(Build.BinariesDirectory)/dist ./dist
pushd dist
find . -name \*.whl -exec unzip -qq -o {} \;
popd
pushd ${{ parameters.cmake_build_type }}
find . -name \*.whl -exec unzip -qq -o {} \;
popd
workingDirectory: '$(Build.ArtifactStagingDirectory)'
displayName: 'Move files'
- task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ jobs:
# The private ADO project
- ${{ if eq(variables['System.CollectionId'], 'bc038106-a83b-4dab-9dd3-5a41bc58f34c') }}:
- download: build # pipeline resource identifier.
artifact: 'drop-linux-gpu-${{ parameters.arch }}'
artifact: 'linux_gpu_wheel_${{ parameters.arch }}'

- download: build # pipeline resource identifier.
artifact: 'onnxruntime${{ parameters.python_wheel_suffix }}'

- bash: |
set -e -x
ls $(Pipeline.Workspace)/build
mv "$(Pipeline.Workspace)/build/drop-linux-gpu-${{ parameters.arch }}" $(Build.BinariesDirectory)/${{parameters.cmake_build_type}}
mv "$(Pipeline.Workspace)/build/linux_gpu_wheel_${{ parameters.arch }}" $(Build.BinariesDirectory)/${{parameters.cmake_build_type}}
mv "$(Pipeline.Workspace)/build/onnxruntime${{ parameters.python_wheel_suffix }}" "$(Build.BinariesDirectory)/whl"
cp -r "$(Build.BinariesDirectory)/whl" $(Build.BinariesDirectory)/tmp
find "$(Build.BinariesDirectory)/tmp" -name '*.whl' -exec bash -c 'unzip -d "${1%.*}" "$1"' _ {} \;
Expand Down

0 comments on commit def835b

Please sign in to comment.