Skip to content

Conversation

@andoorve
Copy link

@andoorve andoorve commented Jun 12, 2025

Overview:

Adds the correct env variables for pointers to the nixl plugins.

Summary by CodeRabbit

  • Chores
    • Updated container images to improve plugin discovery by setting environment variables for NIXL library and plugin directories. This ensures smoother runtime operation for related features.

andoorve added 3 commits June 11, 2025 20:30
Signed-off-by: Murali Andoorveedu <[email protected]>
Signed-off-by: Murali Andoorveedu <[email protected]>
Signed-off-by: Murali Andoorveedu <[email protected]>
@copy-pr-bot
Copy link

copy-pr-bot bot commented Jun 12, 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.

@github-actions
Copy link

👋 Hi andoorve! Thank you for contributing to ai-dynamo/dynamo.

Just a reminder: The NVIDIA Test Github Validation CI runs an essential subset of the testing framework to quickly catch errors.Your PR reviewers may elect to test the changes comprehensively before approving your changes.

🚀

@github-actions github-actions bot added the external-contribution Pull request is from an external contributor label Jun 12, 2025
@andoorve andoorve changed the title Add ENV variables in docker files for NIXL Plugins fix: Add ENV variables in docker files for NIXL Plugins Jun 12, 2025
@github-actions github-actions bot added the fix label Jun 12, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 12, 2025

Walkthrough

Environment variables for NIXL plugin discovery have been added to three Dockerfiles. The changes set LD_LIBRARY_PATH to include NIXL and UCX library directories and define NIXL_PLUGIN_DIR to specify the NIXL plugins directory. No changes were made to exported or public entities.

Changes

File(s) Change Summary
container/Dockerfile.sglang,
container/Dockerfile.tensorrt_llm,
container/Dockerfile.vllm
Added environment variables: extended LD_LIBRARY_PATH with NIXL and UCX library paths and set NIXL_PLUGIN_DIR for plugin discovery.

Sequence Diagram(s)

sequenceDiagram
    participant Dockerfile
    participant ContainerEnv
    participant NIXL Runtime

    Dockerfile->>ContainerEnv: Set LD_LIBRARY_PATH with NIXL and UCX paths
    Dockerfile->>ContainerEnv: Set NIXL_PLUGIN_DIR to plugins directory
    ContainerEnv->>NIXL Runtime: Provide environment variables at runtime
    NIXL Runtime->>NIXL Runtime: Discover plugins using environment variables
Loading

Possibly related PRs

Poem

In Docker’s warren, paths now align,
For NIXL’s plugins, a way to shine.
With libraries found, and plugins near,
The runtime hops without a fear.
🐇✨
A tweak in the burrow, all set to go—
Let’s watch those containers smoothly flow!


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

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

330-333: Parameterize NIXL plugin path using ARCH_ALT

Hard-coding x86_64 prevents building for other architectures (e.g., aarch64). Use the existing ARCH_ALT ARG to generate the correct library and plugin paths.

Apply this diff:

- # Set environment variables for NIXL to find the right plugin
- ENV LD_LIBRARY_PATH="/usr/local/nixl/lib/x86_64-linux-gnu:/usr/local/nixl/lib/x86_64-linux-gnu/plugins:/usr/local/ucx/lib:$LD_LIBRARY_PATH"
- ENV NIXL_PLUGIN_DIR="/usr/local/nixl/lib/x86_64-linux-gnu/plugins"
+ # Set environment variables for NIXL to find the right plugin
+ ENV LD_LIBRARY_PATH="/usr/local/nixl/lib/${ARCH_ALT}-linux-gnu:/usr/local/nixl/lib/${ARCH_ALT}-linux-gnu/plugins:/usr/local/ucx/lib:$LD_LIBRARY_PATH"
+ ENV NIXL_PLUGIN_DIR="/usr/local/nixl/lib/${ARCH_ALT}-linux-gnu/plugins"
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between a4600ba and c1ea955.

