Skip to content

Commit 42ad2e6

Browse files
authored
Merge pull request NVIDIA#1044 from NVIDIA/release/26.04
Forward-merge release/26.04 into main
2 parents 20ecbf5 + d30718f commit 42ad2e6

37 files changed

Lines changed: 1745 additions & 992 deletions

.github/workflows/build_images.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ jobs:
5555
cp ./LICENSE ./ci/docker/context/LICENSE
5656
cp ./VERSION ./ci/docker/context/VERSION
5757
cp ./thirdparty/THIRD_PARTY_LICENSES ./ci/docker/context/THIRD_PARTY_LICENSES
58+
cp ./ci/docker/entrypoint.sh ./ci/docker/context/entrypoint.sh
5859
- name: Copy Commit SHA and commit time
5960
run: |
6061
git rev-parse HEAD > ./ci/docker/context/COMMIT_SHA

CONTRIBUTING.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,17 @@ export RAPIDS_DATASET_ROOT_DIR=$CUOPT_HOME/datasets/
213213
cd $CUOPT_HOME/python
214214
pytest -v ${CUOPT_HOME}/python/cuopt/cuopt/tests
215215
```
216+
## gRPC Remote Execution
217+
218+
NVIDIA cuOpt includes a gRPC-based remote execution system for running solves on a
219+
GPU server from a program using the API locally. User documentation lives under `docs/cuopt/source/cuopt-grpc/` (Sphinx **gRPC remote execution** section):
220+
221+
- `quick-start.rst` — Install/Docker/selector, how remote execution works, minimal LP and CLI examples (default C bundle).
222+
- `advanced.rst` — TLS, tuning, limitations, troubleshooting.
223+
- `examples.rst`, `api.rst` — Sample patterns and RPC overview.
224+
- `docs/cuopt/source/cuopt-grpc/grpc-server-architecture.md` — Short **gRPC server behavior** page in user docs.
225+
- `cpp/docs/grpc-server-architecture.md` — Full contributor reference (IPC, C++ source map, streaming).
226+
216227
## Debugging cuOpt
217228

218229
### Building in debug mode from source

GRPC_INTERFACE.md

Lines changed: 0 additions & 392 deletions
This file was deleted.

GRPC_QUICK_START.md

Lines changed: 0 additions & 248 deletions
This file was deleted.

ci/docker/Dockerfile

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ RUN ln -sf /usr/bin/python${PYTHON_SHORT_VER} /usr/bin/python
4545

4646
FROM python-env AS install-env
4747

48+
ARG CUDA_VER
4849
ARG CUOPT_VER
4950
ARG PYTHON_SHORT_VER
5051

@@ -68,36 +69,18 @@ FROM install-env AS cuopt-final
6869

6970
ARG PYTHON_SHORT_VER
7071

71-
# Consolidate all directory creation, permissions, and file operations into a single layer
72+
# Make cuopt_grpc_server, cuopt_cli, and shared libraries available to all processes
73+
# (profile.d scripts are only sourced by login shells; ENV works for all containers)
74+
ENV PATH="/usr/local/cuda/bin:/usr/bin:/usr/local/bin:/usr/local/nvidia/bin/:/usr/local/lib/python${PYTHON_SHORT_VER}/dist-packages/libcuopt/bin:${PATH}"
75+
ENV LD_LIBRARY_PATH="/usr/lib/x86_64-linux-gnu:/usr/lib/aarch64-linux-gnu:/usr/local/cuda/lib64:/usr/local/nvidia/lib:/usr/local/nvidia/lib64:/usr/lib/wsl/lib:/usr/lib/wsl/lib/libnvidia-container:/usr/lib/nvidia:/usr/lib/nvidia-current:/usr/local/lib/python${PYTHON_SHORT_VER}/dist-packages/libcuopt/lib/:/usr/local/lib/python${PYTHON_SHORT_VER}/dist-packages/rapids_logger/lib64:${LD_LIBRARY_PATH}"
76+
77+
# Directory creation, permissions
7278
RUN mkdir -p /opt/cuopt && \
7379
chmod 777 /opt/cuopt && \
74-
# Create profile.d script for universal access
75-
echo '#!/bin/bash' > /etc/profile.d/cuopt.sh && \
76-
echo 'export PATH="/usr/local/cuda/bin:/usr/bin:/usr/local/bin:/usr/local/nvidia/bin/:/usr/local/lib/python${PYTHON_SHORT_VER}/dist-packages/libcuopt/bin:$PATH"' >> /etc/profile.d/cuopt.sh && \
77-
echo 'export LD_LIBRARY_PATH="/usr/lib/x86_64-linux-gnu:/usr/lib/aarch64-linux-gnu:/usr/local/cuda/lib64:/usr/local/nvidia/lib:/usr/local/nvidia/lib64:/usr/lib/wsl/lib:/usr/lib/wsl/lib/libnvidia-container:/usr/lib/nvidia:/usr/lib/nvidia-current:/usr/local/lib/python${PYTHON_SHORT_VER}/dist-packages/libcuopt/lib/:/usr/local/lib/python${PYTHON_SHORT_VER}/dist-packages/rapids_logger/lib64:${LD_LIBRARY_PATH}"' >> /etc/profile.d/cuopt.sh && \
78-
chmod +x /etc/profile.d/cuopt.sh && \
79-
# Set in /etc/environment for system-wide access
80-
echo 'PATH="/usr/local/cuda/bin:/usr/bin:/usr/local/bin:/usr/local/nvidia/bin/:/usr/local/lib/python${PYTHON_SHORT_VER}/dist-packages/libcuopt/bin:$PATH"' >> /etc/environment && \
81-
echo 'LD_LIBRARY_PATH="/usr/lib/x86_64-linux-gnu:/usr/lib/aarch64-linux-gnu:/usr/local/cuda/lib64:/usr/local/nvidia/lib:/usr/local/nvidia/lib64:/usr/lib/wsl/lib:/usr/lib/wsl/lib/libnvidia-container:/usr/lib/nvidia:/usr/lib/nvidia-current:/usr/local/lib/python${PYTHON_SHORT_VER}/dist-packages/libcuopt/lib/:/usr/local/lib/python${PYTHON_SHORT_VER}/dist-packages/rapids_logger/lib64:${LD_LIBRARY_PATH}"' >> /etc/environment && \
82-
# Set proper permissions for cuOpt installation
8380
chmod -R 755 /usr/local/lib/python${PYTHON_SHORT_VER}/dist-packages/cuopt* && \
8481
chmod -R 755 /usr/local/lib/python${PYTHON_SHORT_VER}/dist-packages/libcuopt* && \
8582
chmod -R 755 /usr/local/lib/python${PYTHON_SHORT_VER}/dist-packages/cuopt_* && \
86-
chmod -R 755 /usr/local/bin/* && \
87-
# Create entrypoint script in a single operation
88-
echo '#!/bin/bash' > /opt/cuopt/entrypoint.sh && \
89-
echo 'set -e' >> /opt/cuopt/entrypoint.sh && \
90-
echo '' >> /opt/cuopt/entrypoint.sh && \
91-
echo '# Get current user info from Docker environment variables' >> /opt/cuopt/entrypoint.sh && \
92-
echo 'CURRENT_UID=${UID:-1000}' >> /opt/cuopt/entrypoint.sh && \
93-
echo 'CURRENT_GID=${GID:-1000}' >> /opt/cuopt/entrypoint.sh && \
94-
echo '' >> /opt/cuopt/entrypoint.sh && \
95-
echo '# Set environment variables for the current user' >> /opt/cuopt/entrypoint.sh && \
96-
echo 'export HOME="/opt/cuopt"' >> /opt/cuopt/entrypoint.sh && \
97-
echo '' >> /opt/cuopt/entrypoint.sh && \
98-
echo '# Execute the command' >> /opt/cuopt/entrypoint.sh && \
99-
echo 'exec "$@"' >> /opt/cuopt/entrypoint.sh && \
100-
chmod +x /opt/cuopt/entrypoint.sh
83+
chmod -R 755 /usr/local/bin/*
10184

10285
# Set the default working directory to the cuopt folder
10386
WORKDIR /opt/cuopt
@@ -112,6 +95,10 @@ COPY --from=cuda-libs /usr/local/cuda/lib64/libnvJitLink* /usr/local/cuda/lib64/
11295
# Copy CUDA headers needed for runtime compilation (e.g., CuPy NVRTC).
11396
COPY --from=cuda-headers /usr/local/cuda/include/ /usr/local/cuda/include/
11497

115-
# Use the flexible entrypoint
98+
# Entrypoint supports server selection:
99+
# Default: Python REST server
100+
# CUOPT_SERVER_TYPE=grpc: gRPC server (uses CUOPT_SERVER_PORT, CUOPT_GPU_COUNT)
101+
# Explicit command: docker run <image> cuopt_grpc_server [args...]
102+
COPY ./entrypoint.sh /opt/cuopt/entrypoint.sh
116103
ENTRYPOINT ["/opt/cuopt/entrypoint.sh"]
117104
CMD ["python", "-m", "cuopt_server.cuopt_service"]

ci/docker/entrypoint.sh

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/bin/bash
2+
# SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
# Entrypoint for the cuOpt container image.
6+
#
7+
# Server selection (in order of precedence):
8+
# 1. Explicit command: docker run <image> cuopt_grpc_server [args...]
9+
# 2. Environment variable: CUOPT_SERVER_TYPE=grpc
10+
# 3. Default: Python REST server (cuopt_server.cuopt_service)
11+
#
12+
# When CUOPT_SERVER_TYPE=grpc, the following env vars configure the gRPC server:
13+
# CUOPT_SERVER_PORT — listen port (default: 5001)
14+
# CUOPT_GPU_COUNT — worker processes (default: 1)
15+
# CUOPT_GRPC_ARGS — additional CLI flags passed verbatim
16+
# (e.g. "--tls --tls-cert server.crt --log-to-console")
17+
# See docs/cuopt/source/cuopt-grpc/advanced.rst (flags/env);
18+
# cpp/docs/grpc-server-architecture.md for contributor IPC details.
19+
# for all available flags.
20+
21+
set -e
22+
23+
export HOME="/opt/cuopt"
24+
25+
# If CUOPT_SERVER_TYPE=grpc, build a command line from env vars and launch.
26+
if [ "${CUOPT_SERVER_TYPE}" = "grpc" ]; then
27+
GRPC_CMD=(cuopt_grpc_server)
28+
29+
GRPC_CMD+=(--port "${CUOPT_SERVER_PORT:-5001}")
30+
31+
if [ -n "${CUOPT_GPU_COUNT}" ]; then
32+
GRPC_CMD+=(--workers "${CUOPT_GPU_COUNT}")
33+
fi
34+
35+
# Allow arbitrary extra flags (e.g. --tls, --log-to-console)
36+
if [ -n "${CUOPT_GRPC_ARGS}" ]; then
37+
read -ra EXTRA <<< "${CUOPT_GRPC_ARGS}"
38+
GRPC_CMD+=("${EXTRA[@]}")
39+
fi
40+
41+
exec "${GRPC_CMD[@]}"
42+
fi
43+
44+
exec "$@"

cpp/docs/DEVELOPER_GUIDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
This document serves as a guide for contributors to cuOpt C++ code. Developers should also refer
44
to these additional files for further documentation of cuOpt best practices.
55

6+
* [gRPC server architecture](grpc-server-architecture.md) — full `cuopt_grpc_server` IPC, source file map, and streaming internals (end-user summary lives under `docs/cuopt/source/cuopt-grpc/`).
67
* [Documentation Guide](TODO) for guidelines on documenting cuOpt code.
78
* [Testing Guide](TODO) for guidelines on writing unit tests.
89
* [Benchmarking Guide](TODO) for guidelines on writing unit benchmarks.

0 commit comments

Comments
 (0)