Skip to content

fix(customizer): fix CVEs + vllm venv issue - #1056

Merged
anubhutivyas merged 1 commit into
mainfrom
anubhutiv/vllm-venv-fixes
Aug 5, 2026
Merged

fix(customizer): fix CVEs + vllm venv issue#1056
anubhutivyas merged 1 commit into
mainfrom
anubhutiv/vllm-venv-fixes

Conversation

@anubhutivyas

@anubhutivyas anubhutivyas commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

CVEs:

  • Deleted Nsight Systems + Nsight Compute - 3 Critical + 25 High, they're profilers; nothing in DPO/GRPO runs nsys/ncu
  • Python 3.13.13 to 3.13.14 - 5 CVEs / 10 findings
  • uv 0.11.18 to 0.11.33 - 3 High, bundled quinn-proto.
  • Upgraded openssl / libssl3t64 - 2 High
  • Dropped Ray's ray_dist.jar - 3 High. jackson-databind + jackson-core. It only backs Ray's Java workers, and there's no JVM in this image

Bug fix:

GRPO fails with error

PermissionError: [Errno 13] Permission denied:
'/opt/ray_venvs/...VllmAsyncGenerationWorker/lib/python3.13/site-packages/vllm/v1/executor/ray_executor.py.patch_lock'

It is because,

  • RL patches vLLM in place when a worker starts up, it rewrites a few files in site-packages/vllm/ and takes a .patch_lock next to each one. But our prefetched venvs are root-owned and the container runs as uid 1000, so it just can't write there.
  • We build venvs with UV_LINK_MODE=symlink, so all three vLLM venvs symlink to the same physical copy of ray_executor.py in /opt/uv_cache. And the thing RL writes into that file is a per-venv interpreter path. So even if we fixed permissions, two venvs still can't share one file, the second worker would stomp the first. No amount of chown fixes that.
  • The fix is that each vllm venv now gets its own real copy of site-packages/vllm/, owned by uid 1000. Everything else (torch, the CUDA libs) stays symlinked and shared.
  • Checked that RL has this exact same bug, their image symlinks too, and their two vllm venvs share one ray_executor.py. They just run as root so it never surfaces. We can't do that (non-root is required by the sandboxing RFC and OpenShift), so we fix it properly.

Summary by CodeRabbit

Summary by CodeRabbit

  • Bug Fixes

    • Improved runtime reliability for vLLM patching with writable, isolated package copies.
    • Updated permissions for Gym cache usage.
    • Added validation when required vLLM packages are unavailable.
    • Removed unnecessary profiler and cache artifacts from published images.
  • Chores

    • Updated the CUDA base image, Python, uv, OpenSSL packages, and NeMo-RL reference.
  • Documentation

    • Clarified interpreter selection, cache behavior, and requirements for runtime vLLM patching.

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 19166a82-f3f3-4c0c-b749-9fa01a716159

📥 Commits

Reviewing files that changed from the base of the PR and between ca85d0f and 7704fd0.

📒 Files selected for processing (3)
  • docker-bake.hcl
  • docker/rl/Dockerfile.nmp-rl-base
  • docker/rl/README.md
🚧 Files skipped from review as they are similar to previous changes (3)
  • docker-bake.hcl
  • docker/rl/Dockerfile.nmp-rl-base
  • docker/rl/README.md

📝 Walkthrough

Walkthrough

The RL base image updates CUDA, uv, Python, and OpenSSL versions. It removes Ray and Nsight artifacts. It validates prefetched actors and prepares writable per-venv vLLM copies for runtime patching. It also updates the pinned NeMo-RL reference.

Changes

RL image build and runtime patching

Layer / File(s) Summary
Update and prune image contents
docker/rl/Dockerfile.nmp-rl-base, docker-bake.hcl
The image updates CUDA, uv, Python, and OpenSSL versions, sets UV_PYTHON, removes Ray and Nsight artifacts, and advances the default NEMO_RL_REF.
Validate prefetched RL environments
docker/rl/Dockerfile.nmp-rl-base
The build requires the NeMo-Gym and vLLM actors in prefetched environments.
Materialize writable patched vLLM files
docker/rl/Dockerfile.nmp-rl-base, docker/rl/README.md
The publish stage creates UID-1000-owned vLLM copies and a writable Gym fallback cache. The README documents the Python override, persisted cache, and runtime patch requirements.

Sequence Diagram(s)

sequenceDiagram
  participant PublishStage
  participant PrefetchedVllMEnvironment
  participant RuntimeUser
  PublishStage->>PrefetchedVllMEnvironment: Locate prefetched vLLM package
  PrefetchedVllMEnvironment-->>PublishStage: Provide package contents
  PublishStage->>RuntimeUser: Create writable per-venv vLLM copy
  PublishStage->>RuntimeUser: Assign ownership and Gym fallback cache
Loading

Possibly related PRs

