Skip to content

Conversation

@thomasdhc
Copy link
Contributor

Description

Usage

# Add snippet demonstrating usage

Checklist

  • I am familiar with the Contributing Guide.
  • New or Existing tests cover these changes.
  • The documentation is up to date with these changes.

Signed-off-by: Dong Hyuk Chang <donghyukc@nvidia.com>
@copy-pr-bot
Copy link

copy-pr-bot bot commented Oct 24, 2025

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@thomasdhc
Copy link
Contributor Author

/ok to test 573321b

@thomasdhc thomasdhc marked this pull request as ready for review October 24, 2025 19:55
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Overview

Greptile Summary

This PR transitions the Docker image from Ubuntu's system Python packages to UV-managed Python installations. The change removes python3.12-dev, python3, python3-dev, python3-venv, and python-is-python3 from the apt-get installation list and instead uses uv python install --default --preview 3.12 to install and manage Python 3.12 through UV. This approach centralizes Python version management under UV's control, ensuring consistent Python versions across different deployments and eliminating potential conflicts between system Python and UV's virtual environments. The virtual environment is still created with --system-site-packages to maintain access to CUDA/GPU libraries from the NVIDIA base image.

PR Description Notes:

  • The description section is empty and should explain the motivation for switching to UV-managed Python
  • The checklist items are unchecked; these should be completed before merge

Important Files Changed

Filename Score Overview
docker/Dockerfile 3/5 Replaces system Python packages with UV-managed Python 3.12 installation using preview flag

Confidence score: 3/5

  • This PR introduces moderate risk due to potential CUDA library compatibility issues and the use of preview features
  • Score reflects concerns about: (1) the --preview flag indicating Python 3.12 support in UV may be unstable, (2) potential incompatibility between UV-managed Python and CUDA/cuDNN bindings that typically expect system Python paths, (3) uv tool update-shell modifying shell initialization in ways that may not be appropriate for container environments, and (4) the --default flag potentially interfering with scripts or tools in the base image that expect a specific Python
  • Pay close attention to docker/Dockerfile, particularly testing CUDA/GPU functionality after this change and verifying that all GPU-accelerated dependencies (PyTorch, cuDNN bindings) work correctly with UV's Python installation

Sequence Diagram

sequenceDiagram
    participant User
    participant Docker as Docker Build
    participant UV as UV Package Manager
    participant System as System (apt/curl)
    participant Git as Git Repository
    participant Venv as Virtual Environment

    User->>Docker: "docker build"
    Docker->>System: "Install base dependencies (curl, git, vim)"
    System-->>Docker: "Dependencies installed"
    
    Docker->>System: "Download and install UV 0.8.22"
    System-->>Docker: "UV installed"
    
    Docker->>UV: "uv python install --default --preview 3.12"
    UV-->>Docker: "Python 3.12 set as default"
    
    Docker->>UV: "uv venv /opt/venv --system-site-packages"
    UV->>Venv: "Create virtual environment"
    Venv-->>UV: "Virtual environment created"
    UV-->>Docker: "Environment ready"
    
    Docker->>System: "Install ffmpeg via script"
    System-->>Docker: "ffmpeg installed"
    
    Docker->>Git: "Clone InternVideo repository"
    Git-->>Docker: "Repository cloned"
    
    Docker->>System: "Apply intern_video2_multimodal.patch"
    System-->>Docker: "Patch applied"
    
    Docker->>Docker: "Copy Curator source code"
    
    Docker->>UV: "uv sync --locked --extra all --all-groups"
    UV->>Venv: "Install Curator dependencies"
    Venv-->>UV: "Dependencies installed"
    UV-->>Docker: "Sync complete"
    
    Docker->>UV: "uv add /opt/InternVideo/InternVideo2/multi_modality"
    UV->>Venv: "Install InternVideo package"
    Venv-->>UV: "Package installed"
    UV-->>Docker: "Installation complete"
    
    Docker->>UV: "uv cache prune && uv cache clean distance"
    UV-->>Docker: "Cache cleaned"
    
    Docker->>Docker: "Create env.sh activation script"
    Docker->>Docker: "Set build labels and metadata"
    Docker-->>User: "Image build complete"
Loading

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants