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
46 changes: 0 additions & 46 deletions .pipelines/templates/fetch-test-data-from-blob.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,54 +9,8 @@ parameters:
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) {
$azDir = Split-Path -Path (Get-Command az).Source -Parent
Write-Host "##vso[task.prependpath]$azDir"
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')
$azCommand = Get-Command az -ErrorAction SilentlyContinue
if (-not $azCommand) {
throw 'Azure CLI install was attempted but az is still not on PATH.'
}
Write-Host "##vso[task.prependpath]$(Split-Path -Path $azCommand.Source -Parent)"
az version | Write-Host

- task: AzureCLI@2
displayName: 'Fetch test data from blob'
Comment on lines 14 to 15
inputs:
Expand Down
3 changes: 2 additions & 1 deletion .pipelines/v2/templates/stages-build-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ stages:
- job: build
pool:
name: onnxruntime-native-arm64-16core
demands:
- ImageOverride -equals onnxruntime-Win2025-arm64
Comment on lines +70 to +71
os: windows
hostArchitecture: arm64
templateContext:
Expand All @@ -89,7 +91,6 @@ stages:
runTests: true
stageHeaders: false
pythonArchitecture: arm64
usePwsh: false

# ====================================================================
# Linux x64 — build + test
Expand Down
6 changes: 2 additions & 4 deletions .pipelines/v2/templates/stages-cs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,10 @@ stages:
- 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'
usePwsh: false

- stage: cs_test_win_arm64
displayName: 'C# SDK: Test Windows ARM64'
Expand All @@ -85,6 +83,8 @@ stages:
- job: test
pool:
name: onnxruntime-native-arm64-16core
demands:
- ImageOverride -equals onnxruntime-Win2025-arm64
os: windows
hostArchitecture: arm64
templateContext:
Expand All @@ -101,12 +101,10 @@ stages:
- 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'
usePwsh: false

# ====================================================================
# Test — Linux x64
Expand Down
6 changes: 4 additions & 2 deletions .pipelines/v2/templates/stages-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ stages:
- job: build
pool:
name: onnxruntime-native-arm64-16core
demands:
- ImageOverride -equals onnxruntime-Win2025-arm64
os: windows
hostArchitecture: arm64
variables:
Expand Down Expand Up @@ -223,6 +225,8 @@ stages:
- job: test
pool:
name: onnxruntime-native-arm64-16core
demands:
- ImageOverride -equals onnxruntime-Win2025-arm64
os: windows
hostArchitecture: arm64
templateContext:
Expand All @@ -236,13 +240,11 @@ stages:
- 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'
usePwsh: false

- stage: js_test_linux_x64
displayName: 'JS SDK: Test Linux x64'
Expand Down
6 changes: 4 additions & 2 deletions .pipelines/v2/templates/stages-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ stages:
- job: build
pool:
name: onnxruntime-native-arm64-16core
demands:
- ImageOverride -equals onnxruntime-Win2025-arm64
os: windows
hostArchitecture: arm64
templateContext:
Expand Down Expand Up @@ -214,6 +216,8 @@ stages:
- job: test
pool:
name: onnxruntime-native-arm64-16core
demands:
- ImageOverride -equals onnxruntime-Win2025-arm64
os: windows
hostArchitecture: arm64
templateContext:
Expand All @@ -227,13 +231,11 @@ stages:
- template: ../../templates/fetch-test-data-from-blob.yml@self
parameters:
scriptType: ps
installAzCli: true
- template: steps-test-python.yml
parameters:
wheelDir: '$(Pipeline.Workspace)/python-sdk-win-arm64'
testDataSharedDir: '$(Build.SourcesDirectory)/test-data-shared'
pythonArchitecture: 'arm64'
usePwsh: false

- stage: python_test_linux_x64
displayName: 'Python SDK: Test Linux x64'
Expand Down
96 changes: 8 additions & 88 deletions .pipelines/v2/templates/steps-build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# runTests – Whether to run tests
# stageHeaders – Whether to stage public headers as a separate artifact
# pythonArchitecture – Python architecture installed by UsePythonVersion
# usePwsh – Whether PowerShell tasks should use PowerShell Core

parameters:
- name: arch
Expand All @@ -37,9 +36,6 @@ parameters:
type: string
default: 'x64'
values: ['x64', 'arm64']
- name: usePwsh
type: boolean
default: true

steps:

Expand All @@ -66,72 +62,14 @@ steps:
winmlVersion: ${{ parameters.winmlVersion }}
includeWinml: true
shell: pwsh
usePwsh: ${{ parameters.usePwsh }}

- ${{ if eq(parameters.arch, 'arm64') }}:
- task: PowerShell@2
displayName: 'Ensure Visual Studio Build Tools and CMake for ARM64'
inputs:
targetType: inline
pwsh: ${{ parameters.usePwsh }}
script: |
$installRoot = 'C:\BuildTools'
$vcvars = Join-Path $installRoot 'VC\Auxiliary\Build\vcvarsall.bat'
$cmakeDir = Join-Path $installRoot 'Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin'
$cmakePath = Join-Path $cmakeDir 'cmake.exe'
$ctestPath = Join-Path $cmakeDir 'ctest.exe'

if (-not (Test-Path $vcvars) -or -not (Test-Path $cmakePath) -or -not (Test-Path $ctestPath)) {
Write-Host 'Visual Studio Build Tools not fully present. Installing...'
$bootstrapper = Join-Path $env:TEMP 'vs_BuildTools.exe'
Invoke-WebRequest -Uri 'https://aka.ms/vs/17/release/vs_BuildTools.exe' -OutFile $bootstrapper -UseBasicParsing

$arguments = @(
'--quiet',
'--wait',
'--norestart',
'--nocache',
'--installPath', $installRoot,
'--add', 'Microsoft.VisualStudio.Workload.VCTools',
'--add', 'Microsoft.VisualStudio.Component.VC.Tools.ARM64',
'--add', 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64',
'--add', 'Microsoft.VisualStudio.Component.VC.CMake.Project',
'--add', 'Microsoft.VisualStudio.Component.Windows11SDK.22621',
'--includeRecommended'
)

$process = Start-Process -FilePath $bootstrapper -ArgumentList $arguments -Wait -PassThru
if ($process.ExitCode -ne 0) {
throw "Visual Studio Build Tools install failed with exit code $($process.ExitCode)."
}
}

if (-not (Test-Path $vcvars)) {
throw "vcvarsall.bat was not found at $vcvars after Build Tools install."
}
if (-not (Test-Path $cmakePath)) {
throw "cmake.exe was not found at $cmakePath after Build Tools install."
}
if (-not (Test-Path $ctestPath)) {
throw "ctest.exe was not found at $ctestPath after Build Tools install."
}

Write-Host "##vso[task.prependpath]$cmakeDir"
Write-Host "vcvarsall.bat: $vcvars"
Write-Host "cmake.exe: $cmakePath"
Write-Host "ctest.exe: $ctestPath"
Write-Host "##vso[task.setvariable variable=vcvarsAllPath]$vcvars"
Write-Host "##vso[task.setvariable variable=cmakePath]$cmakePath"
Write-Host "##vso[task.setvariable variable=ctestPath]$ctestPath"


# Bake the pipeline-computed version into the binary so FoundryLocalGetVersionString()
# matches the .nupkg version (e.g. 0.1.0-dev.202605111234) instead of the cmake default.
- task: PowerShell@2
displayName: 'Append version define'
inputs:
targetType: inline
pwsh: ${{ parameters.usePwsh }}
pwsh: true
script: |
$version = (Get-Content "$(Pipeline.Workspace)/version-info/sdkVersion.txt" -Raw).Trim()
$defines = '$(cmakeFetchDefines)' + " `"FOUNDRY_LOCAL_VERSION_STRING=$version`""
Expand All @@ -144,7 +82,6 @@ steps:
parameters:
destinationPath: '$(Agent.BuildDirectory)/test-data-shared'
scriptType: ps
installAzCli: true

- ${{ if eq(parameters.arch, 'x64') }}:
- script: >-
Expand All @@ -162,14 +99,11 @@ steps:

- ${{ if eq(parameters.arch, 'arm64') }}:
- script: >-
call "$(vcvarsAllPath)" arm64 &&
python build.py
--configure --build --arm64
--config ${{ parameters.buildConfig }}
--cmake_generator "Visual Studio 17 2022"
--winml_sdk_version ${{ parameters.winmlVersion }}
--cmake_path "$(cmakePath)"
--ctest_path "$(ctestPath)"
--cmake_extra_defines $(cmakeFetchDefines)
displayName: 'Configure and build (arm64)'
workingDirectory: $(Build.SourcesDirectory)/sdk_v2/cpp
Expand All @@ -178,26 +112,12 @@ steps:
PKG_CONFIG: $(Build.BinariesDirectory)\tools\pkg-config.bat

- ${{ if eq(parameters.runTests, true) }}:
- ${{ if eq(parameters.arch, 'x64') }}:
- script: python build.py --test --config ${{ parameters.buildConfig }}
displayName: 'Run tests'
workingDirectory: $(Build.SourcesDirectory)/sdk_v2/cpp
env:
VCPKG_ROOT: $(Build.BinariesDirectory)\vcpkg
FOUNDRY_TEST_DATA_DIR: $(Agent.BuildDirectory)\test-data-shared

- ${{ if eq(parameters.arch, 'arm64') }}:
- script: >-
python build.py
--test
--config ${{ parameters.buildConfig }}
--cmake_path "$(cmakePath)"
--ctest_path "$(ctestPath)"
displayName: 'Run tests'
workingDirectory: $(Build.SourcesDirectory)/sdk_v2/cpp
env:
VCPKG_ROOT: $(Build.BinariesDirectory)\vcpkg
FOUNDRY_TEST_DATA_DIR: $(Agent.BuildDirectory)\test-data-shared
- script: python build.py --test --config ${{ parameters.buildConfig }}
displayName: 'Run tests'
workingDirectory: $(Build.SourcesDirectory)/sdk_v2/cpp
env:
VCPKG_ROOT: $(Build.BinariesDirectory)\vcpkg
FOUNDRY_TEST_DATA_DIR: $(Agent.BuildDirectory)\test-data-shared

# Stage the native build artifacts. The C++ SDK bundle consumes the co-located
# ORT/GenAI DLLs directly. Python wheel staging filters them out because its
Expand All @@ -206,7 +126,7 @@ steps:
displayName: 'Stage native artifacts'
inputs:
targetType: inline
pwsh: ${{ parameters.usePwsh }}
pwsh: true
script: |
$binDir = '$(Build.SourcesDirectory)/sdk_v2/cpp/build/Windows/${{ parameters.buildConfig }}/bin/${{ parameters.buildConfig }}'
$linkDir = '$(Build.SourcesDirectory)/sdk_v2/cpp/build/Windows/${{ parameters.buildConfig }}/${{ parameters.buildConfig }}'
Expand Down
8 changes: 2 additions & 6 deletions .pipelines/v2/templates/steps-prefetch-nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
# winmlVersion – Microsoft.Windows.AI.MachineLearning version (Windows only)
# includeWinml – Download WinML and emit WINML_EP_CATALOG_FETCH_URL
# shell – 'pwsh' (Windows/macOS) or 'bash' (Linux)
# usePwsh – Whether PowerShell tasks should use PowerShell Core

parameters:
- name: ortVersion
Expand All @@ -26,9 +25,6 @@ parameters:
- name: shell
type: string
values: ['pwsh', 'bash']
- name: usePwsh
type: boolean
default: true

steps:

Expand All @@ -38,7 +34,7 @@ steps:
displayName: 'Validate pinned versions match deps_versions.json'
inputs:
targetType: inline
pwsh: ${{ parameters.usePwsh }}
pwsh: true
script: |
$ErrorActionPreference = 'Stop'
$depsFile = Join-Path "$(Build.SourcesDirectory)" "sdk_v2/deps_versions.json"
Expand Down Expand Up @@ -70,7 +66,7 @@ steps:
displayName: 'Pre-download NuGet packages'
inputs:
targetType: inline
pwsh: ${{ parameters.usePwsh }}
pwsh: true
script: |
$ErrorActionPreference = 'Stop'
$cacheDir = "$(Build.BinariesDirectory)/nuget_packages"
Expand Down
Loading
Loading