-
Notifications
You must be signed in to change notification settings - Fork 110
Open
Description
Problem Description
The pytorch+llmcompressor Docker images contain redundant micropipenv installations that create unnecessary build overhead and potential version inconsistencies.
Affected Files
runtimes/pytorch+llmcompressor/ubi9-python-3.11/Dockerfile.cuda
jupyter/pytorch+llmcompressor/ubi9-python-3.11/Dockerfile.cuda
Current Problematic Pattern
Each affected Dockerfile installs micropipenv twice:
-
Early installation (for Pipfile.lock deployment):
# Install micropipenv to deploy packages from Pipfile.lock RUN pip install --no-cache-dir -U "micropipenv[toml]"
-
Later redundant installation (in requirements.txt block):
# Install micropipenv and uv to deploy packages from requirements.txt begin RUN pip install --no-cache-dir -U "micropipenv[toml]==1.9.0" "uv==0.8.12" # Install micropipenv and uv to deploy packages from requirements.txt end
Impact
- Build inefficiency: Unnecessary package download and installation time
- Version inconsistency risk: Different micropipenv versions could be installed if the early install isn't pinned
- Maintenance overhead: Duplicate installations to maintain and update
Solution Options
Option 1: Remove Early Installation (Recommended)
Remove the early micropipenv installation and rely only on the later pinned installation:
# Remove this block:
# Install micropipenv to deploy packages from Pipfile.lock
# RUN pip install --no-cache-dir -U "micropipenv[toml]==1.9.0"
# Keep only the later installation before micropipenv usage:
# Install micropipenv and uv to deploy packages from requirements.txt begin
RUN pip install --no-cache-dir -U "micropipenv[toml]==1.9.0" "uv==0.8.12"
# Install micropipenv and uv to deploy packages from requirements.txt end
# Then use micropipenv immediately after:
RUN echo "Installing softwares and packages" && \
micropipenv install --dev && \
...
Option 2: Consolidate Installations
Move the micropipenv installation to just before its first usage and remove the later duplicate.
Option 3: Conditional Installation
Add logic to check if micropipenv is already installed before attempting reinstallation.
Acceptance Criteria
- Remove duplicate micropipenv installations from all pytorch+llmcompressor Dockerfiles
- Ensure micropipenv version consistency (1.9.0) across all installations
- Verify that
micropipenv install --dev
still works correctly - Test image builds successfully for both affected variants
- Confirm no other image types have similar duplication patterns
- Update any related documentation if necessary
Implementation Notes
- This cleanup should be coordinated with ongoing version pinning efforts in PR opendatahub-io/notebooks#1595: chore: pin
micropipenv
anduv
versions in Dockerfilepip install
commands for reproducible builds #1998 - Consider applying similar deduplication to other image types if the pattern is found elsewhere
- Ensure the solution maintains the existing functionality for both Pipfile.lock and requirements.txt deployment
Context
- Related to PR opendatahub-io/notebooks#1595: chore: pin
micropipenv
anduv
versions in Dockerfilepip install
commands for reproducible builds #1998 (micropipenv version pinning) - Part of ongoing efforts to improve build reproducibility and efficiency
- Identified during code review of version pinning changes
References
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
📋 Backlog