Repository navigation
ci(sidecar): build all sidecars in one cargo build, stop queueing on cache locks - #17496
Conversation
…cache locks The sidecar image built each sidecar with its own `cargo build -p`. Per-package feature resolution differs between them, so dynamo-llm and most of the dependency tree compiled three times per architecture (vLLM 12m39, SGLang 10m52, TRT-LLM 8m13, LPX 1m39 on CI). One `cargo build` with all four `-p` flags compiles the shared tree once. The combined build links the vLLM sidecar's `mm-routing` into every binary, so the SGLang and TRT-LLM manifests enable it too. Each per-binary SBOM from `cargo cyclonedx` then lists exactly what that binary links. Nothing in those sidecars calls the feature. The cargo cache mounts move from sharing=locked to sharing=private. With locked, a second sidecar build on the same BuildKit worker waited for the whole of the first one; the 45 slowest jobs in two weeks waited 17-48 min. Part of DGH-2283 Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Alec Flowers <[email protected]>
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Enable mm-routing in sidecar manifests lib/sidecar/sglang/Cargo.toml, lib/sidecar/trtllm/Cargo.toml |
Both manifests enable the mm-routing feature for dynamo-llm. Comments describe its inclusion in the shared sidecar build and note that these crates do not call it. |
Configure the shared Cargo build lib/sidecar/Dockerfile |
The Dockerfile changes the architecture-specific Cargo cache mounts to sharing=private and replaces four package-specific build commands with one release build naming all four sidecars. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Merge Risk: 
Minimal · up to 70885
-
The change merges all four sidecars into one cargo build to cut CI time and removes cache-lock queueing. No concrete merge-blocking defect was established. One minor point is that default Python wheel builds now compile in the mm-routing feature, which the wheel documents as opt-in. No functional failure was shown from this.
Pre-merge checks: 
5
-
Full details: Title check
-
Explanation
The title names the main change: the sidecar build now compiles all sidecars in one cargo build, and the change also stops queueing on cache locks. It follows the conventional-commit style with a clear scope. The title is 80 characters, which is slightly long, but it stays specific and readable.
Full details: Description check
-
Explanation
The description follows the template. It has Overview, Key Changes, Validation, and Issues and Ongoing Work sections, and the checklist item is ticked. It gives the reason for the change, the file-level edits, measured local and CI-derived timings, memory figures, and the SBOM validation. It links the related work (DGH-2283,
#16360,#17498). The Closes#XXXXline from the template is missing, and the description does not say whether the PR closes an issue. The template marks this check as advisory today, so the gap does not block the description.
Full details: Docstring Coverage
-
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (3 skipped: 3 unsupported.)
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
✅ Dynamo PR CI passed — run 40634265260 (attempt 1) on
|
|
Non-blocking: could we explicitly note that enabling I measured a default release wheel at about 2.4 MB larger with this change. The feature also compiles in multimodal preprocessor paths, although I haven’t confirmed a user-facing behavior change in the default wheel. Calling out the broader scope would help reviewers assess the tradeoff. |
Auto-merge was disabled for another pull request in the stack
ai-dynamo#17496 let sidecar defaults enable mm-routing in every wheel through Cargo feature unification, and no check caught it. Add a rust-feature-builds step that fails when the default dynamo-py3 dependency graph contains llm-multimodal, and note in the bindings manifest why the sidecar dependencies turn default features off. Refs ai-dynamo#18132 Signed-off-by: cipheraxat <[email protected]>
Overview
dynamo-sidecar / Build multi-arch cpugates every PR that toucheslib/sidecar/**,Cargo.tomlorCargo.lock. Over Oct 13–27 it took p50 34 min and p90 57 min. This PR compiles the shared dependency tree once instead of three times per architecture, and removes the cache-lock queue behind the slowest runs.Key Changes
About 15 lines of core logic.
lib/sidecar/Dockerfile: onecargo build --releasewith all four-pflags replaces four sequentialcargo build -pcalls. The cargo cache mounts move fromsharing=lockedtosharing=private.lib/sidecar/sglang/Cargo.toml,lib/sidecar/trtllm/Cargo.toml: enabledynamo-llm/mm-routing, which the combined build links into these binaries anyway, so each per-binary SBOM fromcargo cyclonedxmatches its binary. LPX inherits it throughdynamo-trtllm-sidecar. Nothing in these sidecars calls it; the onlycfg(not(feature = "mm-routing"))branches are in the frontend preprocessor, which the sidecars don't run.Validation
-j 12cargo build --unit-graph)llm-multimodal,llm-tokenizer,symphonia*, …) under a combined buildsharing=lockedmounts before the first commanddocker buildx build(amd64):runtime,compliance_artifact--help; each per-binary SBOM listsllm-multimodalWhy each
cargo build -prebuilt the tree: the sidecars resolve features differently (vLLM'smm-routing,uuid/v7fromllm-tokenizer, andvllm-proto's build-timeprotox, which enables extra features in the build-script copies ofbytes,regexandprost). A crate's cache key includes its dependencies' keys, so each call recompileddynamo-runtime,dynamo-llmand most of the tree.Memory: the old comment ran the builds one after another to bound peak memory. The combined build peaked at 10.5 GB locally, against a 26 GiB request and 29 GiB limit on the Kubernetes fallback BuildKit pods. The remote BuildKit pods' resources are not in this repo.
Issues and Ongoing Work
dynamo-runtime→dynamo-llm→ link) change on most PRs. This PR removes the repeated compile instead.mm-routingfrom the sidecars (they need only the image placeholder token ID) is tracked separately.lib/sidecar/Dockerfile.Pull Request Checklist
/pr-checklistskill.🤖 Generated with Claude Code
Summary by CodeRabbit