Skip to content

feat(operator): enable worker canary health checks - #11083

Open
xianlubird wants to merge 4 commits into
ai-dynamo:mainfrom
xianlubird:feat/enable-k8s-canary-health-checks
Open

feat(operator): enable worker canary health checks#11083
xianlubird wants to merge 4 commits into
ai-dynamo:mainfrom
xianlubird:feat/enable-k8s-canary-health-checks

Conversation

@xianlubird

@xianlubird xianlubird commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Overview

Enable canary worker health checks by default for Kubernetes operator-managed workers. This brings the operator back in line with the published health check documentation, which states that Kubernetes deployments default DYN_HEALTH_CHECK_ENABLED to true: https://docs.nvidia.com/dynamo/user-guides/observability-local/health-checks#worker-liveness-and-health-check

Details

  • Set the worker base container default DYN_HEALTH_CHECK_ENABLED value to true.
  • Update Grove, DCD, and controller test expectations for newly rendered worker specs.
  • Keep upgrade-test persisted child fixtures at the old false value and explicitly assert that upgrading across this default flip changes the child spec hash, while still preserving legacy worker identity labels.

The worker default was disabled in #5038 as a temporary mitigation for DIS-1185 races involving discovery propagation, NATS subscription readiness, and health check requests. The underlying issues have since been addressed:

With those fixes in place, Kubernetes workers can now use the documented default and require the canary path to validate readiness.

Where should the reviewer start?

Start with deploy/operator/internal/dynamo/component_worker.go, then review the test expectation updates in deploy/operator/internal/dynamo/graph_test.go, deploy/operator/internal/controller/dynamocomponentdeployment_controller_test.go, and deploy/operator/internal/controller/upgrade_test.go.

Related Issues

Summary

  • Enable DYN_HEALTH_CHECK_ENABLED=true by default for operator-managed worker components in Kubernetes.
  • Align the operator behavior with the published Kubernetes health check default.
  • Document and test that existing persisted worker children with the old default will roll out when reconciled with the new default.

Validation

  • go test ./internal/dynamo ./internal/controller from deploy/operator
  • git diff --check

@copy-pr-bot

copy-pr-bot Bot commented Jun 30, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@xianlubird
xianlubird temporarily deployed to external_collaborator June 30, 2026 07:33 — with GitHub Actions Inactive
@github-actions

Copy link
Copy Markdown
Contributor

👋 Hi xianlubird! Thank you for contributing to ai-dynamo/dynamo.

Just a reminder: The NVIDIA Test Github Validation CI runs an essential subset of the testing framework to quickly catch errors.Your PR reviewers may elect to test the changes comprehensively before approving your changes.

🚀

@github-actions github-actions Bot added external-contribution Pull request is from an external contributor feat deployment::k8s Relates to dynamo deployment in kubernetes labels Jun 30, 2026
@xianlubird
xianlubird marked this pull request as ready for review June 30, 2026 07:35
@xianlubird
xianlubird requested a review from a team as a code owner June 30, 2026 07:35

@devin-ai-integration devin-ai-integration Bot left a comment

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.

Devin Review found 2 potential issues.

Open in Devin Review

Comment thread deploy/operator/internal/controller/upgrade_test.go Outdated
Comment thread deploy/operator/internal/dynamo/component_worker.go
@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

GetBaseContainer in component_worker.go changes DYN_HEALTH_CHECK_ENABLED from "false" to "true". All test fixtures and assertions across controller and graph tests are updated to match the new value.

Health Check Env Var Default

Layer / File(s) Summary
GetBaseContainer env var change
deploy/operator/internal/dynamo/component_worker.go
DYN_HEALTH_CHECK_ENABLED set to "true" instead of "false" in GetBaseContainer.
Test fixture updates
deploy/operator/internal/controller/dynamocomponentdeployment_controller_test.go, deploy/operator/internal/controller/upgrade_test.go, deploy/operator/internal/dynamo/graph_test.go
All test expectations and embedded YAML fixtures updated to assert DYN_HEALTH_CHECK_ENABLED as "true" across Deployment, LeaderWorkerSet, PodCliqueSet, SGLang, and VLLM scenarios.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: enabling worker health checks by default.
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.
Description check ✅ Passed The PR description includes the required sections and key implementation/validation details, with only minor template-format deviations in Related Issues.

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

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 1

🤖 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 `@deploy/operator/internal/controller/upgrade_test.go`:
- Line 167: The pre-upgrade fixture data in upgrade_test.go is now modeling the
post-change state, so the hash comparison in the rollout compatibility tests can
no longer detect a default flip. Update the persisted child object fixtures used
by the specHash(oldChild) and specHash(newChild) assertions to keep
DYN_HEALTH_CHECK_ENABLED at the old persisted value, or if the rollout is
intended, split the affected cases in the relevant test helpers so they
explicitly assert a rollout instead of no-change behavior.
🪄 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: 378786f7-a274-48a0-9915-366ec256a624

📥 Commits

Reviewing files that changed from the base of the PR and between 61865e9 and edd7f74.

📒 Files selected for processing (4)
  • deploy/operator/internal/controller/dynamocomponentdeployment_controller_test.go
  • deploy/operator/internal/controller/upgrade_test.go
  • deploy/operator/internal/dynamo/component_worker.go
  • deploy/operator/internal/dynamo/graph_test.go

Comment thread deploy/operator/internal/controller/upgrade_test.go Outdated
@xianlubird
xianlubird force-pushed the feat/enable-k8s-canary-health-checks branch from edd7f74 to 422a8d4 Compare June 30, 2026 07:54
@xianlubird
xianlubird temporarily deployed to external_collaborator June 30, 2026 07:54 — with GitHub Actions Inactive
Comment thread deploy/operator/internal/dynamo/component_worker.go Outdated
@rmccorm4

Copy link
Copy Markdown
Contributor

/ok to test 422a8d4

@xianlubird

Copy link
Copy Markdown
Contributor Author

@rmccorm4
Updated the PR to avoid enabling DYN_HEALTH_CHECK_ENABLED unconditionally for every worker.

The base worker default now stays conservative, and each backend opts in only for modes that are known to provide a non-nil canary health_check_payload. Specifically, vLLM/TRT-LLM decode workers remain disabled because they do not currently provide a canary payload, and SGLang tokenizer mode remains disabled because its unified backend explicitly returns None for health_check_payload. Regular vLLM, TRT-LLM, and SGLang worker modes still default to canary health checks.

This keeps the Kubernetes default aligned with the docs for supported worker modes while avoiding permanent NotReady endpoints for modes that cannot satisfy the generate canary yet.

@datadog-official

datadog-official Bot commented Jul 1, 2026

Copy link
Copy Markdown

Tests

🔄 Datadog auto-retried 1 job - 1 passed on retry View in Datadog

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 48.95% (-8.97%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 8a61cd2 | Docs | Datadog PR Page | Give us feedback!

@xianlubird
xianlubird temporarily deployed to external_collaborator July 1, 2026 03:09 — with GitHub Actions Inactive
@sttts

sttts commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

/ok to test f53dc29

Comment thread deploy/operator/internal/controller/upgrade_test.go
@tmonty12

tmonty12 commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

The base worker default now stays conservative, and each backend opts in only for modes that are known to provide a non-nil canary health_check_payload. Specifically, vLLM/TRT-LLM decode workers remain disabled because they do not currently provide a canary payload, and SGLang tokenizer mode remains disabled because its unified backend explicitly returns None for health_check_payload. Regular vLLM, TRT-LLM, and SGLang worker modes still default to canary health checks.

TRT-LLM decode worker does provide a canary payload:

self._disaggregation_mode = disaggregation_mode
, as does vllm. Since unified backend is not the default, we are not concerned about the SGLang tokenizer mode.

Adding conditional logic in the operator based on flags/env-vars is fragile and best avoided.

@xianlubird
xianlubird temporarily deployed to external_collaborator July 2, 2026 01:16 — with GitHub Actions Inactive
@xianlubird
xianlubird temporarily deployed to external_collaborator July 30, 2026 06:26 — with GitHub Actions Inactive
@xianlubird
xianlubird requested a review from a team as a code owner July 30, 2026 06:49
@xianlubird
xianlubird temporarily deployed to external_collaborator July 30, 2026 06:49 — with GitHub Actions Inactive
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Jul 30, 2026
Comment thread deploy/operator/internal/controller/dynamocomponentdeployment_controller_test.go Outdated
Comment thread deploy/operator/internal/dynamo/graph_test.go Outdated
Comment thread deploy/operator/internal/dynamo/hash.go
Comment thread deploy/operator/internal/dynamo/component_worker.go Outdated
Comment thread deploy/operator/internal/dynamo/component_worker.go Outdated
Signed-off-by: xianlubird <xianlubird@gmail.com>
@xianlubird
xianlubird force-pushed the feat/enable-k8s-canary-health-checks branch from 3823ffb to 8a61cd2 Compare August 17, 2026 08:36
@xianlubird
xianlubird temporarily deployed to external_collaborator August 17, 2026 08:37 — with GitHub Actions Inactive
@dynamo-ops

Copy link
Copy Markdown
Contributor

/ok to test 8a61cd2

@xianlubird

Copy link
Copy Markdown
Contributor Author

The vLLM deploy CI failure is unrelated to this PR's code: actions/setup-python failed while upgrading pip due to repeated 502 responses from files.pythonhosted.org, before the deploy test started.

Comment thread deploy/operator/internal/dynamo/component_worker.go Outdated
Comment thread deploy/operator/internal/dynamo/graph.go
Signed-off-by: xianlubird <xianlubird@gmail.com>
@xianlubird
xianlubird temporarily deployed to external_collaborator August 19, 2026 02:14 — with GitHub Actions Inactive
@dynamo-ops

Copy link
Copy Markdown
Contributor

/ok to test 52da0a0

Signed-off-by: xianlubird <xianlubird@gmail.com>
@xianlubird
xianlubird temporarily deployed to external_collaborator August 19, 2026 02:35 — with GitHub Actions Inactive
@dynamo-ops

Copy link
Copy Markdown
Contributor

/ok to test 0f0b07c

Comment thread deploy/operator/internal/dynamo/graph.go
@nv-anants
nv-anants deployed to external_collaborator August 27, 2026 16:12 — with GitHub Actions Active
@dynamo-ops

Copy link
Copy Markdown
Contributor

/ok to test 66b0fce

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

Labels

deployment::k8s Relates to dynamo deployment in kubernetes documentation Improvements or additions to documentation external-contribution Pull request is from an external contributor feat size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants