Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
48 changes: 47 additions & 1 deletion .pipelines/templates/fetch-test-data-from-blob.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,59 @@ parameters:
- name: destinationPath
type: string
default: '$(Build.SourcesDirectory)/test-data-shared'
- name: scriptType
type: string
default: pscore
values: ['pscore', 'ps']
- name: installAzCli
type: boolean
default: false

steps:
- ${{ if eq(parameters.installAzCli, true) }}:
- task: PowerShell@2
displayName: 'Ensure Azure CLI is installed (Windows)'
condition: eq(variables['Agent.OS'], 'Windows_NT')
inputs:
targetType: inline
pwsh: false
script: |
$ErrorActionPreference = 'Stop'

if (Get-Command az -ErrorAction SilentlyContinue) {
az --version | Select-Object -First 1 | Write-Host
Write-Host 'Azure CLI already installed.'
exit 0
}

try {
$installerPath = Join-Path $env:TEMP 'azure-cli-installer.msi'
$installerUrl = 'https://aka.ms/installazurecliwindows'

Write-Host "Downloading Azure CLI installer from $installerUrl"
Invoke-WebRequest -Uri $installerUrl -OutFile $installerPath -UseBasicParsing

Write-Host 'Installing Azure CLI via MSI...'
$process = Start-Process -FilePath 'msiexec.exe' -ArgumentList "/i `"$installerPath`" /qn /norestart" -Wait -PassThru
if ($process.ExitCode -ne 0) {
throw "Azure CLI MSI install failed with exit code $($process.ExitCode)."
}
}
catch {
throw "Azure CLI install failed: $($_.Exception.Message)"
}

$env:PATH = [System.Environment]::GetEnvironmentVariable('Path', 'Machine') + ';' + [System.Environment]::GetEnvironmentVariable('Path', 'User')
if (-not (Get-Command az -ErrorAction SilentlyContinue)) {
throw 'Azure CLI install was attempted but az is still not on PATH.'
}
az --version | Select-Object -First 1 | Write-Host

- task: AzureCLI@2
displayName: 'Fetch test data from blob'
inputs:
azureSubscription: 'ortcibuild_readonly_mi2-ONNX Runtime-AIFoundryLocal'
scriptType: pscore
scriptType: ${{ parameters.scriptType }}
scriptLocation: inlineScript
inlineScript: |
$ErrorActionPreference = 'Stop'
Expand Down
9 changes: 6 additions & 3 deletions .pipelines/v2/templates/stages-build-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ stages:
stageHeaders: true

# ====================================================================
# Windows ARM64 — cross-compile only (no tests on x64 host)
# Windows ARM64 — build + test
# ====================================================================
- stage: cpp_build_win_arm64
displayName: 'C++ Native: Windows ARM64'
Expand All @@ -65,8 +65,9 @@ stages:
jobs:
- job: build
pool:
name: onnxruntime-Win-CPU-2022
name: onnxruntime-native-arm64-16core
os: windows
hostArchitecture: arm64
templateContext:
inputs:
- input: pipelineArtifact
Expand All @@ -84,8 +85,10 @@ stages:
ortVersion: ${{ parameters.ortVersion }}
genaiVersion: ${{ parameters.genaiVersion }}
winmlVersion: ${{ parameters.winmlVersion }}
runTests: false
runTests: true
stageHeaders: false
pythonArchitecture: arm64
usePwsh: false

# ====================================================================
# Linux x64 — build + test
Expand Down
33 changes: 33 additions & 0 deletions .pipelines/v2/templates/stages-cs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,39 @@ stages:
- checkout: self
clean: true
- template: ../../templates/fetch-test-data-from-blob.yml@self
parameters:
scriptType: ps
installAzCli: true
- template: steps-test-cs.yml
parameters:
flNugetDir: '$(Pipeline.Workspace)/cpp-nuget'
testDataSharedDir: '$(Build.SourcesDirectory)/test-data-shared'

- stage: cs_test_win_arm64
displayName: 'C# SDK: Test Windows ARM64'
dependsOn:
- cs_build
jobs:
- job: test
pool:
name: onnxruntime-native-arm64-16core
os: windows
hostArchitecture: arm64
templateContext:
inputs:
- input: pipelineArtifact
artifactName: 'version-info'
targetPath: '$(Pipeline.Workspace)/version-info'
- input: pipelineArtifact
artifactName: 'cpp-nuget'
targetPath: '$(Pipeline.Workspace)/cpp-nuget'
steps:
- checkout: self
clean: true
- template: ../../templates/fetch-test-data-from-blob.yml@self
parameters:
scriptType: ps
installAzCli: true
- template: steps-test-cs.yml
parameters:
flNugetDir: '$(Pipeline.Workspace)/cpp-nuget'
Expand Down
41 changes: 34 additions & 7 deletions .pipelines/v2/templates/stages-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
# * cpp_build_win_x64 (the cpp-native-include artifact, which is
# stage-headers-only on the win-x64 build)
#
# Tests run on the same platform as the build, except win-arm64 (no
# Windows-ARM64 pool; build-only, matching the C# + Python matrices).
# Tests run on the same platform as the build.

stages:

Expand Down Expand Up @@ -69,8 +68,9 @@ stages:
jobs:
- job: build
pool:
name: onnxruntime-Win-CPU-2022
name: onnxruntime-native-arm64-16core
os: windows
hostArchitecture: arm64
variables:
- group: FoundryLocal-ESRP-Signing
templateContext:
Expand All @@ -97,7 +97,6 @@ stages:
nativeArtifactDir: '$(Pipeline.Workspace)/cpp-native-win-arm64'
includeArtifactDir: '$(Pipeline.Workspace)/cpp-native-include'
outputDir: '$(Build.ArtifactStagingDirectory)/js-prebuild'
targetArch: 'arm64'
signWindows: true

- stage: js_build_linux_x64
Expand Down Expand Up @@ -177,9 +176,9 @@ stages:
outputDir: '$(Build.ArtifactStagingDirectory)/js-prebuild'
signMac: true

# =====================================================================
# Test stages — same-platform only. win-arm64 is build-only.
# =====================================================================
# ================================================================
# Test stages — same-platform only (including native win-arm64).
# ================================================================

- stage: js_test_win_x64
displayName: 'JS SDK: Test Windows x64'
Expand All @@ -205,6 +204,34 @@ stages:
prebuildArtifactDir: '$(Pipeline.Workspace)/js-prebuild-win-x64'
testDataSharedDir: '$(Build.SourcesDirectory)/test-data-shared'

- stage: js_test_win_arm64
displayName: 'JS SDK: Test Windows ARM64'
dependsOn:
- js_build_win_arm64
jobs:
- job: test
pool:
name: onnxruntime-native-arm64-16core
os: windows
hostArchitecture: arm64
templateContext:
inputs:
- input: pipelineArtifact
artifactName: 'js-prebuild-win-arm64'
targetPath: '$(Pipeline.Workspace)/js-prebuild-win-arm64'
steps:
- checkout: self
clean: true
- template: ../../templates/fetch-test-data-from-blob.yml@self
parameters:
scriptType: ps
installAzCli: true
- template: steps-test-js.yml
parameters:
rid: 'win-arm64'
prebuildArtifactDir: '$(Pipeline.Workspace)/js-prebuild-win-arm64'
testDataSharedDir: '$(Build.SourcesDirectory)/test-data-shared'

- stage: js_test_linux_x64
displayName: 'JS SDK: Test Linux x64'
dependsOn:
Expand Down
42 changes: 35 additions & 7 deletions .pipelines/v2/templates/stages-python.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Build + test stages for the sdk_v2 Python SDK (foundry-local-sdk).
#
# Builds win-x64 + win-arm64 + linux-x64 + osx-arm64; tests win-x64 + linux-x64
# + osx-arm64 (win-arm64 is build-only, matching the C# matrix).
# Builds win-x64 + win-arm64 + linux-x64 + osx-arm64; tests win-x64 +
# win-arm64 + linux-x64 + osx-arm64.
#
# Each build stage depends on the matching native build stage from
# stages-build-native.yml and consumes the `cpp-native-<rid>` pipeline artifact
Expand Down Expand Up @@ -55,8 +55,9 @@ stages:
jobs:
- job: build
pool:
name: onnxruntime-Win-CPU-2022
name: onnxruntime-native-arm64-16core
os: windows
hostArchitecture: arm64
templateContext:
inputs:
- input: pipelineArtifact
Expand All @@ -76,7 +77,7 @@ stages:
parameters:
nativeArtifactDir: '$(Pipeline.Workspace)/cpp-native-win-arm64'
rid: 'win-arm64'
targetArch: 'arm64'
pythonArchitecture: 'arm64'
outputDir: '$(Build.ArtifactStagingDirectory)/python-sdk'

- stage: python_build_linux_x64
Expand Down Expand Up @@ -144,9 +145,9 @@ stages:
pythonArchitecture: 'arm64'
outputDir: '$(Build.ArtifactStagingDirectory)/python-sdk'

# =================================================================
# Tests — win-x64, linux-x64, osx-arm64. win-arm64 is build-only.
# =================================================================
# ======================================================
# Tests — win-x64, win-arm64, linux-x64, osx-arm64.
# ======================================================
- stage: python_test_win_x64
displayName: 'Python SDK: Test Windows x64'
dependsOn:
Expand All @@ -172,6 +173,33 @@ stages:
wheelDir: '$(Pipeline.Workspace)/python-sdk-win-x64'
testDataSharedDir: '$(Build.SourcesDirectory)/test-data-shared'

- stage: python_test_win_arm64
displayName: 'Python SDK: Test Windows ARM64'
dependsOn:
- python_build_win_arm64
jobs:
- job: test
pool:
name: onnxruntime-native-arm64-16core
os: windows
hostArchitecture: arm64
templateContext:
inputs:
- input: pipelineArtifact
artifactName: 'python-sdk-win-arm64'
targetPath: '$(Pipeline.Workspace)/python-sdk-win-arm64'
steps:
- checkout: self
clean: true
- template: ../../templates/checkout-steps.yml@self
parameters:
repoName: test-data-shared
- template: steps-test-python.yml
parameters:
wheelDir: '$(Pipeline.Workspace)/python-sdk-win-arm64'
testDataSharedDir: '$(Build.SourcesDirectory)/test-data-shared'
pythonArchitecture: 'arm64'

- stage: python_test_linux_x64
displayName: 'Python SDK: Test Linux x64'
dependsOn:
Expand Down
2 changes: 1 addition & 1 deletion .pipelines/v2/templates/steps-build-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ parameters:
type: string
default: 'native'
values: ['native', 'arm64']
displayName: 'Cross-compile target arch for node-gyp on Windows x64 host. "native" = no cross.'
displayName: 'Optional node-gyp target arch override on Windows. "native" = host architecture.'
- name: signWindows
type: boolean
default: false
Expand Down
2 changes: 1 addition & 1 deletion .pipelines/v2/templates/steps-build-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ parameters:
type: string
default: 'native'
values: ['native', 'arm64']
displayName: 'Cross-compile target arch on a Windows x64 host. Use "native" for no cross-compile.'
displayName: 'Optional Windows wheel target arch override. Use "native" for host-native builds.'
- name: pythonArchitecture
type: string
default: 'x64'
Expand Down
Loading
Loading