Skip to content

fix(RL): [cherry-pick 1.5.0] stop RL worker discovery returning an empty list on Kubernetes (#14455) - #14898

Merged
nv-nmailhot merged 1 commit into
release/1.5.0from
dagil/cherry-pick-14455-release-1.5.0
Sep 15, 2026
Merged

nv-nmailhot merged 1 commit into
release/1.5.0from
dagil/cherry-pick-14455-release-1.5.0

Conversation

@dagil-nvidia

Copy link
Copy Markdown
Collaborator

Clean cherry-pick of #14455 onto release/1.5.0 for P0 6731829 (DYN-4309). No conflicts, no changes to the squash commit beyond the DCO sign-off.

🤖 Generated with Claude Code

…es (#14455)

Signed-off-by: [email protected] <[email protected]>
Signed-off-by: Biswa Panda <[email protected]>
Co-authored-by: Biswa Panda <[email protected]>
Co-authored-by: yunzhoul-nv <[email protected]>
(cherry picked from commit b43c373)
Signed-off-by: Dan Gil <[email protected]>
@dagil-nvidia
dagil-nvidia requested review from a team as code owners September 15, 2026 23:23
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-15T23:28:39.141299Z 581f183 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added fix documentation Improvements or additions to documentation frontend `python -m dynamo.frontend` and `dynamo-run in=http|text|grpc` labels Sep 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 581f183eb3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

| `DYN_NAMESPACE_WORKER_SUFFIX` | Match the single namespace `{DYN_NAMESPACE}-{DYN_NAMESPACE_WORKER_SUFFIX}` |
| `DYN_NAMESPACE` | Match this exact namespace. It falls back to `dynamo` only when unset, so setting it to an empty value searches the same empty namespace the workers register under |

The `dynamo` value is the one case where a prefix deliberately reaches past its own deployment: every other deployment's pause, resume, and weight-update endpoints then appear in this listener's `/v1/rl/workers`. On Kubernetes it is opt-in through `globalDynamoNamespace: true`, which makes the operator set `DYN_NAMESPACE_PREFIX=dynamo`. Use it only when one trainer is meant to control every deployment in the cluster.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Limit the claimed global scope to the Kubernetes namespace

On Kubernetes, DYN_NAMESPACE_PREFIX=dynamo cannot expose every deployment in the cluster: the discovery daemon watches DynamoWorkerMetadata through a namespaced API scoped to the listener pod's Kubernetes namespace (lib/runtime/src/discovery/kube/daemon.rs:189-202). A trainer following this statement may assume workers in other Kubernetes namespaces are included and then perform an incomplete fleet-wide control phase. Qualify both “every other deployment” and “every deployment in the cluster” as deployments within the listener's Kubernetes namespace.

Useful? React with 👍 / 👎.

|---|---|
| `DYN_NAMESPACE_PREFIX` | Match this namespace and the worker generations under it, so `ns` matches `ns` and `ns-abc123` but not the separate deployment `ns2`. The value `dynamo` means every namespace |
| `DYN_NAMESPACE_WORKER_SUFFIX` | Match the single namespace `{DYN_NAMESPACE}-{DYN_NAMESPACE_WORKER_SUFFIX}` |
| `DYN_NAMESPACE` | Match this exact namespace. It falls back to `dynamo` only when unset, so setting it to an empty value searches the same empty namespace the workers register under |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Do not present an empty runtime namespace as supported

Setting DYN_NAMESPACE= does not produce a usable worker namespace as documented here: normal workers eventually pass the empty string to Namespace::new, whose validate_allowed_chars predicate requires at least one character (lib/runtime/src/component.rs:593-604). Those workers therefore fail namespace construction instead of registering in an empty namespace for this listener to discover. Treat an empty value as absent or explicitly reject/document it as invalid rather than directing users to rely on it.

Useful? React with 👍 / 👎.

@dynamo-review-agent dynamo-review-agent 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.

Previously reported defects still present:

  • Original discussion: Still present: the documentation says DYN_NAMESPACE= searches the same empty namespace workers register under, but runtime namespace construction validates names with ^[a-z0-9-_]+$, so normal workers cannot register in an empty namespace.
  • Original discussion: Still present: the documentation says DYN_NAMESPACE_PREFIX=dynamo reaches every deployment in the cluster, but Kubernetes discovery watches DynamoWorkerMetadata with a namespaced API scoped to the listener pod's Kubernetes namespace.
  • Original discussion: Still present: the documentation says global scope reaches every deployment in the cluster, but Kubernetes discovery watches DynamoWorkerMetadata only in the listener pod's Kubernetes namespace.
  • Original discussion: Still present: the new documentation says an explicitly empty DYN_NAMESPACE selects an empty worker namespace, but namespace construction rejects empty values, so normal workers cannot register there.
  • Original discussion: Verified still present: the documentation says DYN_NAMESPACE_PREFIX=dynamo reaches every deployment in the cluster, while Kubernetes discovery watches DynamoWorkerMetadata only in the listener pod's Kubernetes namespace.
  • Original discussion: Verified still present: the documentation says an explicitly empty DYN_NAMESPACE discovers workers registered in an empty namespace, but runtime namespace validation rejects empty names (^[a-z0-9-_]+$).
  • Original discussion: Verified: Kubernetes discovery watches DynamoWorkerMetadata only in the listener pod's Kubernetes namespace. The documentation still describes globalDynamoNamespace discovery as covering every deployment in the cluster.
  • Original discussion: Verified: an empty DYN_NAMESPACE is retained by the Python worker namespace helper, but Rust Namespace validation rejects empty names. The new documentation still claims workers register under an empty namespace.

Comment thread lib/rl/src/lib.rs
NamespaceFilter::Global,
),
(
"a global prefix wins over a suffix that is also set",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The a global prefix wins over a suffix that is also set table row only combines two contracts already protected by retained rows: non-global prefix wins over a suffix that is also set catches suffix-before-prefix precedence regressions, and a global prefix means every namespace catches loss of the global-prefix mapping. This extra cross-product input protects no distinct observable behavior.

🤖 AI Fix

Remove the a global prefix wins over a suffix that is also set case from resolve_namespace_filter_precedence.

@nv-nmailhot
nv-nmailhot merged commit be4956d into release/1.5.0 Sep 15, 2026
36 of 37 checks passed
@nv-nmailhot
nv-nmailhot deleted the dagil/cherry-pick-14455-release-1.5.0 branch September 15, 2026 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation fix frontend `python -m dynamo.frontend` and `dynamo-run in=http|text|grpc` size/XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants