Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ jobs:
--volume $(Build.BinariesDirectory):/build \
--volume /data/models:/build/models:ro \
--volume $HOME/.onnx:/home/onnxruntimedev/.onnx \
-e NPM_CONFIG_USERCONFIG=/tmp/.npmrc \
--volume "${NPM_CONFIG_USERCONFIG}:/tmp/.npmrc:ro" \
--volume $HOME/.m2:/home/onnxruntimedev/.m2:ro \
--volume $HOME/.gradle:/home/onnxruntimedev/.gradle \
-e ALLOW_RELEASED_ONNX_OPSET_ONLY=0 \
-e NIGHTLY_BUILD \
-e BUILD_BUILDNUMBER \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ stages:
- checkout: self
clean: true
submodules: recursive

- template: ../templates/setup-feeds-and-python-steps.yml

- template: ../templates/get-docker-image-steps.yml
parameters:
Dockerfile: tools/ci_build/github/linux/docker/inference/x86_64/default/cuda${{ variables.CUDA_VERSION_MAJOR }}/Dockerfile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ jobs:
set -e -x
mkdir -p $HOME/.onnx
docker run -e SYSTEM_COLLECTIONURI --rm --volume /data/onnx:/data/onnx:ro --volume $(Build.SourcesDirectory):/onnxruntime_src --volume $(Build.BinariesDirectory):/build \
-e NPM_CONFIG_USERCONFIG=/tmp/.npmrc \
--volume "${NPM_CONFIG_USERCONFIG}:/tmp/.npmrc:ro" \
--volume $HOME/.m2:/home/onnxruntimedev/.m2:ro \
--volume $HOME/.gradle:/home/onnxruntimedev/.gradle \
--volume $HOME/.onnx:/home/onnxruntimedev/.onnx -e NIGHTLY_BUILD onnxruntimecpubuildcentos8${{parameters.OnnxruntimeArch}}_packaging /bin/bash -c "python3 \
/onnxruntime_src/tools/ci_build/build.py --enable_lto --build_java --build_nodejs --build_dir /build --config Release \
--skip_submodule_sync --parallel --use_vcpkg --use_vcpkg_ms_internal_asset_cache --use_binskim_compliant_compile_flags --use_vcpkg --use_vcpkg_ms_internal_asset_cache --build_shared_lib ${{ parameters.AdditionalBuildFlags }} && cd /build/Release && make install DESTDIR=/build/installed"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Template for setting up the package feeds and installing python.
# Feeds configured:
# - pip
# - maven & gradle
# - npm
# - nuget
# - pip
#
# n.b. This template writes to user profile files.

Expand All @@ -26,6 +27,32 @@ steps:
- pwsh: if (Test-Path ~/.m2/settings.xml) { Remove-Item ~/.m2/settings.xml }
displayName: Maven - remove existing ~/.m2/settings.xml

# use `PowerShell@2` instead of `pwsh` as it is available on arm64 agents, whereas `pwsh` is not. (2026-04-15)
- task: PowerShell@2
displayName: 'NPM - set NPM_CONFIG_USERCONFIG to agent temp config'
env:
artifact_feed: ${{ parameters.artifactFeeds }}
inputs:
targetType: 'inline'
script: |
# ensure we have a clean/empty npm config. config file must exist prior to `npmAuthenticate`.
$npmrcPath = "${env:AGENT_TEMPDIRECTORY}/.npmrc"

Set-Content -Force -Path $npmrcPath -Value @"
registry=https://aiinfra.pkgs.visualstudio.com/_packaging/${env:artifact_feed}/npm/registry/
always-auth=true
"@

Write-Host "Generated npmrc contents:"
Get-Content $npmrcPath | Write-Host

echo "##vso[task.setvariable variable=NPM_CONFIG_USERCONFIG]${npmrcPath}"

# FUTURE WORK: use `Npm@1` task in pipelines and specify the feed there?
- task: npmAuthenticate@0
inputs:
workingFile: $(NPM_CONFIG_USERCONFIG)

- task: NuGetAuthenticate@1 # just auth w/ internal feeds

# Creates/touches ~/.m2/settings.xml
Expand Down
4 changes: 4 additions & 0 deletions tools/ci_build/github/linux/build_cuda_c_api_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@
fi

docker run -e SYSTEM_COLLECTIONURI --rm --volume \
$BUILD_SOURCESDIRECTORY:/onnxruntime_src --volume $BUILD_BINARIESDIRECTORY:/build \

Check warning on line 14 in tools/ci_build/github/linux/build_cuda_c_api_package.sh

