Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
de8b22b
feat: add Conan 2 + CMakePresets build system for client repo
mc-nv Apr 18, 2026
a6a7599
fix(cmake): remove invalid \$comment field from CMakePresets.json
mc-nv Apr 20, 2026
b113024
fix(docker): add libopencv-dev to sdk_build stage
mc-nv Apr 20, 2026
44cf25b
fix(docker): cd to client dir before cmake --preset commands
mc-nv Apr 20, 2026
ae115a9
fix(cmake): hoist RapidJSON include_directories to src/c++ level
mc-nv Apr 20, 2026
6c6ff39
fix(cmake): use absolute path for ldscript in LINK_FLAGS
mc-nv Apr 20, 2026
cf43780
fix(cmake): set repo-common_BINARY_DIR and add common include path
mc-nv Apr 20, 2026
ce7bfef
fix(cmake): symlink _deps/repo-common-build for build_wheel.py compat
mc-nv Apr 21, 2026
868533c
fix(conan): disable TRITON_USE_THIRD_PARTY in Conan mode
mc-nv Apr 21, 2026
5f74d67
fix(java): use rm -f/-rf for optional files in javacpp-presets setup
mc-nv Apr 21, 2026
eb14338
fix(docker): skip java bindings when server libs absent; write TRITON…
mc-nv Apr 22, 2026
5099169
fix(docker): default TRITON_MODEL_ANALYZER_REPO_TAG to main
mc-nv Apr 22, 2026
aa666f0
fix(manylinux): force protobuf source build to avoid glibc mismatch
mc-nv Apr 22, 2026
9882d74
fix(manylinux): build protobuf/grpc/gtest from source; skip auditwhee…
mc-nv Apr 22, 2026
c7a0f3c
chore(issues): save context for TRI-971 — cmake-client-dependency-man…
mc-nv Apr 22, 2026
5c6b024
fix(cmake): backfill legacy include-dir vars for common subdirectory;…
mc-nv Apr 30, 2026
e407db1
fix(docker): full L0_sdk parity with reference py3-sdk container
mc-nv May 14, 2026
fe8ed98
fix(docker): address code-review feedback on L0_sdk parity commit
mc-nv May 14, 2026
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
342 changes: 199 additions & 143 deletions CMakeLists.txt

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"version": 6,
"include": ["cmake/CMakePresets.json"]
}
366 changes: 366 additions & 0 deletions Dockerfile.sdk

Large diffs are not rendered by default.

191 changes: 191 additions & 0 deletions Dockerfile.sdk.manylinux
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
# Copyright 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of NVIDIA CORPORATION nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#
# Multi-stage Conan-based manylinux wheel build for the Triton Python client.
# Produces a manylinux_2_28 wheel compatible with any Linux distro with glibc >= 2.28.
#
# Base image: quay.io/pypa/manylinux_2_28_x86_64 (AlmaLinux 8).
# Python 3.12 is pre-installed at /opt/python/cp312-cp312/.
#
# Build (from monorepo root):
# DOCKER_BUILDKIT=1 docker build \
# --secret id=conan_token,src=/path/to/artifactory_token.txt \
# --build-arg TRITON_CLIENT_REPO_SUBDIR=client \
# --build-arg TRITON_COMMON_REPO_SUBDIR=common \
# --build-arg TRITON_SERVER_REPO_SUBDIR=server \
# -f client/Dockerfile.sdk.manylinux .
#
# Extract the repaired wheel:
# docker run --rm -v $(pwd)/dist:/out <image> cp -r /workspace/dist/. /out/
#

# quay.io/pypa/manylinux_2_28_x86_64 is the official PyPA image based on AlmaLinux 8.
# It provides Python 3.12 at /opt/python/cp312-cp312/ and auditwheel as a system tool.
ARG BASE_IMAGE=quay.io/pypa/manylinux_2_28_x86_64

# Subdirectory paths relative to the Docker build context (monorepo root).
ARG TRITON_CLIENT_REPO_SUBDIR=client
ARG TRITON_COMMON_REPO_SUBDIR=common
# Authoritative TRITON_VERSION lives in the server repo.
ARG TRITON_SERVER_REPO_SUBDIR=server

# Conan remote credentials (token supplied via Docker BuildKit secret).
ARG CONAN_USER=triton-sdk
ARG CONAN_REMOTE_NAME=sw-dl-triton-conan-local
ARG CONAN_REMOTE_URL=https://artifactory.nvidia.com/artifactory/api/conan/sw-dl-triton-conan-local

