Skip to content

fix: Restore running single-process without etcd#2342

Merged
grahamking merged 1 commit intomainfrom
gk-fix-etcd
Aug 6, 2025
Merged

fix: Restore running single-process without etcd#2342
grahamking merged 1 commit intomainfrom
gk-fix-etcd

Conversation

@grahamking
Copy link
Contributor

@grahamking grahamking commented Aug 6, 2025

I missed this in my review of #2011.

Creating a DistributedRuntime connects to etcd. When #2011 moved it up to the top of the function that meant that dynamo-run <model>, with no distributed system parts, would still try to connect to etcd.

This PR moves creating the Distributed Runtime back into the EngineConfig::Dynamic section, which is the only part that should talk to etcd.

Summary by CodeRabbit

  • Refactor
    • Improved the initialization sequence of the HTTP service to ensure all configuration is applied before the service starts. No changes to user-facing features or behavior.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 6, 2025

Walkthrough

The refactoring alters the initialization sequence of the HTTP service within the run function. The HTTP service builder is now configured with shared parameters first, and the actual building of the service is deferred until after engine-specific configuration within each match arm. This centralizes and conditions the build step based on the engine configuration variant.

Changes

Cohort / File(s) Change Summary
HTTP Service Initialization Refactor
lib/llm/src/entrypoint/input/http.rs
Refactored the HTTP service construction in the run function to defer building the service until after engine-specific configuration. The builder is now fully configured within each match arm before building and returning the service. No public API changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~7 minutes

Poem

A builder waits, its work deferred,
Until the engine's path is heard.
With branches split and setup done,
The service builds and then will run.
A rabbit hops through code so neat—
Refactoring makes the flow complete! 🐇✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dbe48a1 and 03d2fe6.

📒 Files selected for processing (1)
  • lib/llm/src/entrypoint/input/http.rs (4 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: the asyncenginecontextprovider trait in lib/runtime/src/engine.rs was intentionally changed from `se...
Learnt from: ryanolson
PR: ai-dynamo/dynamo#1919
File: lib/runtime/src/engine.rs:168-168
Timestamp: 2025-07-14T21:25:56.930Z
Learning: The AsyncEngineContextProvider trait in lib/runtime/src/engine.rs was intentionally changed from `Send + Sync + Debug` to `Send + Debug` because the Sync bound was overly constraining. The trait should only require Send + Debug as designed.

Applied to files:

  • lib/llm/src/entrypoint/input/http.rs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Build and Test - vllm
  • GitHub Check: pre-merge-rust (.)
  • GitHub Check: pre-merge-rust (lib/bindings/python)
🔇 Additional comments (8)
lib/llm/src/entrypoint/input/http.rs (8)

23-28: LGTM: Proper deferred service building setup.

The refactoring correctly creates a mutable HTTP service builder with shared configuration parameters, deferring the actual service building until after engine-specific setup. This enables conditional configuration based on the engine variant.


30-36: LGTM: Enables single-process mode without etcd.

The Dynamic engine configuration now properly handles the case where etcd is not available. The etcd client is conditionally added to the builder only if present, and the service is built after this configuration. This directly addresses the PR objective of restoring single-process mode without requiring etcd.


55-55: LGTM: Consistent return pattern.

The Dynamic variant correctly returns the built HTTP service to match the new pattern where each engine variant returns the configured service.


61-63: LGTM: Proper service building for StaticRemote.

The StaticRemote variant correctly builds the HTTP service after setting up the distributed runtime but before model registration. This maintains the logical flow while conforming to the new deferred building pattern.


101-101: LGTM: Consistent return pattern.

The StaticRemote variant correctly returns the built HTTP service.


104-109: LGTM: Proper service building for StaticFull.

The StaticFull variant correctly builds the HTTP service before model registration and returns it consistently with the new pattern.


116-132: LGTM: Proper service building for StaticCore.

The StaticCore variant correctly builds the HTTP service before pipeline creation and model registration, then returns it consistently with the new pattern.


134-134: LGTM: Clean match expression assignment.

The match expression now cleanly assigns the result to http_service, maintaining the same variable name and usage pattern as before the refactoring.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@grahamking grahamking enabled auto-merge (squash) August 6, 2025 21:40
@grahamking grahamking merged commit 63fbf49 into main Aug 6, 2025
15 of 16 checks passed
@grahamking grahamking deleted the gk-fix-etcd branch August 6, 2025 22:33
mkhazraee pushed a commit to whoisj/dynamo that referenced this pull request Aug 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants