Skip to content

docs(helm): worker-based instance health, with example update#388

Open
estroz wants to merge 1 commit into
mainfrom
estroczynski/docs/worker-health
Open

docs(helm): worker-based instance health, with example update#388
estroz wants to merge 1 commit into
mainfrom
estroczynski/docs/worker-health

Conversation

@estroz

@estroz estroz commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

TL;DR

Follows up on #338 with docs

Additional Details (optional for docs, build, test, refactor, ci, chore, style, and revert PRs)

For the Reviewer

For QA (optional for docs, build, test, refactor, ci, chore, style, and revert PRs)

Issues

#272

Checklist

  • I am familiar with the Contributing Guidelines.
  • I have signed off my commits for Developer Certificate of Origin (DCO) compliance.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

Summary by CodeRabbit

  • New Features

    • Added an opt-in Helm-based function health mode that gates instance health using worker container readiness (StatusByWorkerReadiness).
    • When enabled, health-related configuration is generated only as needed.
    • Introduced Worker Degradation Period to control stabilization time before workers are considered unhealthy, impacting terminal worker failure timing for supported Helm functions.
  • Documentation

    • Expanded and reformatted Helm Functions docs with instance health phases, failure conditions, and timeout guidance.
    • Updated the inference test sample README and values to describe the new worker-readiness-based health option.

@estroz
estroz requested a review from a team as a code owner July 23, 2026 17:39
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds optional worker-readiness-based health configuration to the inference-test Helm sample, documents deployment and degradation behavior, updates related documentation headings, and clarifies comments in worker readiness status handling.

Changes

Worker readiness health

Layer / File(s) Summary
Helm readiness configuration
examples/function-samples/helmchart-samples/inference-test-sample/inference-test/values.yaml, examples/function-samples/helmchart-samples/inference-test-sample/inference-test/templates/nvcf-workload-config.yaml, examples/function-samples/helmchart-samples/inference-test-sample/README.md
Adds the statusByWorkerReadiness setting, conditionally renders nvcf-workload-config, and documents enabling the option.
Readiness behavior documentation
docs/user/cluster-management/configuration.md, docs/user/helm-functions.md
Documents worker degradation timing, Helm instance health phases and timeouts, StatusByWorkerReadiness configuration, deployment commands, readiness endpoint behavior, and heading structure updates.
Readiness status comments
src/compute-plane-services/nvca/internal/miniservice/status.go
Removes a TODO and clarifies comments describing progressing and terminal-bad worker states without changing logic.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • NVIDIA/nvcf#338: Updates the worker-based health behavior associated with StatusByWorkerReadiness.

Suggested reviewers: sbaum1994

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title follows Conventional Commits and accurately describes this docs-focused change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch estroczynski/docs/worker-health

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.12.2)

level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies"


Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/user/helm-functions.md`:
- Around line 112-116: Update the function deploy example to include both
--function-id and --version-id arguments, using clear placeholder values or
documenting how users obtain them. Keep the existing deployment options
unchanged.

In
`@examples/function-samples/helmchart-samples/inference-test-sample/inference-test/templates/nvcf-workload-config.yaml`:
- Around line 16-25: Add Helm render tests for the workload configuration
template covering the default false/absent state, which must omit
nvcf-workload-config, and the statusByWorkerReadiness=true state, which must
render the exact ConfigMap name, data key, and StatusByWorkerReadiness flag. Use
the repository-native test runner to execute the coverage before committing.

In `@examples/function-samples/helmchart-samples/inference-test-sample/README.md`:
- Around line 49-53: Update the README instructions around
statusByWorkerReadiness to remove the --set packaging guidance. State that the
value must be enabled in inference-test/values.yaml before running helm package,
and reserve --set statusByWorkerReadiness=true for local helm install or upgrade
commands.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: c8047a3d-2e9d-450b-996d-4f13ac17482c

📥 Commits

Reviewing files that changed from the base of the PR and between 0575ad5 and 148e4cb.

📒 Files selected for processing (5)
  • docs/user/cluster-management/configuration.md
  • docs/user/helm-functions.md
  • examples/function-samples/helmchart-samples/inference-test-sample/README.md
  • examples/function-samples/helmchart-samples/inference-test-sample/inference-test/templates/nvcf-workload-config.yaml
  • examples/function-samples/helmchart-samples/inference-test-sample/inference-test/values.yaml

Comment thread docs/user/helm-functions.md Outdated
Comment on lines +112 to +116
./nvcf-cli function deploy create \
--instance-type NCP.GPU.H100_1x \
--gpu H100 \
--min-instances 1 \
--max-instances 1

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'AGENTS files:\n'
git ls-files '**/AGENTS.md' | sed 's/^/- /'

printf '\n--- docs/user/helm-functions.md excerpt ---\n'
nl -ba docs/user/helm-functions.md | sed -n '90,135p'

printf '\n--- example README excerpt ---\n'
nl -ba examples/function-samples/helmchart-samples/inference-test-sample/README.md | sed -n '55,80p'

Repository: NVIDIA/nvcf

Length of output: 1534


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Narrowly inspect the relevant docs if the previous command didn't surface enough context.
nl -ba docs/user/helm-functions.md | sed -n '100,125p'
printf '\n'
nl -ba examples/function-samples/helmchart-samples/inference-test-sample/README.md | sed -n '60,75p'

Repository: NVIDIA/nvcf

Length of output: 189


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- docs/AGENTS.md ---'
cat -n docs/AGENTS.md

printf '\n%s\n' '--- examples/AGENTS.md ---'
cat -n examples/AGENTS.md

printf '\n%s\n' '--- docs/user/helm-functions.md (100-125) ---'
sed -n '100,125p' docs/user/helm-functions.md | cat -n

printf '\n%s\n' '--- examples/function-samples/helmchart-samples/inference-test-sample/README.md (60-75) ---'
sed -n '60,75p' examples/function-samples/helmchart-samples/inference-test-sample/README.md | cat -n

Repository: NVIDIA/nvcf

Length of output: 12488


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- docs/AGENTS.md ---'
sed -n '1,220p' docs/AGENTS.md | cat -n

printf '\n%s\n' '--- examples/AGENTS.md ---'
sed -n '1,220p' examples/AGENTS.md | cat -n

printf '\n%s\n' '--- docs/user/helm-functions.md (100-125) ---'
sed -n '100,125p' docs/user/helm-functions.md | cat -n

printf '\n%s\n' '--- examples/function-samples/helmchart-samples/inference-test-sample/README.md (60-75) ---'
sed -n '60,75p' examples/function-samples/helmchart-samples/inference-test-sample/README.md | cat -n

Repository: NVIDIA/nvcf

Length of output: 12488


Include the function and version IDs in the deploy example. This command is missing --function-id and --version-id; add placeholders or document how the CLI gets them.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/user/helm-functions.md` around lines 112 - 116, Update the function
deploy example to include both --function-id and --version-id arguments, using
clear placeholder values or documenting how users obtain them. Keep the existing
deployment options unchanged.

