ci(docker): modernize dependency management and Docker build pipeline#843
Conversation
Summary of ChangesHello @garrett4wade, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request modernizes the project's development and deployment environment by upgrading core deep learning dependencies and streamlining the package management workflow. It enhances build efficiency and reliability through updated Docker configurations and refined dependency installation practices, while also improving the internal validation system for installed packages. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request primarily focuses on updating the Docker image to a newer PyTorch version with CUDA 12.3.0 and refining dependency management using uv. The changes include updating base Docker images, adding necessary build tools like cmake, and restructuring uv dependency installation within the Dockerfile for better reproducibility and efficiency. Documentation and pre-commit hooks have been updated to reflect the new uv usage patterns. Additionally, the validation_base.py file has been refactored to improve the robustness and efficiency of package import tests by utilizing parallel subprocess execution. Overall, the changes are well-aligned with the stated objective of the pull request and represent good practices for dependency and build management.
55965ab to
e42fd9f
Compare
uv support
4283129 to
d6d4fcc
Compare
uv support|
/gemini review |
There was a problem hiding this comment.
Code Review
This is an excellent and comprehensive overhaul of the project's Docker build system and dependency management. The move to uv with staged builds, a virtual environment, and improved caching in the Dockerfile will significantly improve build times and reproducibility. The modernization of pyproject.toml to use dependency groups, platform markers for CUDA packages, and uv.lock is a fantastic step forward.
I've found one critical issue in the Dockerfile related to a hardcoded wheel path that will break the build, and a documentation error in one of the guides. Apart from these, the code modernization to Python 3.12 syntax and the refactoring in the tests are great improvements. Well done on this significant refactoring effort!
b80e3db to
9c006b2
Compare
This PR overhauls the dependency management and Docker build infrastructure
for improved reproducibility, faster builds, and better developer experience.
Key changes:
- **Dependency Management**: Migrate to uv-based workflow with locked
dependencies (uv.lock). Reorganize pyproject.toml with platform-specific
extras (cuda, sglang, vllm, megatron) and dev dependencies. This ensures
consistent environments across development, CI, and production.
- **Docker Build Optimization**: Restructure Dockerfile with layered caching
strategy - install torch and C++ packages (apex, grouped_gemm,
transformer_engine) BEFORE syncing pyproject.toml dependencies. This
prevents expensive recompilation when only Python dependencies change.
- **CI/CD Improvements**:
- Add runner-heartbeat workflow to prevent GitHub self-hosted runner
expiration (7-day schedule)
- Fix build-docker-image workflow to preserve running builder instances
- Update tag-release-image to build fresh images instead of re-tagging
- Update test-areal to use venv-based Python environment
- **Code Modernization**:
- Replace TypeVar with PEP 695 type parameter syntax (Python 3.12+)
- Replace deprecated asyncio.TimeoutError with TimeoutError
- Rename areal/tools/profile to profiling_utils to avoid import conflicts
- Update vLLM imports for v0.14.0 compatibility
- **Documentation**: Rewrite installation guide for uv-based workflow with
clear instructions for CUDA/non-CUDA environments.
|
CI passes. Merging. |
Description
This PR overhauls the dependency management and Docker build infrastructure for improved reproducibility, faster builds, and better developer experience.
Key changes:
Dependency Management: Migrate to uv-based workflow with locked dependencies (uv.lock). Reorganize pyproject.toml with platform-specific extras (cuda, sglang, vllm, megatron) and dev dependencies. This ensures consistent environments across development, CI, and production.
Docker Build Optimization: Restructure Dockerfile with layered caching strategy - install torch and C++ packages (apex, grouped_gemm, transformer_engine) BEFORE syncing pyproject.toml dependencies. This prevents expensive recompilation when only Python dependencies change.
CI/CD Improvements:
Code Modernization:
Documentation: Rewrite installation guide for uv-based workflow with clear instructions for CUDA/non-CUDA environments.
Impact:
Type of Change
Checklist
jb build docs/gemini review)Breaking Change Details (if applicable):
This is a backward-compatible change. The new uv-based workflow is additive and does not remove existing pip-based installation options. Users can continue to use
pip install -e .if they prefer.Additional Context
File Change Summary
CI/CD Workflows:
.github/workflows/build-docker-image.yml: Track whether builder was already running to avoid stopping it.github/workflows/runner-heartbeat.yml: New workflow to prevent runner expiration.github/workflows/tag-release-image.yml: Build fresh images on release instead of re-tagging.github/workflows/test-areal.yml: Use venv-based Python with explicit PATH setupDocker:
Dockerfile: Complete restructure with layered caching, upgrade to sglang 0.5.7 base imageDependency Management:
pyproject.toml: Reorganize with platform-specific extras and dev groupuv.lock: New lockfile for reproducible builds (5000+ lines)Documentation:
docs/tutorial/installation.md: Rewrite for uv-based workflowevaluation/README.md,docs/tutorial/eval.md: Add evaluation dependency instructionsCode Modernization (no functional changes):
TypeVarwith PEP 695 syntax in 5 filesasyncio.TimeoutErrorwithTimeoutErrorin 10 filesareal/tools/profiletoprofiling_utilsTesting