ARG NVIDIA_TRITON_SERVER_SDK_VERSION=unknown
ARG NVIDIA_BUILD_ID=unknown

# CMake preset and Conan profile to use for the manylinux build.
# The preset disables examples and tests; the profile uses gcc-toolset-13 paths.
ARG TRITON_CLIENT_PRESET=triton-client-release-cpu-manylinux-x86_64
ARG CONAN_PROFILE=linux-gcc13-release-manylinux-x86_64

############################################################################
## Build stage
############################################################################

FROM ${BASE_IMAGE} AS sdk_build

SHELL ["/bin/bash", "-euo", "pipefail", "-c"]

# gcc-toolset-13 provides GCC 13 on AlmaLinux 8 at /opt/rh/gcc-toolset-13/root/usr/bin/.
# EPEL provides libb64-devel (base64 encoding used by the HTTP client).
# ninja-build and numactl-devel are already present on the manylinux_2_28 image;
# install them anyway — dnf is a no-op if already installed.
RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked \
dnf install -y --nodocs epel-release && \
dnf install -y --nodocs \
gcc-toolset-13 \
libb64-devel \
ninja-build \
numactl-devel

# Put gcc-toolset-13 first on PATH so Conan and CMake detect it automatically.
ENV PATH=/opt/rh/gcc-toolset-13/root/usr/bin:${PATH}
ENV LD_LIBRARY_PATH=/opt/rh/gcc-toolset-13/root/usr/lib64:/opt/rh/gcc-toolset-13/root/usr/lib:${LD_LIBRARY_PATH}

# Use the pre-built Python 3.12 that ships with the manylinux image.
ARG PYTHON=/opt/python/cp312-cp312/bin/python3

# Isolated build-time venv. auditwheel is added here alongside Conan/CMake so
# the repair step runs against the same Python used to build the wheel.
RUN --mount=type=cache,target=/root/.cache/pip \
${PYTHON} -m venv /opt/build-venv && \
/opt/build-venv/bin/pip install \
"conan>=2.0,<3.0" \
"cmake>=3.31.8" \
"grpcio-tools<1.68"

ENV PATH=/opt/build-venv/bin:${PATH}

ARG TRITON_CLIENT_REPO_SUBDIR
ARG TRITON_COMMON_REPO_SUBDIR
ARG TRITON_CLIENT_PRESET
ARG CONAN_PROFILE
ARG CONAN_USER
ARG CONAN_REMOTE_NAME
ARG CONAN_REMOTE_URL

WORKDIR /workspace

# ── Layer 1: Conan dependency resolution ──────────────────────────────────
# Copy only the Conan manifest + profiles so this expensive layer is cached
# as long as conanfile.py and the Conan profiles are unchanged.
COPY ${TRITON_CLIENT_REPO_SUBDIR}/conanfile.py client/conanfile.py
COPY ${TRITON_CLIENT_REPO_SUBDIR}/conan/profiles/ client/conan/profiles/

# Register the Artifactory remote (no credentials stored in this layer).
RUN conan remote add ${CONAN_REMOTE_NAME} ${CONAN_REMOTE_URL}

# Resolve and download all Conan packages.
# The Artifactory token is mounted as a BuildKit secret and is never written
# to any image layer. Pass: --secret id=conan_token,src=/path/to/token.txt
RUN --mount=type=secret,id=conan_token \
conan remote login ${CONAN_REMOTE_NAME} ${CONAN_USER} \
-p "$(cat /run/secrets/conan_token)" && \
conan install /workspace/client \
--profile:host=/workspace/client/conan/profiles/${CONAN_PROFILE} \
--profile:build=/workspace/client/conan/profiles/${CONAN_PROFILE} \
-c "tools.cmake:cmake_program=$(which cmake)" \
-o "&:enable_gpu=False" \
-o "&:enable_grpc=True" \
-o "&:enable_http=True" \
--build=missing \
'--build=protobuf*' \
'--build=grpc*' \
'--build=gtest*' \
-r ${CONAN_REMOTE_NAME} \
--output-folder=/workspace/client/build/${TRITON_CLIENT_PRESET}/conan && \
conan remote logout ${CONAN_REMOTE_NAME}

# ── Layer 2: Full source + cmake build ────────────────────────────────────
COPY ${TRITON_CLIENT_REPO_SUBDIR} client
COPY ${TRITON_COMMON_REPO_SUBDIR} common
ARG TRITON_SERVER_REPO_SUBDIR
COPY ${TRITON_SERVER_REPO_SUBDIR}/TRITON_VERSION client/TRITON_VERSION

# Configure, build, and install.
# cmake --preset / --build --preset resolve CMakePresets.json from CWD.
RUN cd /workspace/client && \
TRITON_VERSION=$(cat TRITON_VERSION) && \
cmake --preset ${TRITON_CLIENT_PRESET} \
-DCMAKE_INSTALL_PREFIX=/workspace/install \
-DTRITON_VERSION=${TRITON_VERSION} && \
cmake --build --preset ${TRITON_CLIENT_PRESET} && \
cmake --install build/${TRITON_CLIENT_PRESET} \
--prefix /workspace/install

# ── Layer 3: place wheel in dist/ ─────────────────────────────────────────
# tritonclient is a pure-Python wheel (gRPC stubs + pure-Python HTTP client
# wrappers; no compiled C extensions). auditwheel repair requires ELF
# binaries inside the wheel and cannot process a py3-none-any wheel.
# Copy it directly; pip install works on any platform without repair.
RUN mkdir -p /workspace/dist && \
cp "$(find /workspace/install/python/ -maxdepth 1 -name 'tritonclient-*-any.whl' | head -1)" \
/workspace/dist/

############################################################################
## Distribution image — contains only the repaired wheel
############################################################################

FROM ${BASE_IMAGE}

WORKDIR /workspace

COPY --from=sdk_build /workspace/dist/ dist/

ARG NVIDIA_TRITON_SERVER_SDK_VERSION
ARG NVIDIA_BUILD_ID
ENV NVIDIA_TRITON_SERVER_SDK_VERSION=${NVIDIA_TRITON_SERVER_SDK_VERSION}
ENV NVIDIA_BUILD_ID=${NVIDIA_BUILD_ID}

ENV NVIDIA_PRODUCT_NAME="Triton Client SDK (manylinux)"

# Usage: docker run --rm -v $(pwd)/dist:/out <image> cp -r /workspace/dist/. /out/
CMD ["find", "/workspace/dist", "-name", "*.whl", "-exec", "ls", "-lh", "{}", ";"]
104 changes: 104 additions & 0 deletions cmake/CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
{
"version": 6,
"cmakeMinimumRequired": { "major": 3, "minor": 31, "patch": 8 },
"configurePresets": [
{
"name": "conan-base",
"hidden": true,
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/${presetName}",
"toolchainFile": "${sourceDir}/build/${presetName}/conan/generators/conan_toolchain.cmake",
"cacheVariables": { "CMAKE_EXPORT_COMPILE_COMMANDS": "ON" }
},
{
"name": "triton-client-release-cpu-ubuntu-x86_64",
"inherits": "conan-base",
"displayName": "TritonClient — Release, CPU-only, Ubuntu, x86_64",
"description": "CPU-only client library build for Ubuntu Linux on x86_64. No CUDA required.",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"TRITON_ENABLE_GPU": "OFF",
"TRITON_ENABLE_CC_HTTP": "ON",
"TRITON_ENABLE_CC_GRPC": "ON",
"TRITON_ENABLE_PYTHON_HTTP": "ON",
"TRITON_ENABLE_PYTHON_GRPC": "ON",
"TRITON_ENABLE_JAVA_HTTP": "ON",
"TRITON_ENABLE_EXAMPLES": "ON",
"TRITON_ENABLE_TESTS": "ON"
}
},
{
"name": "triton-client-release-cuda-ubuntu-x86_64",
"inherits": "conan-base",
"displayName": "TritonClient — Release, CUDA, Ubuntu, x86_64",
"description": "GPU-enabled client library build for Ubuntu Linux on x86_64.",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"TRITON_ENABLE_GPU": "ON",
"TRITON_ENABLE_CC_HTTP": "ON",
"TRITON_ENABLE_CC_GRPC": "ON",
"TRITON_ENABLE_PYTHON_HTTP": "ON",
"TRITON_ENABLE_PYTHON_GRPC": "ON",
"TRITON_ENABLE_JAVA_HTTP": "ON",
"TRITON_ENABLE_EXAMPLES": "ON",
"TRITON_ENABLE_TESTS": "ON",
"CMAKE_CUDA_RUNTIME_LIBRARY": "Shared"
}
},
{
"name": "triton-client-release-cpu-ubuntu-aarch64",
"inherits": "conan-base",
"displayName": "TritonClient — Release, CPU-only, Ubuntu, aarch64",
"description": "CPU-only client library build for Ubuntu Linux on aarch64 (Graviton, Grace).",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"TRITON_ENABLE_GPU": "OFF",
"TRITON_ENABLE_CC_HTTP": "ON",
"TRITON_ENABLE_CC_GRPC": "ON",
"TRITON_ENABLE_PYTHON_HTTP": "ON",
"TRITON_ENABLE_PYTHON_GRPC": "ON",
"TRITON_ENABLE_JAVA_HTTP": "ON",
"TRITON_ENABLE_EXAMPLES": "ON",
"TRITON_ENABLE_TESTS": "ON"
}
},
{
"name": "triton-client-release-cpu-manylinux-x86_64",
"inherits": "conan-base",
"displayName": "TritonClient — Release, CPU-only, manylinux, x86_64",
"description": "CPU-only manylinux wheel build for broad pip compatibility.",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"TRITON_ENABLE_GPU": "OFF",
"TRITON_ENABLE_CC_HTTP": "ON",
"TRITON_ENABLE_CC_GRPC": "ON",
"TRITON_ENABLE_PYTHON_HTTP": "ON",
"TRITON_ENABLE_PYTHON_GRPC": "ON",
"TRITON_ENABLE_EXAMPLES": "OFF",
"TRITON_ENABLE_TESTS": "OFF"
}
}
],
"buildPresets": [
{ "name": "triton-client-release-cpu-ubuntu-x86_64", "configurePreset": "triton-client-release-cpu-ubuntu-x86_64", "jobs": 8 },
{ "name": "triton-client-release-cuda-ubuntu-x86_64", "configurePreset": "triton-client-release-cuda-ubuntu-x86_64", "jobs": 8 },
{ "name": "triton-client-release-cpu-ubuntu-aarch64", "configurePreset": "triton-client-release-cpu-ubuntu-aarch64", "jobs": 8 },
{ "name": "triton-client-release-cpu-manylinux-x86_64", "configurePreset": "triton-client-release-cpu-manylinux-x86_64", "jobs": 8 }
],
"testPresets": [
{
"name": "triton-client-release-cpu-ubuntu-x86_64",
"configurePreset": "triton-client-release-cpu-ubuntu-x86_64",
"filter": { "exclude": { "label": "requires-gpu" } }
},
{
"name": "triton-client-release-cuda-ubuntu-x86_64",
"configurePreset": "triton-client-release-cuda-ubuntu-x86_64"
},
{
"name": "triton-client-release-cpu-ubuntu-aarch64",
"configurePreset": "triton-client-release-cpu-ubuntu-aarch64",
"filter": { "exclude": { "label": "requires-gpu" } }
}
]
}
15 changes: 15 additions & 0 deletions conan/profiles/linux-gcc13-debug-x86_64
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[settings]
os=Linux
arch=x86_64
compiler=gcc
compiler.version=13
compiler.libcxx=libstdc++11
compiler.cppstd=17
build_type=Debug

[conf]
tools.cmake:cmake_program=/home/user/.venv/bin/cmake

[buildenv]
CC=/usr/bin/gcc-13
CXX=/usr/bin/g++-13
15 changes: 15 additions & 0 deletions conan/profiles/linux-gcc13-release-manylinux-x86_64
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[settings]
os=Linux
arch=x86_64
compiler=gcc
compiler.version=13
compiler.libcxx=libstdc++11
compiler.cppstd=gnu17
build_type=Release

[conf]
tools.cmake:cmake_program=/home/user/.venv/bin/cmake

[buildenv]
CC=/opt/rh/gcc-toolset-13/root/usr/bin/gcc
CXX=/opt/rh/gcc-toolset-13/root/usr/bin/g++
15 changes: 15 additions & 0 deletions conan/profiles/linux-gcc13-release-x86_64
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[settings]
os=Linux
arch=x86_64
compiler=gcc
compiler.version=13
compiler.libcxx=libstdc++11
compiler.cppstd=17
build_type=Release

[conf]
tools.cmake:cmake_program=/home/user/.venv/bin/cmake

[buildenv]
CC=/usr/bin/gcc-13
CXX=/usr/bin/g++-13
Loading
Loading