Repository navigation
feat(kv-router,sidecar): worker leases, static workers file, and sidecar catalog registration - #21
Closed
ishandhanani wants to merge 2 commits into
Closed
ishandhanani wants to merge 2 commits into
ishandhanani wants to merge 2 commits into
Conversation
ishandhanani
had a problem deploying
to
external_collaborator
September 3, 2026 08:51 — with
GitHub Actions
Failure
Phase 4 (registration and liveness, contract 4) of the runtime-optional
frontend roadmap: the catalog no longer needs a discovery lease to notice a
dead worker, and a deployment with no discovery plane can register its workers
from a file.
- WorkerRequest.ttl_secs starts a registration lease. POST
/workers/{id}/heartbeat renews it (optional body changes the TTL; a worker
registered without a TTL must supply one to start a lease). A lease sweeper
wakes at the next deadline; an expired worker is drained and deregistered
through the existing delete path and its record is left unschedulable with
reason `lease expired` until the worker re-registers. Expiry is exposed as
SelectionCore::expire_leases so hosts and tests can drive it.
- SelectionServiceBuilder::initial_workers / initial_workers_file,
SelectionServiceConfig.workers_file, and --workers-file on
dynamo.select_service register a JSON array of POST /workers bodies before
the service serves selections; an unparseable file fails startup.
Tests: lease renew/TTL change/validation, expiry drains exactly the expired
worker once and leaves unleased workers alone, re-registration revives the
lease; HTTP heartbeat round trip incl. 404 and 400 paths; builder registers
initial and file workers and rejects a bad file.
Signed-off-by: Ishan Dhanani <[email protected]>
Phase 4 (registration and liveness), second slice: the runtime-free registration path. A sidecar can register its worker with a selection service instead of (or alongside) Dynamo discovery, so no etcd or NATS sits between the worker and the selector. - dynamo-sidecar-common gains a catalog agent: CatalogRegistration (the POST /workers body), CatalogClient (register / heartbeat / deregister), and CatalogAgent, which heartbeats at half the TTL, re-registers when the catalog reports the worker unknown, and deregisters when cancelled. - The vLLM sidecar takes --selection-catalog-url (+ TTL and routing-group flags). It requires --advertise-grpc-endpoint: the record's dispatch endpoint is the advertised gRPC address, and vLLM's own KV-event ZMQ publishers are rehosted onto that host as the record's kv_events_endpoints, so the selector subscribes to the engine directly. The routing group defaults to the disaggregation role. Registration happens in start() with the runtime-issued worker id; cleanup() cancels the agent and waits up to 3s for deregistration so the selector drains the worker immediately. Also fixes the direct-dispatch test in the vLLM mocker crate, whose expect_err needed Debug on the engine type. Tests: end-to-end against a real selection service router and the mock vLLM gRPC server: the record carries the advertised endpoint, block size, TTL, rehosted KV endpoints and is schedulable; heartbeats outlive a 0.4s TTL; cleanup leaves the worker unschedulable; a catalog URL without an advertised endpoint is rejected at startup. Signed-off-by: Ishan Dhanani <[email protected]>
ishandhanani
force-pushed
the
idhanani/p4-catalog-heartbeat
branch
from
September 3, 2026 09:05
e312889 to
6d0bf05
Compare
ishandhanani
had a problem deploying
to
external_collaborator
September 3, 2026 09:05 — with
GitHub Actions
Failure
ishandhanani
had a problem deploying
to
external_collaborator
September 3, 2026 09:05 — with
GitHub Actions
Failure
This was referenced Sep 3, 2026
Owner
Author
This branch had an error being deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 4 (contract 4: registration and liveness), slices 1 and 2. Stacked on #20.
Summary
Two commits that together make worker registration runtime-free end to end: the selection catalog becomes a lease-based registry, and the vLLM sidecar registers into it over HTTP.
Slice 1: leases + static workers file (kv-router)
WorkerRequest.ttl_secsstarts a lease;POST /workers/{id}/heartbeatrenews it (optional{"ttl_secs": N}changes it; unleased worker without TTL ->400; unknown ->404). Response carries the record andlease_secs.delete_workerpath and leaves the recordunschedulablewith reasonlease expired; a laterPOST /workersrevives it.expire_leases()exposed for hosts/tests.SelectionServiceBuilder::initial_workers/initial_workers_file,SelectionServiceConfig.workers_file,--workers-fileondynamo.select_service.Slice 2: sidecar catalog agent (sidecar-common + vLLM sidecar)
dynamo_sidecar_common::catalog:CatalogRegistration(thePOST /workersbody),CatalogClient(register/heartbeat/deregister),CatalogAgent(heartbeats at TTL/2, re-registers on404, deregisters when cancelled).--selection-catalog-url(+--selection-catalog-ttl-secs,--selection-catalog-routing-group), requiring--advertise-grpc-endpoint. The record's dispatch endpoint is the advertised gRPC address; vLLM's own KV-event ZMQ publishers are rehosted onto that host askv_events_endpoints, so the selector subscribes to the engine directly. Registration runs instart()with the runtime-issued worker id;cleanup()cancels the agent and waits up to 3 s for deregistration.standalone-selection.md,sidecar-backends.md, vLLM sidecar README.expect_erron a non-Debugtype in the vLLM mocker direct-dispatch test (amended into feat(router): direct native-gRPC dispatch beside the request plane #19 as well).Still to come in Phase 4: own ZMQ replay for the agent path, the Kubernetes pod feeder generalized from the EPP reflector, model-card source independent of discovery, and the frontend assembly with no
DistributedRuntime.Validation
cargo test -p dynamo-kv-router --features standalone-selection --lib: 1080 passed (new lease/heartbeat/workers-file tests).cargo test -p dynamo-vllm-mocker -p dynamo-vllm-sidecar -p dynamo-sidecar-common: all pass, includingsidecar_registers_with_a_selection_catalog_and_deregisters_on_cleanupagainst a real selection-service router and the mock vLLM gRPC server (record fields, rehosted KV endpoints, heartbeats outliving a 0.4 s TTL, unschedulable after cleanup, startup rejection without an advertised endpoint).registry.rswarning only), sidecar-common, vLLM sidecar, vLLM mocker.cargo check --features select-servicefor the Python bindings: clean.cargo fmt,docs_lint.pyclean.