feat(self-host): flip DYN_SELF_HOST_METADATA default to ON (gh-8749) - #11417
Conversation
This comment has been minimized.
This comment has been minimized.
2e5e383 to
1428f39
Compare
1428f39 to
fc16f80
Compare
WalkthroughThe default behavior of ChangesSelf-host metadata default behavior change
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Comment |
There was a problem hiding this comment.
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 `@lib/llm/src/local_model.rs`:
- Around line 49-55: Add table-driven test coverage for
self_host_metadata_default to lock in the default-on behavior. Create cases for
None, whitespace-padded and mixed-case falsey inputs ("0", "false", "no",
"off"), truthy inputs, and arbitrary strings, and assert the function returns
the expected bool for each. Place the tests near self_host_metadata_default so
future changes to the normalization logic in this helper are caught.
🪄 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: 81084b5e-4b8a-4b19-89c8-f34c09d99bf5
📒 Files selected for processing (1)
lib/llm/src/local_model.rs
b840ab4 to
dcc89a0
Compare
Capstone of the gh-8749 stack: workers advertise their MDC files over the system_status_server by default instead of requiring shared storage. Behavior: - Unset env -> ON (new default) - 0/false/no/off (case-insensitive, trimmed) -> OFF (opt out) - Otherwise -> ON Hard-fail (anyhow::bail!) when self_host_metadata is on but DYN_SYSTEM_PORT is unset — surfaces misconfigurations at first registration instead of WARN spam plus silently degraded hf:// MDC advertisement. The k8s operator sets DYN_SYSTEM_PORT=9090 (see deploy/operator/internal/dynamo/component_worker.go), so operator- managed deployments are unaffected. Bare / non-operator upgrades either set DYN_SYSTEM_PORT or set DYN_SELF_HOST_METADATA=0. All prerequisites are in main: #8855 worker HTTP hosting on system_status_server #9057 frontend MDC verify-and-cache pipeline #9610 harvest non-weight siblings into slug_dir #9707 worker advertises non-typed metadata siblings via extra_files #10037 native preprocessor consumes resolved local_dir #10599 register_model uses engine's runai-pulled local dir on object-storage URIs #10351 auto-clean MetadataArtifactRegistry on detach Signed-off-by: nnshah1 <neelays@nvidia.com>
dcc89a0 to
9568584
Compare
The env-var parsing had no unit coverage after the default-on flip. Add tests locking in the inverted semantics: unset -> on; the recognized falsy tokens (0/false/no/off, any case, trimmed) opt out; explicit truthy plus empty or unrecognized values keep the default-on behavior. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Neelay Shah <neelays@nvidia.com>
…lt-on Signed-off-by: nnshah1 <neelays@nvidia.com> # Conflicts: # lib/llm/src/local_model.rs
…t comment Graham-review nits: OnceLock<()> -> Once (states run-once intent), and drop the inline comment that duplicated the ENV_SELF_HOST_METADATA doc. Signed-off-by: nnshah1 <neelays@nvidia.com>
parse_bool_opt already covers the falsy/truthy vocabulary in the truthy crate; keep one assertion per bucket (unset/empty/unrecognized/falsy). Signed-off-by: nnshah1 <neelays@nvidia.com>
dyn-3691-extract-shared-target-pid-cuda-customstorage-operation-layer * 'main' of https://github.com/ai-dynamo/dynamo: (50 commits) docs(cli): correct removed vLLM prefill-worker flag reference (#12581) docs(operator): reserve webhook Ignore for emergencies (#12563) ci(docs): make previews and checks match what actually publishes (#12339) refactor(vllm): organize custom encoder modules (#12416) feat(llm): Select reasoning output field via env var (#11464) feat(runtime): add TLS support to TCP request plane (#10921) fix: convert conditional disagg sglang warning to httperror 400 (#12578) feat(operator): add runtime feature gates (#12421) refactor(runtime): extract PushRouter transport seam behind StreamingDispatch trait (#12447) feat(replay): add deterministic canonical offline reports (#12363) build: bump ModelExpress to 0.5.0(OPS-7978) (#12455) fix(mocker): use logical KV tokens for decode timing (#12583) fix(examples): update Triton example for CUDA 13 + fix libdcgm copy (DYN-3697) (#12577) refactor(operator): implement composition-first DGD reconciliation (#12283) feat(frontend): add basetenkenizer backend (#12376) fix(profiler): configure rapid mocker without planner (#12573) docs(vllm): correct worker-role flags and document --kv-transfer-config (#12568) ci: add Kubernetes deploy test to nightly (#12090) fix(container): reuse pinned protoc in runtime image (#12535) feat(self-host): flip DYN_SELF_HOST_METADATA default to ON (gh-8749) (#11417) ... Signed-off-by: Hannah Zhang <hannahz@nvidia.com>
…) (#12963) Signed-off-by: Neelay Shah <neelays@nvidia.com> Signed-off-by: Thomas Montfort <tjmontfort12@gmail.com> Co-authored-by: Neelay Shah <neelays@nvidia.com> Co-authored-by: Ryan McCormick <rmccormick@nvidia.com>
Summary
Capstone of the gh-8749 stack: workers now advertise their MDC files over the
system_status_serverby default instead of requiring shared storage.What changes
lib/llm/src/local_model.rs(single file, +12/-37 after squash):self_host_metadata_default(None)returnstrue0/false/no/off(case-insensitive, trimmed) opt outanyhow::bail!) at first registration whenself_host_metadata=truebutDYN_SYSTEM_PORTis unset — surfaces misconfig at startup instead of WARN spam plus silently degradedhf://MDC advertisementBehavior enumeration
Without self-host (
DYN_SELF_HOST_METADATA=0)mainresolves to at that moment).hf://<repo>/<filename>URLs andmdcsum= fold of(basename, blake3)over its resolved files.mainmoved between the worker's download and the frontend's.With self-host (default,
DYN_SYSTEM_PORT=9090set — operator-managed deployments)http://<worker>:9090/v1/metadata/<ns>/<component>/<endpoint>/<slug>/<suffix>/<filename>pointing at its own copy.~/.cache/dynamo/mdc/by-slug/<slug>/<mdcsum>/; subsequent workers with the samemdcsumare cache hits.With self-host on but
DYN_SYSTEM_PORTunset (bare / non-operator upgrade)Worker
anyhow::bail!s at first model registration with an actionable message: setDYN_SYSTEM_PORTor opt out withDYN_SELF_HOST_METADATA=0.HF revision-mismatch and a possible follow-up
The self-host path solves the HF-mismatch problem by construction — worker-served bytes are the source of truth. The non-self-host path detects mismatches (blake3 fails and the frontend errors) but doesn't converge on the same revision.
The
hf://URL format the worker rewrites into already supports a revision segment:parse_hf_uriinlib/llm/src/model_card.rs:640handleshf://repo[@rev]/filename. The construction site (local_model.rs:619) currently buildshf://<source_path>/without a revision, but the resolved snapshot's SHA is knowable (HF cache stores files undersnapshots/<sha>/).Embedding the resolved SHA in the
hf://URL — e.g.hf://Qwen/Qwen3-0.6B@abcdef.../config.json— would let the frontend pin its download to the same revision the worker used, eliminating the mismatch class entirely in the non-self-host path. Small change; out of scope for this PR but a natural follow-up if the opt-out path is expected to be used long-term.Why now
All prerequisites are in main:
system_status_serverextra_fileslocal_dirregister_modeluses engine's runai-pulled local dir on object-storage URIsMetadataArtifactRegistryon detach (LoRA swap hygiene)Opt-out path
Existing deployments that need to fall back to shared-storage MDC delivery can pin
DYN_SELF_HOST_METADATA=0in their pod spec. That gives operators a rollback lever without needing an image swap.Test coverage — honest read
Existing e2e:
tests/frontend/test_self_host_metadata.py::test_worker_serves_metadata_via_http— a singlepost_mergetest that spins up a mocker withDYN_SELF_HOST_METADATA=trueexplicitly set, thencurls the/v1/metadata/...route.Gaps against this PR:
anyhow::bail!path whenDYN_SYSTEM_PORTis unset.=0).Recommendation before final merge: drop the explicit
DYN_SELF_HOST_METADATA=truefrom the existing test so it validates the default, and add one test for thebail!path. Both are small and belong in a follow-up commit on this PR.Docs
Only code-facing documentation was touched (the doc comment on
ENV_SELF_HOST_METADATA). No user-facing docs currently describe the two modes. If we want to broaden reach, options:docs/reference/glossary.mdexplaining "self-hosted vs shared-storage MDC delivery."DYN_SYSTEM_PORTis now required (it already sets 9090 by default).Test plan
cargo test -p dynamo-llm --libpasses locallycargo fmt --check/cargo clippy -p dynamo-llm --lib --no-depscleanbail!test🤖 Generated with Claude Code