]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
ci : reduce musa image size (#3277)
authorDaniel Bevenius <redacted>
Tue, 24 Jun 2025 06:20:28 +0000 (08:20 +0200)
committerGitHub <redacted>
Tue, 24 Jun 2025 06:20:28 +0000 (08:20 +0200)
* ci : reduce musa image size

This commit contains an attempt to reduce the size of the musa Docker
image by copying only the necessary files from the build stage.

The motivation for this is that the CI runs sometimes fail with out of
memory errors. These seems to be able to pass for PRs, at least
sometimes but fail upon push to the master branch.

* ci : remove build time files instead of selective copying

.devops/main-musa.Dockerfile

index c8b7ec287a425caea81c15287ac130628e43992d..bbc33993881a46fb4186cb230284c72cd848e8b3 100644 (file)
@@ -18,6 +18,12 @@ COPY .. .
 # Enable muBLAS
 RUN make base.en CMAKE_ARGS="-DGGML_MUSA=1"
 
+RUN find /app/build -name "*.o" -delete && \
+    find /app/build -name "*.a" -delete && \
+    rm -rf /app/build/CMakeFiles && \
+    rm -rf /app/build/cmake_install.cmake && \
+    rm -rf /app/build/_deps
+
 FROM ${BASE_MUSA_RUN_CONTAINER} AS runtime
 WORKDIR /app
 
@@ -27,5 +33,7 @@ RUN apt-get update && \
     rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* /tmp/* /var/tmp/*
 
 COPY --from=build /app /app
+RUN du -sh /app/*
+RUN find /app -type f -size +100M
 ENV PATH=/app/build/bin:$PATH
 ENTRYPOINT [ "bash", "-c" ]