Skip to content

Commit dcf8775

Browse files
authored
CUDA Plugin Packaging Pipeline Fix TSAUpload and Timeout (microsoft#28497)
Fix two errors: (1) TsaConfigFormatException: Unable to read the TsaOptions config file. The fix is to create .config/tsaoptions.json. We do not use git pull which can take up to 12 minutes. (2) Timeout in `Publish CUDA plugin metadata`: The job running on agent onnxruntime-Win-CPU-VS2022-Latest 1 ran longer than the maximum time of 5 minutes. The fix is to increase timeout to 15 mintues considering extra time needed for git pull in the previous fix. Test job: https://aiinfra.visualstudio.com/Lotus/_build/results?buildId=1217632&view=results
1 parent 0ebd8cc commit dcf8775

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

tools/ci_build/github/azure-pipelines/stages/plugin-cuda-packaging-stage.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ stages:
8080
jobs:
8181
- job: Publish_CUDA_Plugin_Metadata
8282
displayName: 'Publish CUDA plugin metadata'
83-
timeoutInMinutes: 5
83+
timeoutInMinutes: 15
8484
workspace:
8585
clean: all
8686
templateContext:
@@ -94,10 +94,19 @@ stages:
9494
- pwsh: |
9595
$ErrorActionPreference = 'Stop'
9696
97+
$tsaConfigDir = Join-Path '$(Build.SourcesDirectory)' '.config'
98+
$tsaConfigPath = Join-Path $tsaConfigDir 'tsaoptions.json'
99+
$tsaConfigUrl = 'https://raw.githubusercontent.com/microsoft/onnxruntime/$(Build.SourceVersion)/.config/tsaoptions.json'
97100
$metadataDir = Join-Path '$(Build.ArtifactStagingDirectory)' 'metadata'
98101
$metadataPath = Join-Path $metadataDir 'metadata.json'
102+
103+
New-Item -ItemType Directory -Path $tsaConfigDir -Force | Out-Null
99104
New-Item -ItemType Directory -Path $metadataDir -Force | Out-Null
100105
106+
# Guardian's TSA upload step still runs for this job, so fetch the exact config
107+
# file from the commit being packaged instead of doing a source checkout.
108+
Invoke-WebRequest -Uri $tsaConfigUrl -OutFile $tsaConfigPath
109+
101110
$metadata = [ordered]@{
102111
cuda_version = '${{ parameters.cuda_version }}'
103112
cuda_version_no_dot = '${{ replace(parameters.cuda_version, '.', '') }}'
@@ -108,8 +117,9 @@ stages:
108117
}
109118
110119
$metadata | ConvertTo-Json | Set-Content -Path $metadataPath -Encoding UTF8
120+
Get-Content $tsaConfigPath
111121
Get-Content $metadataPath
112-
displayName: 'Create metadata.json'
122+
displayName: 'Fetch TSA config and create metadata.json'
113123
114124
# Windows x64
115125
- ${{ if eq(parameters.build_windows_x64, true) }}:

0 commit comments

Comments
 (0)