-
Notifications
You must be signed in to change notification settings - Fork 153
Add cuopt_grpc_server as an option for the cuopt image #1003
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: release/26.04
Are you sure you want to change the base?
Changes from all commits
4601416
99a9786
f82bfc7
b139ec7
097e1de
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| #!/bin/bash | ||
| # SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # | ||
| # Entrypoint for the cuOpt container image. | ||
| # | ||
| # Server selection (in order of precedence): | ||
| # 1. Explicit command: docker run <image> cuopt_grpc_server [args...] | ||
| # 2. Environment variable: CUOPT_SERVER_TYPE=grpc | ||
| # 3. Default: Python REST server (cuopt_server.cuopt_service) | ||
| # | ||
| # When CUOPT_SERVER_TYPE=grpc, the following env vars configure the gRPC server: | ||
| # CUOPT_SERVER_PORT — listen port (default: 5001) | ||
| # CUOPT_GPU_COUNT — worker processes (default: 1) | ||
| # CUOPT_GRPC_ARGS — additional CLI flags passed verbatim | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Link to details on CUOPT_GRPC_ARGS or add more details. |
||
| # (e.g. "--tls --tls-cert server.crt --log-to-console") | ||
| # See docs/cuopt/source/cuopt-grpc/advanced.rst (flags/env); | ||
| # cpp/docs/grpc-server-architecture.md for contributor IPC details. | ||
| # for all available flags. | ||
|
|
||
| set -e | ||
|
|
||
| export HOME="/opt/cuopt" | ||
|
|
||
| # If CUOPT_SERVER_TYPE=grpc, build a command line from env vars and launch. | ||
| if [ "${CUOPT_SERVER_TYPE}" = "grpc" ]; then | ||
| GRPC_CMD=(cuopt_grpc_server) | ||
|
|
||
| GRPC_CMD+=(--port "${CUOPT_SERVER_PORT:-5001}") | ||
|
|
||
| if [ -n "${CUOPT_GPU_COUNT}" ]; then | ||
| GRPC_CMD+=(--workers "${CUOPT_GPU_COUNT}") | ||
| fi | ||
|
|
||
| # Allow arbitrary extra flags (e.g. --tls, --log-to-console) | ||
| if [ -n "${CUOPT_GRPC_ARGS}" ]; then | ||
| read -ra EXTRA <<< "${CUOPT_GRPC_ARGS}" | ||
| GRPC_CMD+=("${EXTRA[@]}") | ||
| fi | ||
|
Comment on lines
+36
to
+39
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Word-splitting caveat for The For most use cases (flags like 🤖 Prompt for AI Agents |
||
|
|
||
| exec "${GRPC_CMD[@]}" | ||
| fi | ||
|
|
||
| exec "$@" | ||
Uh oh!
There was an error while loading. Please reload this page.