From 9c479023086d8440b1ea254514bdb4a09cb7088e Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Tue, 24 Jun 2025 08:20:28 +0200 Subject: [PATCH] ci : reduce musa image size (#3277) * 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 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.devops/main-musa.Dockerfile b/.devops/main-musa.Dockerfile index c8b7ec28..bbc33993 100644 --- a/.devops/main-musa.Dockerfile +++ b/.devops/main-musa.Dockerfile @@ -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" ]