Skip to content

chore: add high availability etcd docker compose #1477

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ishandhanani
Copy link
Contributor

@ishandhanani ishandhanani commented Jun 11, 2025

We now spin up 3 ETCD replicas with the first one having the default 2379 port so a user does not have to change anything. The other two are also up allowing developers to test what happens when 1 goes down.

If a user wants to test - they can now do

export ETCD_ENDPOINTS=localhost:2379,localhost:23791,localhost:23792
dynamo serve graphs.agg:Frontend -f configs/agg.yaml

Take any of the 3 ETCD replicas down (we need 2 for consensus). Logs looks like

025-06-11T19:55:34.820Z  INFO dynamo_runtime::transports::etcd: kv watch stream closed
2025-06-11T19:55:34.821Z  INFO dynamo_runtime::transports::etcd: kv watch stream closed
2025-06-11T19:55:34.822Z DEBUG dynamo_runtime::component::client: watch stream has closed; shutting down endpoint watcher for prefix: instances/dynamo/SGLangDecodeWorker/generate
2025-06-11T19:55:34.822Z DEBUG dynamo_runtime::component::client: Completed endpoint watcher for prefix: instances/dynamo/SGLangDecodeWorker/generate
2025-06-11T19:55:52.451Z DEBUG chat_completions: dynamo_runtime::pipeline::network::tcp::server: Registering new TcpStream on 10.128.0.190:41555

But lease won't be canceled taking everything down

Summary by CodeRabbit

  • New Features
    • Upgraded etcd setup from a single server to a three-node etcd cluster for improved reliability and availability.
  • Chores
    • Updated service names and port mappings to support the new multi-node cluster configuration.

Copy link

copy-pr-bot bot commented Jun 11, 2025

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Copy link
Contributor

coderabbitai bot commented Jun 11, 2025

Walkthrough

The existing single-node etcd service in the Docker Compose configuration has been replaced with a three-node etcd cluster. Each node is configured with specific environment variables for cluster membership and communication, and unique host port mappings are assigned to avoid conflicts.

Changes

File(s) Change Summary
lib/runtime/docker-compose.yml Replaced single etcd service with three-node etcd cluster, added cluster configuration variables, and set unique port mappings for each node.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant etcd0
    participant etcd1
    participant etcd2

    User->>etcd0: Connect via client port 2379
    User->>etcd1: Connect via client port 23791
    User->>etcd2: Connect via client port 23792
    etcd0-->>etcd1: Peer communication (2380/23801)
    etcd0-->>etcd2: Peer communication (2380/23802)
    etcd1-->>etcd0: Peer communication (23801/2380)
    etcd1-->>etcd2: Peer communication (23801/23802)
    etcd2-->>etcd0: Peer communication (23802/2380)
    etcd2-->>etcd1: Peer communication (23802/23801)
Loading

Poem

Three little nodes, in Docker they dwell,
Etcd cluster—oh, what a swell!
Ports mapped neatly, no more fight,
Peers now chatter through day and night.
From one to three, the quorum’s in sight—
Clustered together, everything’s right!
🐇✨


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.
    • @coderabbitai modularize this function.
  • 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.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
lib/runtime/docker-compose.yml (1)

57-71: Apply same client advertise URL fix to etcd2

The recommendation for etcd1 also applies here—replace 0.0.0.0 with etcd2 in the ETCD_ADVERTISE_CLIENT_URLS setting.

🧹 Nitpick comments (1)
lib/runtime/docker-compose.yml (1)

41-56: Use service hostname in ETCD_ADVERTISE_CLIENT_URLS for etcd1

Advertising 0.0.0.0 is not routable by other containers. Change to the service name so peers and clients can resolve it internally:

-      - ETCD_ADVERTISE_CLIENT_URLS=http://0.0.0.0:2379
+      - ETCD_ADVERTISE_CLIENT_URLS=http://etcd1:2379

You may also want to mirror the restart policy and version-pinning changes from etcd0 here.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 150e983 and d1c0c17.

📒 Files selected for processing (1)
  • lib/runtime/docker-compose.yml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: pre-merge-rust (lib/bindings/python)
  • GitHub Check: pre-merge-rust (lib/runtime/examples)
  • GitHub Check: pre-merge-rust (.)
  • GitHub Check: Build and Test - vllm

Copy link
Contributor

Choose a reason for hiding this comment

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

Take any of the 3 ETCD replicas down (we need 2 for consensus). Logs looks like

What happens if 2 go down? Does 1 standalone no longer work with ETCD_*_CLUSTER settings?

Copy link
Contributor

Choose a reason for hiding this comment

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

If user starts all 3 with docker-compose up, but then sets only export ETCD_ENDPOINTS=localhost:2379, does that still work as well?

Copy link
Contributor Author

@ishandhanani ishandhanani Jun 11, 2025

Choose a reason for hiding this comment

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

Yes - this works out of the box. That's why the first endpoint is the default 2379

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