Skip to content

Commit c88ffbf

Browse files
authored
ci : use selective copy for musa image (ggml-org#3296)
This commit modified the musa docker file to selectively copy directories needed for the container image. This commit also added a step to the docker workflow to free up disk space in attempt to make enough room for the large musa build containers. The motivation for this change is to reduce the size of the container image and try to avoid disk usage issues in CI.
1 parent 7069394 commit c88ffbf

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

.devops/main-musa.Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ RUN apt-get update && \
3232
apt-get clean && \
3333
rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* /tmp/* /var/tmp/*
3434

35-
COPY --from=build /app /app
36-
RUN du -sh /app/*
37-
RUN find /app -type f -size +100M
35+
COPY --from=build /app/build/bin /app/build/bin
36+
COPY --from=build /app/samples /app/samples
37+
COPY --from=build /app/models /app/models
38+
3839
ENV PATH=/app/build/bin:$PATH
3940
ENTRYPOINT [ "bash", "-c" ]

.github/workflows/docker.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,21 @@ jobs:
4242
username: ${{ github.repository_owner }}
4343
password: ${{ secrets.GITHUB_TOKEN }}
4444

45+
- name: Free up disk space
46+
run: |
47+
sudo apt-get remove -y '^dotnet-.*' '^llvm-.*' '^mysql-.*' '^postgresql-.*'
48+
sudo apt-get autoremove -y
49+
sudo apt-get autoclean
50+
51+
sudo rm -rf /usr/share/dotnet
52+
sudo rm -rf /usr/local/lib/android
53+
sudo rm -rf /opt/ghc
54+
sudo rm -rf /opt/hostedtoolcache/CodeQL
55+
56+
docker system prune -af
57+
58+
df -h
59+
4560
- name: Generate tags
4661
id: tags
4762
run: |

0 commit comments

Comments
 (0)