📒 Files selected for processing (3)
  • container/Dockerfile.sglang (1 hunks)
  • container/Dockerfile.tensorrt_llm (1 hunks)
  • container/Dockerfile.vllm (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Build and Test - vllm

Comment on lines +400 to +403
# Set environment variables for NIXL to find the right plugin
ENV LD_LIBRARY_PATH="/usr/local/nixl/lib/x86_64-linux-gnu:/usr/local/nixl/lib/x86_64-linux-gnu/plugins:/usr/local/ucx/lib:$LD_LIBRARY_PATH"
ENV NIXL_PLUGIN_DIR="/usr/local/nixl/lib/x86_64-linux-gnu/plugins"

Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Ensure NIXL/UCX assets are copied in the runtime stage

You’ve set LD_LIBRARY_PATH and NIXL_PLUGIN_DIR here, but the runtime image never copies /usr/local/ucx or /usr/local/nixl from the base stage. Without those directories, plugin discovery will fail. Also, avoid hard-coding x86_64.

Suggested patch:

@@ FROM ${RUNTIME_IMAGE}:${RUNTIME_IMAGE_TAG} AS runtime
+ # Bring in UCX and NIXL from the base image for plugin support
+ COPY --from=base /usr/local/ucx /usr/local/ucx
+ COPY --from=base /usr/local/nixl /usr/local/nixl
  # Set environment variables for NIXL to find the right plugin
- ENV LD_LIBRARY_PATH="/usr/local/nixl/lib/x86_64-linux-gnu:/usr/local/nixl/lib/x86_64-linux-gnu/plugins:/usr/local/ucx/lib:$LD_LIBRARY_PATH"
- ENV NIXL_PLUGIN_DIR="/usr/local/nixl/lib/x86_64-linux-gnu/plugins"
+ ARG ARCH_ALT
+ ENV LD_LIBRARY_PATH="/usr/local/nixl/lib/${ARCH_ALT}-linux-gnu:/usr/local/nixl/lib/${ARCH_ALT}-linux-gnu/plugins:/usr/local/ucx/lib:$LD_LIBRARY_PATH"
+ ENV NIXL_PLUGIN_DIR="/usr/local/nixl/lib/${ARCH_ALT}-linux-gnu/plugins"
🤖 Prompt for AI Agents
In container/Dockerfile.sglang around lines 400 to 403, the environment
variables LD_LIBRARY_PATH and NIXL_PLUGIN_DIR are set to paths under
/usr/local/nixl and /usr/local/ucx, but these directories are not copied into
the runtime stage from the base stage. To fix this, update the Dockerfile to
copy the /usr/local/nixl and /usr/local/ucx directories from the base stage into
the runtime stage. Additionally, replace the hard-coded architecture segment
"x86_64-linux-gnu" with a dynamic variable or a more generic path to avoid
architecture-specific hardcoding.

Comment on lines +533 to 535
ENV LD_LIBRARY_PATH="/usr/local/nixl/lib/x86_64-linux-gnu:/usr/local/nixl/lib/x86_64-linux-gnu/plugins:/usr/local/ucx/lib:$LD_LIBRARY_PATH"
ENV NIXL_PLUGIN_DIR="/usr/local/nixl/lib/x86_64-linux-gnu/plugins"

Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Remove duplicate static override of plugin env

The block at lines 533–535 restates LD_LIBRARY_PATH and NIXL_PLUGIN_DIR with a hard-coded x86_64 path, overriding the earlier parameterized values. Remove these lines to avoid conflicts:

- # Set environment variables for NIXL to find the right plugin
- ENV LD_LIBRARY_PATH="/usr/local/nixl/lib/x86_64-linux-gnu:/usr/local/nixl/lib/x86_64-linux-gnu/plugins:/usr/local/ucx/lib:$LD_LIBRARY_PATH"
- ENV NIXL_PLUGIN_DIR="/usr/local/nixl/lib/x86_64-linux-gnu/plugins"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
ENV LD_LIBRARY_PATH="/usr/local/nixl/lib/x86_64-linux-gnu:/usr/local/nixl/lib/x86_64-linux-gnu/plugins:/usr/local/ucx/lib:$LD_LIBRARY_PATH"
ENV NIXL_PLUGIN_DIR="/usr/local/nixl/lib/x86_64-linux-gnu/plugins"
🤖 Prompt for AI Agents
In container/Dockerfile.vllm around lines 533 to 535, remove the two ENV lines
that set LD_LIBRARY_PATH and NIXL_PLUGIN_DIR with hard-coded x86_64-linux-gnu
paths, as they duplicate and override earlier parameterized environment variable
settings, causing conflicts.

@andoorve
Copy link
Author

This is already in, I just missed it

@andoorve andoorve closed this Jun 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external-contribution Pull request is from an external contributor fix size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant