-
Notifications
You must be signed in to change notification settings - Fork 38
docs(helm): worker-based instance health, with example update #388
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: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,7 +39,7 @@ All Pod specs in your helm chart will be updated with pull secrets at runtime, s | |
|
|
||
| - Important: The Helm chart name should not contain underscores or other special symbols, as that may cause issues during deployment. | ||
|
|
||
| **Example Creation via API** | ||
| ### Example creation via API | ||
|
|
||
| Please see our [sample helm chart used](https://github.com/NVIDIA/nvcf/tree/main/examples/function-samples/helmchart-samples/inference-test-sample) in this example for reference. | ||
|
|
||
|
|
@@ -68,7 +68,8 @@ For gRPC-based functions, set `"inferenceURL" : "/gRPC"`. This signals to Cloud | |
|
|
||
| 3. Proceed with function deployment and invocation normally. | ||
|
|
||
| **Multi-node helm deployment** | ||
| ## Multi-node Helm deployment | ||
|
|
||
| To create a multi-node helm deployment, you need to use the following format for the `instanceType`: | ||
| `<CSP>.GPU.<GPU_NAME>_<number of gpus per node>x[.x<number of nodes>]`. For example, `DGXC.GPU.L40S_1x` is a single L40S instance while `ON-PREM.GPU.B200_8x.x2` is two full nodes of 8-way B200. | ||
|
|
||
|
|
@@ -98,7 +99,7 @@ it will only do so if modification will not break your chart when it is installe | |
| Possible areas amenable to modification will be noted in the restrictions section below. | ||
| Any standard that cannot be enforced by modification will result in error(s) during function creation. | ||
|
|
||
| **Restrictions** | ||
| #### Restrictions | ||
|
|
||
| - Supported k8s artifacts under Helm Chart Namespace are listed below; others will be rejected: | ||
| - ConfigMaps | ||
|
|
@@ -167,3 +168,120 @@ curl -s -X POST "http://${GATEWAY_ADDR}/v2/nvcf/deployments/functions/${FUNCTION | |
| }] | ||
| }' | ||
| ``` | ||
|
|
||
| ## Instance health | ||
|
|
||
| Cloud Functions uses "holistic" Helm function health checking: on every reconcile, | ||
| NVCA evaluates the health of every object applied from your Helm chart and their children | ||
| (ex. a Deployment, its active ReplicaSet, and its replica Pods) plus infrastructure Pods. | ||
| If any single object reaches a terminal bad state, the whole function instance is marked failed. | ||
|
Contributor
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. These opening details sound close to the implementation ie "reconcile", "terminal bad state", users can go look at the implementation if needed, I think something a little higher level might be more understandable - By default, Cloud Functions considers the health of every object rendered by a Helm chart. One unhealthy object can cause the entire instance to be recreated, even when the inference service can still serve traffic. StatusByWorkerReadiness changes this tradeoff by using only worker readiness to determine instance health. |
||
| NVCA then reports the failing object's status and events for debugging and re-creates the instance. | ||
|
|
||
| An instance transitions through these phases: | ||
|
|
||
| - Scheduling: one or more Pods have not yet been assigned to a node. | ||
| - Starting: all Pods are scheduled and NVCA is waiting on readiness. | ||
| - Running: all Helm chart objects and the worker Pod report healthy or ready. | ||
|
|
||
| Because health depends on all chart objects, a Pod that is not the inference | ||
| worker (for example a sidecar Deployment or an init Job) can fail the instance | ||
| if it enters a terminal state. Use [`StatusByWorkerReadiness`](#use-worker-readiness-for-function-health) | ||
| if only the inference worker's readiness should determine instance health. | ||
|
|
||
| ### Timeouts | ||
|
|
||
| The following timeouts govern when a still-unhealthy object fails the instance. | ||
| The clock for each timeout starts when the described condition is first | ||
| observed, measured from the Pod launch time unless noted. Values are NVCA | ||
| defaults. Only Worker Degradation Period is operator-configurable, through the | ||
| `Worker Degradation Period` setting in [NVCA Configuration](./cluster-management/configuration.md). | ||
|
|
||
| | Timeout | Default | Cause (when the clock starts) | Effect (when exceeded) | | ||
| | --- | --- | --- | --- | | ||
| | Pod scheduling | 10 minutes | A Pod cannot be scheduled onto a node, for example no node satisfies its resources or affinity. | The Pod is marked terminal (`PodStuckScheduling`) and the instance fails and is re-created. For tasks, the task's max queued duration is used instead of this default. | | ||
| | Image pull error | 1 minute | A scheduled Pod reports `ErrImagePull` or `ImagePullBackOff` on any container or init container. | The Pod is marked terminal (`ImagePullIssues`) and the instance fails. Check registry credentials and image references. | | ||
| | Container restart loop | 10 minutes | A container or init container restarts at least 3 times. | The Pod is marked terminal (stuck initializing, containers in restart loop) and the instance fails. | | ||
| | Init container stuck | 2 hours | A Pod's init containers have not completed (the Pod is not yet `Initialized`). | The Pod is marked terminal (init container stuck) and the instance fails. | | ||
| | Worker startup | 2 hours | A running Pod has not become ready during its initial startup, before it has ever reported ready. | The Pod is considered degraded and the instance fails. | | ||
| | Worker Degradation Period | 30 minutes | A Pod that had been ready becomes not ready (containers report not ready) after being initialized. | The Pod is considered degraded, the instance is marked degraded, and NVCA kills and re-creates it. Operator-configurable. | | ||
| | Pending timeout (max running) | 3 hours | Objects remain pending, that is not all objects reach ready, since the instance health condition first went unhealthy. | The instance fails with a pending timeout. | | ||
| | Failing objects backoff | 90 seconds | An object reports a transient failure, for example `FailedMount` or `FailedAttachVolume`. | NVCA requeues and retries every 30 seconds for up to 90 seconds. If the object is still failing after 90 seconds, the instance fails. | | ||
|
|
||
|
Contributor
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. Standard health handling puts terminal object failures into |
||
| Some conditions fail an instance immediately, without waiting for a timeout: | ||
|
|
||
| - A Pod that enters the `Failed` phase, including admission rejection | ||
| (`UnexpectedAdmissionError`). | ||
| - A Pod with restart policy `Never` whose non-restartable container terminates | ||
| with a non-zero exit code is treated as degraded right away, regardless of the | ||
| Worker Degradation Period. | ||
| - A controller object (Deployment, ReplicaSet, StatefulSet, Job) that reports a | ||
| terminal condition such as `ProgressDeadlineExceeded`, a replica-failure | ||
| condition, or a failed Job. | ||
| - A warning event that indicates a terminal error, such as `FailedCreate`, | ||
| `FailedUpdate`, `ReplicaSetCreateError`, or a `forbidden` error, on a tracked | ||
| object. | ||
|
|
||
| ### Use worker readiness for function health | ||
|
|
||
| As described above, an unhealthy object, ex. a Pod, applied by the Helm chart can fail the function | ||
|
Contributor
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. style - ex. => for example |
||
| instance. This behavior may not be desirable if some objects in your chart are expected to fail or are not critical | ||
| to serving inference. When your function is configured with the `StatusByWorkerReadiness` feature flag, the instance health check performed by NVCF becomes the sole determinant of instance health. | ||
| The flag is read from the chart at install time to configure the function instance. | ||
|
|
||
| Add `templates/nvcf-workload-config.yaml` to the function chart: | ||
|
|
||
| ```yaml | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: nvcf-workload-config | ||
| data: | ||
| config.yaml: | | ||
| featureFlags: | ||
| StatusByWorkerReadiness: true | ||
| ``` | ||
|
|
||
| The ConfigMap **must** be named `nvcf-workload-config` and the `config.yaml` key **must** exist. | ||
|
Contributor
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. style - Remove the bolding |
||
| Cloud Functions reads this configuration from the chart and does not create the ConfigMap | ||
| in the instance namespace. | ||
|
|
||
| Package and push the chart, then create and deploy the function: | ||
|
|
||
| ```bash | ||
| helm package ./my-chart | ||
| helm push ./my-chart-1.0.0.tgz \ | ||
| oci://${REGISTRY}/${REPOSITORY}/charts | ||
|
|
||
| ./nvcf-cli function create \ | ||
| --name my-helm-function \ | ||
| --helm-chart \ | ||
| oci://${REGISTRY}/${REPOSITORY}/charts/my-chart-1.0.0.tgz \ | ||
| --helm-chart-service my-inference-service \ | ||
| --inference-url /infer \ | ||
| --inference-port 8000 \ | ||
| --health-uri /health/ready \ | ||
| --health-port 8000 | ||
|
|
||
| ./nvcf-cli function deploy create \ | ||
| --instance-type NCP.GPU.H100_1x \ | ||
| --gpu H100 \ | ||
| --min-instances 1 \ | ||
| --max-instances 1 | ||
| ``` | ||
|
|
||
| The function reaches `RUNNING` when the instance health endpoint `/health/ready` returns HTTP `200`, | ||
| indicating readiness. With this flag enabled: | ||
|
|
||
| - Other chart objects' statuses, including the inference Deployment and Service, are | ||
| informational only. Their statuses are sent in logs but do not gate `RUNNING`. | ||
| - If a non-worker Pod goes down while the instance health endpoint reports ready, the | ||
| instance remains `RUNNING`. Cloud Functions reports the unhealthy object's status for | ||
| debugging, and Kubernetes can replace it. | ||
| - If the health endpoint does not report ready, the instance is marked degraded | ||
| until it reports ready again or 30 minutes have passed (Worker Degradation Period, see [NVCA Configuration](./cluster-management/configuration.md)), | ||
|
Contributor
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. Could we distinguish initial startup from post-readiness degradation here? The implementation uses the 2-hour Worker Startup timeout while the worker is initially starting. The 30-minute Worker Degradation Period applies after readiness has been established. As written, operators will expect every failed readiness check to recycle the instance after 30 minutes. |
||
| after which the instance is killed and re-created by NVCF. | ||
|
|
||
| Without the ConfigMap, or with the flag set to `false`, Cloud Functions uses standard health behavior. | ||
|
|
||
| See also the optional `statusByWorkerReadiness` value in | ||
| [examples/function-samples/helmchart-samples/inference-test-sample](https://github.com/NVIDIA/nvcf/tree/main/examples/function-samples/helmchart-samples/inference-test-sample). | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| {{- if .Values.statusByWorkerReadiness }} | ||
|
Contributor
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. Did you validate both template branches
|
||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: nvcf-workload-config | ||
| data: | ||
| config.yaml: | | ||
| featureFlags: | ||
| StatusByWorkerReadiness: true | ||
| {{- end }} | ||
|
estroz marked this conversation as resolved.
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,4 +20,8 @@ image: | |
| tag: "latest" | ||
| pullPolicy: "IfNotPresent" | ||
|
|
||
| inferencePort: 8000 | ||
| inferencePort: 8000 | ||
|
|
||
| # When true, render nvcf-workload-config so NVCA uses worker container readiness | ||
| # for instance health instead of all chart objects. See docs/user/helm-functions.md. | ||
| statusByWorkerReadiness: false | ||
|
Contributor
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. can you add a new line |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style - replace use of ex. with "for example"