Skip to content

Conversation

biswapanda
Copy link
Contributor

@biswapanda biswapanda commented Jul 10, 2025

Overview:

Add hello world k8s deployment example

Closes: DYN-695
Fixes: nvbug: 5383701

Summary by CodeRabbit

  • New Features
    • Added a Kubernetes deployment manifest for the hello-world example, enabling easy deployment of Frontend, Middle, and Backend services.
  • Chores
    • Updated the Backend service configuration to use a single worker.

Copy link
Contributor

coderabbitai bot commented Jul 10, 2025

Walkthrough

A new Kubernetes deployment manifest for the hello_world example was added, defining a custom resource with three services: Frontend, Middle, and Backend. Additionally, the Backend service's worker count in the configuration file was changed from 2 to 1. No other resource or parameter changes were made.

Changes

File(s) Change Summary
examples/hello_world/config.yaml Changed Backend service's number of workers from 2 to 1.
examples/hello_world/deploy/k8s/hello_world.yaml Added new Kubernetes manifest defining a DynamoGraphDeployment with Frontend, Middle, and Backend services.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Frontend
    participant Middle
    participant Backend

    User->>Frontend: Send request
    Frontend->>Middle: Forward request
    Middle->>Backend: Forward request
    Backend-->>Middle: Process and respond
    Middle-->>Frontend: Process and respond
    Frontend-->>User: Respond
Loading

Poem

A hop, a skip, a YAML file new,
Three services lined up, in a Kubernetes queue.
Backend’s worker count now trimmed down to one,
Hello World deploys—oh what fun!
🐇✨
From config to cluster, the changes are done!


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

🧹 Nitpick comments (2)
examples/hello_world/deploy/k8s/hello_world.yaml (2)

48-73: Explicitly set componentType for Middle to avoid implicit default.

Only Frontend declares componentType: main. The CRD currently defaults missing values to "worker" but being explicit improves readability and guards against future default changes.

     Middle:
+      componentType: worker

75-99: Backend section mirrors Frontend—consider YAML anchors or kustomize for DRYness.

All three service blocks repeat identical resource and container specs (except the service name). Using YAML anchors/aliases or templating (Helm/kustomize) would trim ~60 lines and make future edits less error-prone.

Example with anchors:

x-common: &common
  replicas: 1
  resources:
    requests:
      cpu: "1"
      memory: "2Gi"
    limits:
      cpu: "1"
      memory: "2Gi"
  extraPodSpec:
    #

Frontend:
  <<: *common
  componentType: main
  #

Middle:
  <<: *common
  componentType: worker
  #

Backend:
  <<: *common
  componentType: worker
  #
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between e1ae0f1 and 70ab400.

📒 Files selected for processing (2)
  • examples/hello_world/config.yaml (1 hunks)
  • examples/hello_world/deploy/k8s/hello_world.yaml (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
examples/hello_world/config.yaml (3)
Learnt from: nnshah1
PR: ai-dynamo/dynamo#1444
File: tests/fault_tolerance/configs/agg_tp_1_dp_8.yaml:31-38
Timestamp: 2025-07-01T15:33:53.262Z
Learning: In fault tolerance test configurations, the `resources` section under `ServiceArgs` specifies resources per individual worker, not total resources for all workers. So `workers: 8` with `gpu: '1'` means 8 workers × 1 GPU each = 8 GPUs total.
Learnt from: fsaady
PR: ai-dynamo/dynamo#1730
File: examples/sglang/slurm_jobs/scripts/worker_setup.py:230-244
Timestamp: 2025-07-03T10:14:30.570Z
Learning: In examples/sglang/slurm_jobs/scripts/worker_setup.py, background processes (like nats-server, etcd) are intentionally left running even if later processes fail. This design choice allows users to manually connect to nodes and debug issues without having to restart the entire SLURM job from scratch, providing operational flexibility for troubleshooting in cluster environments.
Learnt from: GuanLuo
PR: ai-dynamo/dynamo#1371
File: examples/llm/benchmarks/vllm_multinode_setup.sh:18-25
Timestamp: 2025-06-05T01:46:15.509Z
Learning: In multi-node setups with head/worker architecture, the head node typically doesn't need environment variables pointing to its own services (like NATS_SERVER, ETCD_ENDPOINTS) because local processes can access them via localhost. Only worker nodes need these environment variables to connect to the head node's external IP address.
⏰ 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). (1)
  • GitHub Check: Build and Test - vllm
🔇 Additional comments (2)
examples/hello_world/config.yaml (1)

31-36: Worker count reduction brings CPU request back in line – double-check remaining services.

Changing Backend.ServiceArgs.workers from 2 → 1 prevents the previous over-subscription (recall that the cpu: "1" entry is per worker, per learning #1444). Good catch.
While you’re here, confirm that Middle (still workers: 2, cpu: "1") is intentional; at present that pod will ask the scheduler for 1 CPU yet try to run two worker processes.

examples/hello_world/deploy/k8s/hello_world.yaml (1)

49-57: CPU request may be insufficient for Middle’s two workers.

Middle pod requests only 1 CPU but config.yaml launches 2 workers. Either raise the CPU request/limit (e.g., "2") or lower workers to 1 to avoid throttling.

Copy link

copy-pr-bot bot commented Jul 10, 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

@julienmancuso julienmancuso left a comment

Choose a reason for hiding this comment

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

lgtm

@biswapanda biswapanda merged commit 8cd9411 into main Jul 10, 2025
6 checks passed
@biswapanda biswapanda deleted the bis/example-hw branch July 10, 2025 19:25
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.

3 participants