-
Notifications
You must be signed in to change notification settings - Fork 185
ci: Uv python default #1205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
ci: Uv python default #1205
Conversation
Signed-off-by: Dong Hyuk Chang <donghyukc@nvidia.com>
|
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. |
|
/ok to test 573321b |
There was a problem hiding this 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
--previewflag 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-shellmodifying shell initialization in ways that may not be appropriate for container environments, and (4) the--defaultflag 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"
1 file reviewed, no comments
Description
Usage
# Add snippet demonstrating usageChecklist