-
Notifications
You must be signed in to change notification settings - Fork 20
feat(models): vllm k8s support #305
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
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
957562b
feat(models): vllm k8s support
benmccown 78c5fbf
fix(models): vllm k8s live-test fixes
benmccown 1971ecc
fix(models): make k8s deployment teardown resilient and engine-agnostic
benmccown 1fc3cc6
fix(models): run vLLM pods as the image's vllm user (uid 2000, gid 0)
benmccown 93b27d3
docs(models): flag engine-specific uid/gid footgun for the future NIM…
benmccown 1b905e9
refactor(models): split k8s backend into engine reconcilers
benmccown d323053
refactor(models): drop NIM-operator CRD startup validation
benmccown 7fad2db
refactor(models): drop config-less status path, return UNKNOWN instead
benmccown 085a773
docs(models): tidy reconciler module docstrings
benmccown 010b76d
docs(models): regenerate config reference for vLLM k8s config fields
benmccown a56c74c
fix(models): align mock backend status signature; qualify busybox def…
benmccown cceba77
feat(models): use nmp-api image as the model-weights puller (k8s vLLM)
benmccown 6bd8e4d
refactor(models): address PR review feedback
benmccown 2f7c887
refactor(models): drop write-only health-path annotation (review)
benmccown bc989b3
fix(models): classify all delete failures in ResourceDeleter (review)
benmccown d04a705
fix errant status string
benmccown File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
services/core/models/src/nmp/core/models/controllers/backends/engine.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| """Backend-agnostic engine dispatch + readiness-probe helpers. | ||
|
|
||
| The ``engine`` discriminant on a ``ModelDeploymentConfig`` selects the compiler | ||
| path (nim / vllm / generic). These constants and helpers are shared by every | ||
| service backend (docker container labels, k8s object labels) so engine selection | ||
| and readiness-probe resolution behave identically regardless of where the | ||
| deployment runs. | ||
| """ | ||
|
|
||
| from typing import Any | ||
|
|
||
| from nmp.core.models.controllers.backends.common import DeploymentConfigView | ||
|
|
||
| ENGINE_NIM = "nim" | ||
| ENGINE_VLLM = "vllm" | ||
| ENGINE_GENERIC = "generic" | ||
|
|
||
| # Label recording the engine, read back at status time to pick the health probe. | ||
| # Used as a docker container label and a k8s object/pod label. | ||
| ENGINE_LABEL = "nmp.nvidia.com/engine" | ||
|
|
||
| # Label recording the resolved readiness-probe path, read back at status time. | ||
| # Stamped at create so status polling doesn't need the deployment config. | ||
| HEALTH_PATH_LABEL = "nmp.nvidia.com/health-path" | ||
|
|
||
| # Per-engine readiness probe paths (relative to the container/pod host URL). | ||
| ENGINE_HEALTH_PATHS: dict[str, str] = { | ||
| ENGINE_NIM: "/v1/health/ready", | ||
| ENGINE_VLLM: "/health", | ||
| } | ||
|
|
||
|
|
||
| def config_engine(config: Any) -> str: | ||
| """Return the engine discriminant as a lowercase string (defaults to nim).""" | ||
| engine = getattr(config, "engine", None) | ||
| if engine is None: | ||
| return ENGINE_NIM | ||
| # engine may be an enum or a plain string depending on the SDK model. | ||
| return str(getattr(engine, "value", engine)).lower() | ||
|
|
||
|
|
||
| def resolve_health_path(engine: str, view: DeploymentConfigView) -> str: | ||
| """Resolve the readiness-probe path for a deployment. | ||
|
|
||
| Precedence: an explicit ``executor_config.health_check_path`` wins; otherwise | ||
| fall back to the engine's standard endpoint. ``generic`` containers have no | ||
| engine default, so they fall back to the NIM path unless they set their own. | ||
| """ | ||
| explicit_path = getattr(view, "health_check_path", None) | ||
| if explicit_path: | ||
| return explicit_path | ||
| return ENGINE_HEALTH_PATHS.get(engine, ENGINE_HEALTH_PATHS[ENGINE_NIM]) | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.