Suggested reviewers: mckornfield, svvarom, ironcommit

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main changes: CVE fixes and the vLLM virtual environment issue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch anubhutiv/vllm-venv-fixes

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docker/rl/README.md`:
- Around line 442-444: Update the cache explanation in README.md to distinguish
the shipped read-only /opt/uv_cache from temporary BuildKit cache mounts that do
not enter the image. Replace the earlier conflicting warmup-cache description
while preserving the existing guidance about Dockerfile.nmp-rl-training
redirecting UV_CACHE_DIR to a writable per-user cache.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 5866f5d5-370e-4dcc-8d86-88d2c60a911c

📥 Commits

Reviewing files that changed from the base of the PR and between 79ca283 and e1e057b.

📒 Files selected for processing (3)
  • docker/rl/Dockerfile.nmp-rl-base
  • docker/rl/Dockerfile.nmp-rl-training
  • docker/rl/README.md

Comment thread docker/rl/README.md Outdated
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor
Suite Lines Covered Line Rate Branch Rate
Unit Tests 30743/39237 78.3% 62.7%
Integration Tests 18061/37189 48.6% 21.0%

@anubhutivyas
anubhutivyas force-pushed the anubhutiv/vllm-venv-fixes branch from e1e057b to 99584a3 Compare August 4, 2026 06:21
@anubhutivyas anubhutivyas changed the title fix(customizer): give each vllm venv its own copy of RL patch targets fix(customizer): fix CVEs + vllm venv issue Aug 4, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docker/rl/Dockerfile.nmp-rl-base`:
- Around line 475-490: Update the vLLM privatization loop and its final
validation to verify every required worker venv, not merely that privatized is
greater than zero. Use the expected actor venv paths or an explicit manifest,
confirm each contains vllm and has been copied out of /opt/uv_cache before
publishing, and fail with a clear error if any required entry is missing or
remains symlinked.

In `@docker/rl/README.md`:
- Around line 462-464: Update the explanation near the NeMo-RL comparison to
distinguish the two fixes: private site-packages/vllm/ copies isolate each vLLM
venv’s py_executable and prevent shared ray_executor.py patch state, while
non-root ownership or permissions prevent EACCES when creating
<file>.patch_lock. Clarify that root access addresses permissions only and does
not resolve shared-state conflicts.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 0e6a3040-8564-44a2-b9d1-496770ac3b88

📥 Commits

Reviewing files that changed from the base of the PR and between e1e057b and 99584a3.

📒 Files selected for processing (2)
  • docker/rl/Dockerfile.nmp-rl-base
  • docker/rl/README.md

Comment thread docker/rl/Dockerfile.nmp-rl-base
Comment thread docker/rl/README.md Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
docker/rl/Dockerfile.nmp-rl-base (2)

244-247: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Security Misconfiguration (CWE-693)

Reachability: Internal · Exploitability: Theoretical

Make both CVE-pruning steps fail closed.

Remove || true from both cleanup commands and add explicit checks that no matching Ray JAR or Nsight artifact remains.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docker/rl/Dockerfile.nmp-rl-base` around lines 244 - 247, The CVE-pruning
cleanup steps currently ignore failures and do not verify removal. In
docker/rl/Dockerfile.nmp-rl-base lines 244-247, update the Ray jars cleanup to
remove “|| true” and explicitly fail if any matching artifact remains; apply the
same fail-closed cleanup and post-removal check to the Nsight artifact step at
lines 427-437.

480-485: 🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift

Security Misconfiguration (CWE-732): Incorrect Permission Assignment for Critical Resource

Reachability: External

Do not expose patched vllm/ to all UID-1000 processes.

Each /opt/ray_venvs vLLM copy is writable by UID 1000. Colocated user-authored environment code uses the same UID and can replace vllm/v1/executor/ray_executor.py before a worker imports it. Use a separate worker UID or container, or isolate user-authored environment code before worker startup.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docker/rl/Dockerfile.nmp-rl-base` around lines 480 - 485, Update the vLLM
privatization flow around the cp, chmod, and chown commands so patched vllm
files are not writable or replaceable by colocated user-authored code running as
UID 1000. Isolate the worker-owned vLLM copy using a separate worker UID or
container, or ensure user-authored environment code is isolated before worker
startup; preserve worker access to the patched files.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@docker/rl/Dockerfile.nmp-rl-base`:
- Around line 244-247: The CVE-pruning cleanup steps currently ignore failures
and do not verify removal. In docker/rl/Dockerfile.nmp-rl-base lines 244-247,
update the Ray jars cleanup to remove “|| true” and explicitly fail if any
matching artifact remains; apply the same fail-closed cleanup and post-removal
check to the Nsight artifact step at lines 427-437.
- Around line 480-485: Update the vLLM privatization flow around the cp, chmod,
and chown commands so patched vllm files are not writable or replaceable by
colocated user-authored code running as UID 1000. Isolate the worker-owned vLLM
copy using a separate worker UID or container, or ensure user-authored
environment code is isolated before worker startup; preserve worker access to
the patched files.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 24858d39-f224-47ce-a77b-0fcdca6a607b

📥 Commits

Reviewing files that changed from the base of the PR and between 99584a3 and 9bdad24.

📒 Files selected for processing (2)
  • docker-bake.hcl
  • docker/rl/Dockerfile.nmp-rl-base

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@ironcommit ironcommit left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

Signed-off-by: anubhutiv <anubhutiv@nvidia.com>
@anubhutivyas
anubhutivyas force-pushed the anubhutiv/vllm-venv-fixes branch from 3cc718b to 7704fd0 Compare August 5, 2026 19:53
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@anubhutivyas
anubhutivyas added this pull request to the merge queue Aug 5, 2026
Merged via the queue into main with commit 73670d7 Aug 5, 2026
52 checks passed
@anubhutivyas
anubhutivyas deleted the anubhutiv/vllm-venv-fixes branch August 5, 2026 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants