build: exclude opencv-python-headless from shipped container - #3339
Merged
Conversation
opencv-python-headless bundles FFmpeg codec libs (libavcodec, libavformat, etc.) whose included patent-encumbered codecs (H.264, H.265, AAC) may incur royalties when distributed in a shipped container. Mark it as sys_platform == 'never' in override-dependencies (keeping the >=5.0.0 CVE pin) so it is never baked into the image. Add it to tools/install_audio_deps.sh so it is installed at test/runtime alongside torchaudio and torchcodec. vllm defaults to opencv for video IO but gracefully falls back to torchcodec via its PlaceholderModule pattern. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Kajal Jain <kajalj@nvidia.com>
Contributor
Author
|
/ok to test a5f8335 |
thomasdhc
previously approved these changes
Jul 24, 2026
terrykong
previously approved these changes
Jul 24, 2026
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Kajal Jain <kajalj@nvidia.com>
yfw
reviewed
Jul 24, 2026
- Add --no-config to all uv pip install calls in tools/install_audio_deps.sh so the project's sys_platform=='never' overrides don't suppress the installs - Add cv2 import verification after opencv install - Split opencv override-dependencies entry: never-install marker (no version) in override-dependencies, CVE floor (>=5.0.0) in constraint-dependencies, matching the pattern used for av - Regenerate uv.lock Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Kajal Jain <kajalj@nvidia.com>
opencv-python-headless installs into the base venv but vllm runs in Ray worker venvs without --system-site-packages, so it would never be visible to the consumers that need it. vllm wraps all three video backends (cv2, av, torchcodec) in a PlaceholderModule fallback — with cv2 absent it uses torchcodec, which IS installed by this script and used by NeMo-RL's own data loading. Also revert the idempotency check to torchcodec-only since cv2 is no longer managed here. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Kajal Jain <kajalj@nvidia.com>
Contributor
Author
|
/ok to test 33aa57c |
Contributor
Author
|
/ok to test 864707d |
yfw
approved these changes
Jul 24, 2026
chtruong814
approved these changes
Jul 24, 2026
terrykong
enabled auto-merge (squash)
July 24, 2026 22:46
kajalj22
added a commit
that referenced
this pull request
Jul 25, 2026
Signed-off-by: Kajal Jain <kajalj@nvidia.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Kajal Jain <kajalj@nvidia.com>
15 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
opencv-python-headlessbundles FFmpeg codec libs (libavcodec,libavformat, etc.) inopencv_python_headless.libs/. Its included patent-encumbered codecs (H.264, H.265, AAC) may incur royalties when distributed in a shipped container.sys_platform == 'never'in[tool.uv.override-dependencies], keeping the>=5.0.0CVE version pin, so it is never baked into the image.tools/install_audio_deps.shso it is installed at test/runtime alongsidetorchaudioandtorchcodec.vllm compatibility: vllm defaults to opencv for video IO but wraps all three backends (cv2, av, torchcodec) in a
try/except PlaceholderModulepattern — if cv2 is absent it falls back gracefully to torchcodec, which is already installed by this script. NeMo-RL's data loading explicitly usesbackend="torchcodec"inmultimodal_utils.pyandprocessors.py.Closes #3254
Test plan
🤖 Generated with Claude Code