Skip to content

Commit 9c47902

Browse files
authored
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
1 parent a0d2c63 commit 9c47902

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

.devops/main-musa.Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ COPY .. .
1818
# Enable muBLAS
1919
RUN make base.en CMAKE_ARGS="-DGGML_MUSA=1"
2020

21+
RUN find /app/build -name "*.o" -delete && \
22+
find /app/build -name "*.a" -delete && \
23+
rm -rf /app/build/CMakeFiles && \
24+
rm -rf /app/build/cmake_install.cmake && \
25+
rm -rf /app/build/_deps
26+
2127
FROM ${BASE_MUSA_RUN_CONTAINER} AS runtime
2228
WORKDIR /app
2329

@@ -27,5 +33,7 @@ RUN apt-get update && \
2733
rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* /tmp/* /var/tmp/*
2834

2935
COPY --from=build /app /app
36+
RUN du -sh /app/*
37+
RUN find /app -type f -size +100M
3038
ENV PATH=/app/build/bin:$PATH
3139
ENTRYPOINT [ "bash", "-c" ]

0 commit comments

Comments
 (0)