Skip to content

Commit 5273a91

Browse files
authored
ci: Optimize docker layer and uv with no cache (#1444) (#1446)
* Optimize docker layer and uv with no cache * Add missing slash * Add comments to dockerfile --------- Signed-off-by: Dong Hyuk Chang <donghyukc@nvidia.com> Signed-off-by: NeMo Bot <nemo-bot@nvidia.com>
1 parent a368088 commit 5273a91

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

docker/Dockerfile

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ COPY docker/common/install_ffmpeg.sh .
6262
RUN bash install_ffmpeg.sh && \
6363
rm install_ffmpeg.sh
6464

65-
FROM nemo_curator_dep AS nemo_curator
6665

6766
ARG INTERN_VIDEO_COMMIT=09d872e5093296c6f36b8b3a91fc511b76433bf7
6867
COPY external/intern_video2_multimodal.patch .
@@ -73,14 +72,19 @@ RUN git clone https://github.com/OpenGVLab/InternVideo.git && \
7372
patch -p1 < /opt/intern_video2_multimodal.patch && \
7473
rm /opt/intern_video2_multimodal.patch
7574

75+
FROM nemo_curator_dep AS nemo_curator
76+
77+
WORKDIR /opt/Curator
78+
79+
# Selective file copying before dependency installation for better layer caching
80+
COPY pyproject.toml uv.lock /opt/Curator/
81+
COPY nemo_curator/__init__.py nemo_curator/package_info.py /opt/Curator/nemo_curator/
82+
7683
# Install Curator
84+
RUN uv sync --link-mode copy --locked --extra all --all-groups --no-cache && \
85+
uv add /opt/InternVideo/InternVideo2/multi_modality
86+
7787
COPY . /opt/Curator
78-
RUN cd /opt/Curator && \
79-
uv sync --link-mode copy --locked --extra all --all-groups && \
80-
uv add /opt/InternVideo/InternVideo2/multi_modality && \
81-
uv cache prune && \
82-
uv cache clean distance && \
83-
find /opt/uv_cache/ -type d -path "*ray/_private/runtime_env/agent/thirdparty_files/aiohttp*" -exec rm -rf {} +
8488

8589
COPY <<EOF /opt/venv/env.sh
8690
export UV_PROJECT_ENVIRONMENT=/opt/venv

0 commit comments

Comments
 (0)