-
Notifications
You must be signed in to change notification settings - Fork 318
ci: Optimize docker layer and uv with no cache #1444
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -62,7 +62,6 @@ COPY docker/common/install_ffmpeg.sh . | |||||
| RUN bash install_ffmpeg.sh && \ | ||||||
| rm install_ffmpeg.sh | ||||||
|
|
||||||
| FROM nemo_curator_dep AS nemo_curator | ||||||
|
|
||||||
| ARG INTERN_VIDEO_COMMIT=09d872e5093296c6f36b8b3a91fc511b76433bf7 | ||||||
| COPY external/intern_video2_multimodal.patch . | ||||||
|
|
@@ -73,14 +72,19 @@ RUN git clone https://github.com/OpenGVLab/InternVideo.git && \ | |||||
| patch -p1 < /opt/intern_video2_multimodal.patch && \ | ||||||
| rm /opt/intern_video2_multimodal.patch | ||||||
|
|
||||||
| FROM nemo_curator_dep AS nemo_curator | ||||||
|
|
||||||
| WORKDIR /opt/Curator | ||||||
|
|
||||||
| # Selective file copying before dependency installation for better layer caching | ||||||
| COPY pyproject.toml uv.lock /opt/Curator/ | ||||||
| COPY nemo_curator/__init__.py nemo_curator/package_info.py /opt/Curator/nemo_curator/ | ||||||
|
|
||||||
| # Install Curator | ||||||
| RUN uv sync --link-mode copy --locked --extra all --all-groups --no-cache && \ | ||||||
| uv add /opt/InternVideo/InternVideo2/multi_modality | ||||||
|
||||||
| uv add /opt/InternVideo/InternVideo2/multi_modality | |
| uv add --no-cache /opt/InternVideo/InternVideo2/multi_modality |
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.
I'm not very familiar with uv, but I'm curious why we need to copy individual files from the repo on lines 78-79 if we just end up copying the entire repo on line 85? Can we just move line 85 up before the install and remove the individual file copy calls? I'm assuming 'no', but I'm curious why.
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.
This optimizes docker re-build. If we copy over the entire Curator directory, every time Curator gets updated the cache will break leading to re-install of all dependencies. By isolating files needed for dependency vs changes to the code base, re-install does not need to happen if dependencies have not changed.
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.
Thank you for for explaining that. That's an excellent reason.
One minor request, feel free to ignore if you think it's obvious: would you mind also adding a comment to the Dockerfile mentioning that? I'm afraid a future maintainer might not pick up on that and refactor it out.
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.
Yeah let me add that note
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.
copying
__init__.pymight cause issues duringuv syncif setuptools tries to import it, since it importscosmos_xenna.ray_utils.clusterwhich isn't installed yet