danbev commited on
Commit
e11fac2
·
unverified ·
1 Parent(s): fc20738

ci : use selective copy for musa image (#3296)

Browse files

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.

.devops/main-musa.Dockerfile CHANGED
@@ -32,8 +32,9 @@ RUN apt-get update && \
32
  apt-get clean && \
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" ]
 
32
  apt-get clean && \
33
  rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* /tmp/* /var/tmp/*
34
 
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
+
39
  ENV PATH=/app/build/bin:$PATH
40
  ENTRYPOINT [ "bash", "-c" ]
.github/workflows/docker.yml CHANGED
@@ -42,6 +42,21 @@ jobs:
42
  username: ${{ github.repository_owner }}
43
  password: ${{ secrets.GITHUB_TOKEN }}
44
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  - name: Generate tags
46
  id: tags
47
  run: |
 
42
  username: ${{ github.repository_owner }}
43
  password: ${{ secrets.GITHUB_TOKEN }}
44
 
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
+
60
  - name: Generate tags
61
  id: tags
62
  run: |