danbev commited on
Commit
a45c78b
·
unverified ·
1 Parent(s): ca0545e

ci : reduce musa image size (#3277)

Browse files

* 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

Files changed (1) hide show
  1. .devops/main-musa.Dockerfile +8 -0
.devops/main-musa.Dockerfile CHANGED
@@ -18,6 +18,12 @@ COPY .. .
18
  # Enable muBLAS
19
  RUN make base.en CMAKE_ARGS="-DGGML_MUSA=1"
20
 
 
 
 
 
 
 
21
  FROM ${BASE_MUSA_RUN_CONTAINER} AS runtime
22
  WORKDIR /app
23
 
@@ -27,5 +33,7 @@ RUN apt-get update && \
27
  rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* /tmp/* /var/tmp/*
28
 
29
  COPY --from=build /app /app
 
 
30
  ENV PATH=/app/build/bin:$PATH
31
  ENTRYPOINT [ "bash", "-c" ]
 
18
  # Enable muBLAS
19
  RUN make base.en CMAKE_ARGS="-DGGML_MUSA=1"
20
 
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
+
27
  FROM ${BASE_MUSA_RUN_CONTAINER} AS runtime
28
  WORKDIR /app
29
 
 
33
  rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* /tmp/* /var/tmp/*
34
 
35
  COPY --from=build /app /app
36
+ RUN du -sh /app/*
37
+ RUN find /app -type f -size +100M
38
  ENV PATH=/app/build/bin:$PATH
39
  ENTRYPOINT [ "bash", "-c" ]