@estroz
estroz force-pushed the estroczynski/docs/worker-health branch from 148e4cb to c0028bf Compare July 23, 2026 18:38
@estroz
estroz force-pushed the estroczynski/docs/worker-health branch from c0028bf to c8787a0 Compare July 23, 2026 18:49

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/compute-plane-services/nvca/internal/miniservice/status.go (1)

513-514: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Keep the contextual follow-up reference.

The removed TODO documented readiness behavior that is not implemented in the supplied code. Please retain it, or replace it with a concise comment referencing the tracked issue so the intended follow-up is not lost.

Based on learnings, contextual TODO comments should be kept when they explain nearby implementation decisions or intended follow-up work; if kept, reference a tracked issue.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/compute-plane-services/nvca/internal/miniservice/status.go` around lines
513 - 514, Restore a concise TODO or follow-up comment immediately before the
workerContainerStatus.Ready check, preserving the readiness behavior context and
referencing the relevant tracked issue. Keep the existing “miniservice is
running” logic unchanged.

Source: Learnings

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@src/compute-plane-services/nvca/internal/miniservice/status.go`:
- Around line 513-514: Restore a concise TODO or follow-up comment immediately
before the workerContainerStatus.Ready check, preserving the readiness behavior
context and referencing the relevant tracked issue. Keep the existing
“miniservice is running” logic unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 4e0b8a16-8cb3-4b38-b2bf-9d7c277b844d

📥 Commits

Reviewing files that changed from the base of the PR and between c0028bf and c8787a0.

📒 Files selected for processing (6)
  • docs/user/cluster-management/configuration.md
  • docs/user/helm-functions.md
  • examples/function-samples/helmchart-samples/inference-test-sample/README.md
  • examples/function-samples/helmchart-samples/inference-test-sample/inference-test/templates/nvcf-workload-config.yaml
  • examples/function-samples/helmchart-samples/inference-test-sample/inference-test/values.yaml
  • src/compute-plane-services/nvca/internal/miniservice/status.go
🚧 Files skipped from review as they are similar to previous changes (4)
  • examples/function-samples/helmchart-samples/inference-test-sample/inference-test/values.yaml
  • examples/function-samples/helmchart-samples/inference-test-sample/README.md
  • docs/user/cluster-management/configuration.md
  • docs/user/helm-functions.md


# 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 No newline at end of file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add a new line

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)),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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.

| 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. |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Standard health handling puts terminal object failures into FailingObjectsBackoffTimeout before returning a terminal error. The document should explain which failures bypass backoff, or avoid promising immediate failure. The timeout table should also state whether each timeout applies to standard health, worker-readiness health, or both.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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.

StatusByWorkerReadiness: true
```

The ConfigMap **must** be named `nvcf-workload-config` and the `config.yaml` key **must** exist.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style - Remove the bolding


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.

Copy link
Copy Markdown
Contributor

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"


### Use worker readiness for function health

As described above, an unhealthy object, ex. a Pod, applied by the Helm chart can fail the function

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style - ex. => for example

# See the License for the specific language governing permissions and
# limitations under the License.

{{- if .Values.statusByWorkerReadiness }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you validate both template branches

  • Default/false omits nvcf-workload-config.
  • statusByWorkerReadiness=true renders the expected ConfigMap and flag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants