Skip to content

Conversation

nv-tusharma
Copy link
Contributor

@nv-tusharma nv-tusharma commented Aug 4, 2025

Overview:

Add common, test dependencies to the sglang runtime container so that it follows suite with other backend images.

Details:

  • Add test/common deps to the sglang runtime image.

Where should the reviewer start?

  • dockerfile.sglang

Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)

  • closes GitHub issue: #xxx

Summary by CodeRabbit

  • Chores
    • Updated container image to install additional Python dependencies for runtime and testing.

Copy link
Contributor

coderabbitai bot commented Aug 4, 2025

Walkthrough

Two new RUN commands were added to the runtime image stage of container/Dockerfile.sglang to install Python dependencies from requirements.txt and requirements.test.txt using bind mounts. These additions are marked as temporary, with comments suggesting future migration to pyproject.toml or a dedicated CI image.

Changes

Cohort / File(s) Change Summary
Dockerfile Dependency Installation
container/Dockerfile.sglang
Added RUN commands to install Python dependencies and test dependencies from requirements files using bind mounts; included comments noting these are temporary solutions.

Sequence Diagram(s)

Not applicable; no new feature or control flow changes were introduced.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~7 minutes

Possibly related PRs

Poem

🐇
In Docker’s den, new lines appear,
To fetch dependencies, both far and near.
Requirements mounted, pip commands run,
Temporary fixes—work’s never done!
Soon pyproject will take the stage,
But for now, these RUNs engage.
Hopping forward, code’s arranged!

Note

⚡️ Unit Test Generation is now available in beta!

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


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.

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: 0

🧹 Nitpick comments (1)
container/Dockerfile.sglang (1)

452-456: Collapse the two-step install, mark mounts read-only, and reuse the uv cache

Installing the common requirements in a dedicated RUN layer and then repeating for the test requirements immediately afterwards costs one extra layer and forfeits cache reuse.
Minor but free wins:

  1. Mount both requirements files read-only (ro=true) – they never need write-access.
  2. Re-use the uv wheel cache as done earlier (--mount=type=cache,target=/root/.cache/uv).
  3. Combine both requirements into a single uv pip install invocation to save a layer and speed up future rebuilds.
-# Common dependencies
-# TODO: Remove extra install and use pyproject.toml to define all dependencies
-RUN --mount=type=bind,source=./container/deps/requirements.txt,target=/tmp/requirements.txt \
-    uv pip install --requirement /tmp/requirements.txt
+RUN --mount=type=bind,source=./container/deps/requirements.txt,target=/tmp/requirements.txt,ro=true \
+    --mount=type=bind,source=./container/deps/requirements.test.txt,target=/tmp/requirements.test.txt,ro=true \
+    --mount=type=cache,target=/root/.cache/uv \
+    uv pip install \
+        --requirement /tmp/requirements.txt \
+        --requirement /tmp/requirements.test.txt

This leaves the TODO in place while shaving image size and build time.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 26dc628 and 6bed4d8.

📒 Files selected for processing (1)
  • container/Dockerfile.sglang (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: nnshah1
PR: ai-dynamo/dynamo#1444
File: tests/fault_tolerance/scenarios.py:57-57
Timestamp: 2025-07-01T15:39:56.789Z
Learning: The fault tolerance tests in tests/fault_tolerance/ are designed to run only in the mounted container environment, so hardcoded absolute paths with `/workspace/` prefix are intentional and should not be changed to relative paths.
⏰ 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 (1)
container/Dockerfile.sglang (1)

458-460: Re-evaluate shipping test-only dependencies in the runtime image

The test requirements inflate the production runtime image and broaden the attack surface.
If these deps are strictly for CI, consider moving the install to the ci_minimum or a dedicated test stage instead of the final runtime stage.
Otherwise document the production need so future maintainers don’t accidentally strip them.

@nv-tusharma
Copy link
Contributor Author

/ok to test 6bed4d8

@nv-tusharma nv-tusharma merged commit 4b8a748 into main Aug 4, 2025
12 of 13 checks passed
@nv-tusharma nv-tusharma deleted the tusharma/add-sglang-test-deps branch August 4, 2025 21:32
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