-
-
Notifications
You must be signed in to change notification settings - Fork 12k
[WIP] Fix docker build cache #30686
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?
[WIP] Fix docker build cache #30686
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
40a7895 to
4440751
Compare
4440751 to
87334ea
Compare
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.
Code Review
This pull request aims to improve Docker build caching by excluding the .git directory from the COPY command and making the wheel build step conditional. While the change to COPY is correct, the logic for the conditional wheel build is flawed. It introduces a critical bug where no wheel is built by default, and it contains redundant code. I've provided a suggestion to fix the logic and remove the redundancy.
21b229a to
47fe12b
Compare
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.
Pull request overview
This PR aims to fix Docker build cache issues by excluding the .git directory from the COPY command and introducing a USE_GIT_VERSION build argument to conditionally control version generation behavior.
Key changes:
- Excludes
.gitdirectory from being copied into the build context to prevent cache invalidation - Introduces
USE_GIT_VERSIONargument to control whether git-derived or static versioning is used - Adds
docker/to .dockerignore to reduce build context size
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| docker/Dockerfile | Adds --exclude=.git to COPY command and introduces conditional logic for wheel building based on USE_GIT_VERSION flag |
| .dockerignore | Excludes docker/ directory from build context |
Critical Issue Found: The conditional logic for the two RUN blocks has a bug where both conditions check for the same case (USE_GIT_VERSION != "0"), meaning the fallback case is never executed.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
47fe12b to
72141c8
Compare
Signed-off-by: Shiming Zhang <[email protected]>
72141c8 to
ee5c214
Compare
Fixed #23588
Purpose
Test Plan
Test Result
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.