View workflow job for this annotation

GitHub Actions / Optional Lint

[shellcheck] reported by reviewdog 🐶 Double quote to prevent globbing and word splitting. Raw Output: ./tools/ci_build/github/linux/build_cuda_c_api_package.sh:14:51: info: Double quote to prevent globbing and word splitting. (ShellCheck.SC2086)

Check warning on line 14 in tools/ci_build/github/linux/build_cuda_c_api_package.sh

View workflow job for this annotation

GitHub Actions / Optional Lint

[shellcheck] reported by reviewdog 🐶 Double quote to prevent globbing and word splitting. Raw Output: ./tools/ci_build/github/linux/build_cuda_c_api_package.sh:14:1: info: Double quote to prevent globbing and word splitting. (ShellCheck.SC2086)
-e NPM_CONFIG_USERCONFIG=/tmp/.npmrc \
--volume "${NPM_CONFIG_USERCONFIG}:/tmp/.npmrc:ro" \
--volume $HOME/.m2:/home/onnxruntimedev/.m2:ro \

Check warning on line 17 in tools/ci_build/github/linux/build_cuda_c_api_package.sh

View workflow job for this annotation

GitHub Actions / Optional Lint

[shellcheck] reported by reviewdog 🐶 Double quote to prevent globbing and word splitting. Raw Output: ./tools/ci_build/github/linux/build_cuda_c_api_package.sh:17:10: info: Double quote to prevent globbing and word splitting. (ShellCheck.SC2086)
--volume $HOME/.gradle:/home/onnxruntimedev/.gradle \

Check warning on line 18 in tools/ci_build/github/linux/build_cuda_c_api_package.sh

View workflow job for this annotation

GitHub Actions / Optional Lint

[shellcheck] reported by reviewdog 🐶 Double quote to prevent globbing and word splitting. Raw Output: ./tools/ci_build/github/linux/build_cuda_c_api_package.sh:18:10: info: Double quote to prevent globbing and word splitting. (ShellCheck.SC2086)
-e NIGHTLY_BUILD onnxruntimecuda${CUDA_VERSION_MAJOR}build \

Check warning on line 19 in tools/ci_build/github/linux/build_cuda_c_api_package.sh

View workflow job for this annotation

GitHub Actions / Optional Lint

[shellcheck] reported by reviewdog 🐶 Double quote to prevent globbing and word splitting. Raw Output: ./tools/ci_build/github/linux/build_cuda_c_api_package.sh:19:33: info: Double quote to prevent globbing and word splitting. (ShellCheck.SC2086)
/bin/bash -c "/usr/bin/python3 /onnxruntime_src/tools/ci_build/build.py --enable_lto --build_java --build_nodejs \
--build_dir /build --config Release --skip_submodule_sync --parallel --use_binskim_compliant_compile_flags --build_shared_lib \
--use_cuda --cuda_version=$CUDA_VERSION --cuda_home=/usr/local/cuda-$CUDA_VERSION --cudnn_home=/usr/local/cuda-$CUDA_VERSION \
Expand Down
4 changes: 4 additions & 0 deletions tools/ci_build/github/linux/build_nodejs_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@
exit 1
fi

mkdir -p $HOME/.onnx

Check warning on line 13 in tools/ci_build/github/linux/build_nodejs_package.sh

View workflow job for this annotation

GitHub Actions / Optional Lint

[shellcheck] reported by reviewdog 🐶 Double quote to prevent globbing and word splitting. Raw Output: ./tools/ci_build/github/linux/build_nodejs_package.sh:13:10: info: Double quote to prevent globbing and word splitting. (ShellCheck.SC2086)
docker run -e SYSTEM_COLLECTIONURI --rm --volume /data/onnx:/data/onnx:ro --volume $BUILD_SOURCESDIRECTORY:/onnxruntime_src \

Check warning on line 14 in tools/ci_build/github/linux/build_nodejs_package.sh

View workflow job for this annotation

GitHub Actions / Optional Lint

[shellcheck] reported by reviewdog 🐶 Double quote to prevent globbing and word splitting. Raw Output: ./tools/ci_build/github/linux/build_nodejs_package.sh:14:84: info: Double quote to prevent globbing and word splitting. (ShellCheck.SC2086)
--volume $BUILD_BINARIESDIRECTORY:/build --volume /data/models:/build/models:ro \
-e NPM_CONFIG_USERCONFIG=/tmp/.npmrc \
--volume "${NPM_CONFIG_USERCONFIG}:/tmp/.npmrc:ro" \
--volume $HOME/.m2:/home/onnxruntimedev/.m2:ro \
--volume $HOME/.gradle:/home/onnxruntimedev/.gradle \
--volume $HOME/.onnx:/home/onnxruntimedev/.onnx -e NIGHTLY_BUILD onnxruntimecuda${CUDA_VERSION_MAJOR}xtrt86build \
/bin/bash -c "/usr/bin/python3 /onnxruntime_src/tools/ci_build/build.py --build_dir /build --config Release \
--skip_tests --skip_submodule_sync --parallel --use_binskim_compliant_compile_flags --build_shared_lib --build_nodejs \
Expand Down
4 changes: 4 additions & 0 deletions tools/ci_build/github/linux/build_tensorrt_c_api_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ fi
mkdir -p $HOME/.onnx
docker run -e SYSTEM_COLLECTIONURI --rm --volume /data/onnx:/data/onnx:ro --volume $BUILD_SOURCESDIRECTORY:/onnxruntime_src \
--volume $BUILD_BINARIESDIRECTORY:/build --volume /data/models:/build/models:ro \
-e NPM_CONFIG_USERCONFIG=/tmp/.npmrc \
--volume "${NPM_CONFIG_USERCONFIG}:/tmp/.npmrc:ro" \
--volume $HOME/.m2:/home/onnxruntimedev/.m2:ro \
--volume $HOME/.gradle:/home/onnxruntimedev/.gradle \
--volume $HOME/.onnx:/home/onnxruntimedev/.onnx -e NIGHTLY_BUILD onnxruntimecuda${CUDA_VERSION_MAJOR}xtrt86build \
/bin/bash -c "/usr/bin/python3 /onnxruntime_src/tools/ci_build/build.py --build_dir /build --config Release --skip_tests \
--skip_submodule_sync --parallel --use_binskim_compliant_compile_flags --build_shared_lib --build_java --build_nodejs \
Expand Down
4 changes: 4 additions & 0 deletions tools/ci_build/github/linux/build_webgpu_plugin_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
--volume "${BUILD_BINARIESDIRECTORY}:/build" \
--volume /data/models:/build/models:ro \
--volume "${HOME}/.onnx:/home/onnxruntimedev/.onnx" \
-e NPM_CONFIG_USERCONFIG=/tmp/.npmrc \
--volume "${NPM_CONFIG_USERCONFIG}:/tmp/.npmrc:ro" \
--volume $HOME/.m2:/home/onnxruntimedev/.m2:ro \

Check warning on line 30 in tools/ci_build/github/linux/build_webgpu_plugin_package.sh

View workflow job for this annotation

GitHub Actions / Optional Lint

[shellcheck] reported by reviewdog 🐶 Double quote to prevent globbing and word splitting. Raw Output: ./tools/ci_build/github/linux/build_webgpu_plugin_package.sh:30:14: info: Double quote to prevent globbing and word splitting. (ShellCheck.SC2086)
--volume $HOME/.gradle:/home/onnxruntimedev/.gradle \

Check warning on line 31 in tools/ci_build/github/linux/build_webgpu_plugin_package.sh

View workflow job for this annotation

GitHub Actions / Optional Lint

[shellcheck] reported by reviewdog 🐶 Double quote to prevent globbing and word splitting. Raw Output: ./tools/ci_build/github/linux/build_webgpu_plugin_package.sh:31:14: info: Double quote to prevent globbing and word splitting. (ShellCheck.SC2086)
-e NIGHTLY_BUILD \
-e BUILD_BUILDNUMBER \
-e SYSTEM_COLLECTIONURI \
Expand Down
5 changes: 5 additions & 0 deletions tools/ci_build/github/linux/run_python_dockerbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,24 @@
DOCKER_SCRIPT_OPTIONS+=("-x" "${BUILD_EXTR_PAR}")
fi

# HACK: `ADDITIONAL_DOCKER_PARAMETER` is passed in via env in some pipelines
docker run -e SYSTEM_COLLECTIONURI --rm \
--volume /data/onnx:/data/onnx:ro \
--volume "${BUILD_SOURCESDIRECTORY}:/onnxruntime_src" \
--volume "${BUILD_BINARIESDIRECTORY}:/build" \
--volume /data/models:/build/models:ro \
--volume "${HOME}/.onnx:/home/onnxruntimedev/.onnx" \
-e NPM_CONFIG_USERCONFIG=/tmp/.npmrc \
--volume "${NPM_CONFIG_USERCONFIG}:/tmp/.npmrc:ro" \
--volume "$HOME/.m2:/home/onnxruntimedev/.m2:ro" \
--volume "$HOME/.gradle:/home/onnxruntimedev/.gradle" \
-w /onnxruntime_src \
-e NIGHTLY_BUILD \
-e BUILD_BUILDNUMBER \
-e ORT_DISABLE_PYTHON_PACKAGE_LOCAL_VERSION \
-e DEFAULT_TRAINING_PACKAGE_DEVICE \
-e CUDA_VERSION \
$ADDITIONAL_DOCKER_PARAMETER \

Check warning on line 47 in tools/ci_build/github/linux/run_python_dockerbuild.sh

View workflow job for this annotation

GitHub Actions / Optional Lint

[shellcheck] reported by reviewdog 🐶 Double quote to prevent globbing and word splitting. Raw Output: ./tools/ci_build/github/linux/run_python_dockerbuild.sh:47:5: info: Double quote to prevent globbing and word splitting. (ShellCheck.SC2086)
"$DOCKER_IMAGE" tools/ci_build/github/linux/build_linux_python_package.sh "${DOCKER_SCRIPT_OPTIONS[@]}"

sudo rm -rf "${BUILD_BINARIESDIRECTORY}/${BUILD_CONFIG}/onnxruntime" "${BUILD_BINARIESDIRECTORY}/${BUILD_CONFIG}/pybind11" \
Expand Down
50 changes: 29 additions & 21 deletions tools/ci_build/github/linux/run_python_dockertest.sh
Original file line number Diff line number Diff line change
@@ -1,29 +1,37 @@
#!/bin/bash
set -e -x
set -xeuo pipefail
BUILD_CONFIG="Release"

while getopts "i:d:x:c:" parameter_Option
do case "${parameter_Option}"
in
i) DOCKER_IMAGE=${OPTARG};;
d) DEVICE=${OPTARG};;
c) BUILD_CONFIG=${OPTARG};;
esac
while getopts "i:d:c:" parameter_Option; do
case "${parameter_Option}" in
i) DOCKER_IMAGE=${OPTARG} ;;
d) DEVICE=${OPTARG} ;;
c) BUILD_CONFIG=${OPTARG} ;;
*)
echo "Usage: $0 -i <docker_image> -d <GPU|CPU> [-c <build_config>]"
exit 1
;;
esac
done

if [ $DEVICE = "GPU" ]; then
ADDITIONAL_DOCKER_PARAMETER="--gpus all"
ADDITIONAL_DOCKER_PARAMETERS=()
if [ "$DEVICE" = "GPU" ]; then
ADDITIONAL_DOCKER_PARAMETERS+=("--gpus" "all")
fi

mkdir -p $HOME/.onnx
mkdir -p "$HOME/.onnx"
docker run -e SYSTEM_COLLECTIONURI --rm \
--volume /data/onnx:/data/onnx:ro \
--volume $BUILD_SOURCESDIRECTORY:/onnxruntime_src \
--volume $BUILD_BINARIESDIRECTORY:/build \
--volume /data/models:/build/models:ro \
--volume $HOME/.onnx:/home/onnxruntimedev/.onnx \
-w /onnxruntime_src \
-e NIGHTLY_BUILD \
-e BUILD_BUILDNUMBER \
$ADDITIONAL_DOCKER_PARAMETER \
$DOCKER_IMAGE tools/ci_build/github/linux/run_python_tests.sh -d $DEVICE -c $BUILD_CONFIG
--volume /data/onnx:/data/onnx:ro \
--volume "$BUILD_SOURCESDIRECTORY:/onnxruntime_src" \
--volume "$BUILD_BINARIESDIRECTORY:/build" \
--volume /data/models:/build/models:ro \
--volume "$HOME/.onnx:/home/onnxruntimedev/.onnx" \
-e NPM_CONFIG_USERCONFIG=/tmp/.npmrc \
--volume "${NPM_CONFIG_USERCONFIG}:/tmp/.npmrc:ro" \
--volume "$HOME/.m2:/home/onnxruntimedev/.m2:ro" \
--volume "$HOME/.gradle:/home/onnxruntimedev/.gradle" \
-w /onnxruntime_src \
-e NIGHTLY_BUILD \
-e BUILD_BUILDNUMBER \
"${ADDITIONAL_DOCKER_PARAMETERS[@]}" \
"$DOCKER_IMAGE" tools/ci_build/github/linux/run_python_tests.sh -d "$DEVICE" -c "$BUILD_CONFIG"
Loading