fix(phase-00/07): fix Python 3.12 pip bootstrap and update PyTorch to 2.5.1#250
Conversation
|
PR changed again? Review this PR in Change Stack to compare snapshots and stay oriented. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe Dockerfile and docs are updated to install Python 3.12 from the deadsnakes PPA, bootstrap packaging via ChangesPython 3.12 and PyTorch Toolchain Upgrade
🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
phases/00-setup-and-tooling/07-docker-for-ai/docs/en.md (3)
60-74:⚠️ Potential issue | 🟠 Major | 🏗️ Heavy liftReplace ASCII diagram blocks and add language tags on fenced blocks.
These sections use plain fenced blocks for diagram-like content and omit language identifiers. Convert these to
mermaid(or SVG) and ensure every fenced block has an explicit language tag.As per coding guidelines, "
**/{docs,outputs}/**/*.md: Use Mermaid or SVG only for diagrams. No ASCII / Unicode box-drawing. Every fenced code block needs a language tag."Also applies to: 123-147
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@phases/00-setup-and-tooling/07-docker-for-ai/docs/en.md` around lines 60 - 74, Replace the ASCII diagram under the "Common container patterns in AI" section with a proper mermaid (or SVG) diagram and ensure all fenced code blocks in this file have explicit language tags; specifically convert the triple-backtick block containing "Dev Container / Training Container / Inference Container" into a mermaid flowchart (or an inline SVG) and add ```mermaid as the fence start, and scan the same document for the other ASCII diagram mentioned (the block around lines referenced in the review) and convert it similarly, ensuring every fenced block includes a language identifier.
1-16:⚠️ Potential issue | 🟠 Major | ⚡ Quick winAdd required
docs/en.mdfrontmatter block.This file is missing the required frontmatter (
Title, one-line hook,Type,Languages,Prerequisites,Time estimate, and 4–6 Learning Objectives).As per coding guidelines, "
**/docs/en.md: Include frontmatter in docs/en.md with fields: Title, one-line hook, Type (Learn|Build|Reference), Languages (matching main.* files), Prerequisites, Time estimate, and 4-6 Learning Objectives bullet points."🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@phases/00-setup-and-tooling/07-docker-for-ai/docs/en.md` around lines 1 - 16, Add a YAML frontmatter block to the top of docs/en.md containing Title, a one-line hook, Type (Learn|Build|Reference), Languages (matching the file’s Languages line), Prerequisites, Time estimate, and 4–6 Learning Objectives; include the existing items already listed (GPU Docker image with CUDA/PyTorch, mounting volumes, NVIDIA Container Toolkit, Docker Compose orchestration) as the Learning Objectives and ensure the Time/Type/Languages/Prerequisites fields mirror the content below so the file has a complete frontmatter header.
19-39:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winUpdate stale PyTorch version references to match the Dockerfile.
Narrative and diagram text still references PyTorch 2.3/2.3.1, but the Dockerfile now pins 2.5.1. Please align these to avoid learner confusion.
Also applies to: 138-141
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@phases/00-setup-and-tooling/07-docker-for-ai/docs/en.md` around lines 19 - 39, Update all stale PyTorch version mentions ("PyTorch 2.3" and "PyTorch 2.3.1") in the narrative and the Mermaid diagram nodes (e.g., A1, A2, A3, B1, B2, B3) to match the Dockerfile pinned version (PyTorch 2.5.1), and make the same replacement for the additional occurrences referred to (lines noted as 138-141 in the review). Ensure both plain text and diagram labels show "PyTorch 2.5.1" so the documentation and visual example are consistent with the Dockerfile.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@phases/00-setup-and-tooling/07-docker-for-ai/code/Dockerfile`:
- Around line 20-21: The Dockerfile currently pipes the remote get-pip.py
directly into the interpreter (the RUN line containing "curl -sS
https://bootstrap.pypa.io/get-pip.py | python3.12"), which executes unverified
network code; instead, update that RUN step to download get-pip.py to a file
(use curl -fSL -o), verify its SHA256 checksum against a pinned value, fail the
build if the checksum mismatches, and only then execute it with python3.12 (or
prefer python3.12 -m ensurepip if you want to avoid remote scripts); reference
the RUN line with the get-pip.py download/verification and the subsequent
python3.12 execution to implement the changes.
---
Outside diff comments:
In `@phases/00-setup-and-tooling/07-docker-for-ai/docs/en.md`:
- Around line 60-74: Replace the ASCII diagram under the "Common container
patterns in AI" section with a proper mermaid (or SVG) diagram and ensure all
fenced code blocks in this file have explicit language tags; specifically
convert the triple-backtick block containing "Dev Container / Training Container
/ Inference Container" into a mermaid flowchart (or an inline SVG) and add
```mermaid as the fence start, and scan the same document for the other ASCII
diagram mentioned (the block around lines referenced in the review) and convert
it similarly, ensuring every fenced block includes a language identifier.
- Around line 1-16: Add a YAML frontmatter block to the top of docs/en.md
containing Title, a one-line hook, Type (Learn|Build|Reference), Languages
(matching the file’s Languages line), Prerequisites, Time estimate, and 4–6
Learning Objectives; include the existing items already listed (GPU Docker image
with CUDA/PyTorch, mounting volumes, NVIDIA Container Toolkit, Docker Compose
orchestration) as the Learning Objectives and ensure the
Time/Type/Languages/Prerequisites fields mirror the content below so the file
has a complete frontmatter header.
- Around line 19-39: Update all stale PyTorch version mentions ("PyTorch 2.3"
and "PyTorch 2.3.1") in the narrative and the Mermaid diagram nodes (e.g., A1,
A2, A3, B1, B2, B3) to match the Dockerfile pinned version (PyTorch 2.5.1), and
make the same replacement for the additional occurrences referred to (lines
noted as 138-141 in the review). Ensure both plain text and diagram labels show
"PyTorch 2.5.1" so the documentation and visual example are consistent with the
Dockerfile.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 413bc385-d235-4ca2-a2e9-e61492fd7071
📒 Files selected for processing (2)
phases/00-setup-and-tooling/07-docker-for-ai/code/Dockerfilephases/00-setup-and-tooling/07-docker-for-ai/docs/en.md
1ff86d0 to
750ffbd
Compare
|
Updated |
What this PR does
Fixes a broken Dockerfile that fails to build on Ubuntu 22.04 and aligns the lesson doc to match.
Kind of change
Checklist
Phase / lesson
Phase 0 · 07-docker-for-ai
Notes for reviewer
The original Dockerfile fails to build on Ubuntu 22.04 with
E: Unable to locate package python3.12.Python 3.12 is not available in the default Ubuntu 22.04 apt repos. The deadsnakes PPA is required to install it.
Additionally, python3-pip on Ubuntu 22.04 binds pip to Python 3.10 (system default), so packages would silently install for the wrong interpreter even if the build succeeded.
Changes: