Skip to content

Commit 0a1ea57

Browse files
free disk space on CI runners
This change adds a script to significantly free up space on CI runners. Before: ``` === df -h === Filesystem Size Used Avail Use% Mounted on /dev/root 72G 66G 5.8G 93% / tmpfs 7.9G 84K 7.9G 1% /dev/shm tmpfs 3.2G 1.2M 3.2G 1% /run tmpfs 5.0M 0 5.0M 0% /run/lock /dev/sda16 881M 62M 758M 8% /boot /dev/sda15 105M 6.2M 99M 6% /boot/efi /dev/sdb1 74G 4.1G 66G 6% /mnt tmpfs 1.6G 12K 1.6G 1% /run/user/1001 ``` After: ``` ``
1 parent 3b71c9b commit 0a1ea57

File tree

2 files changed

+25
-21
lines changed

2 files changed

+25
-21
lines changed

.github/actions/setup/action.yml

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,7 @@ runs:
1414
steps:
1515
- name: Free up disk space
1616
shell: bash
17-
run: |
18-
# Source: https://github.com/apache/flink/blob/02d30ace69dc18555a5085eccf70ee884e73a16e/tools/azure-pipelines/free_disk_space.sh
19-
echo "=============================================================================="
20-
echo "Freeing up disk space on CI system"
21-
echo "=============================================================================="
22-
echo "Listing 100 largest packages"
23-
dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -n | tail -n 100
24-
df -h
25-
echo "Removing large packages"
26-
sudo apt-get remove -y '^ghc-8.*'
27-
sudo apt-get remove -y '^dotnet-.*'
28-
sudo apt-get remove -y '^llvm-.*'
29-
sudo apt-get remove -y 'php.*'
30-
sudo apt-get remove -y azure-cli google-cloud-sdk hhvm google-chrome-stable firefox powershell mono-devel
31-
sudo apt-get autoremove -y
32-
sudo apt-get clean
33-
df -h
34-
echo "Removing large directories"
35-
# deleting 15GB
36-
rm -rf /usr/share/dotnet/
37-
df -h
17+
run: ${{ github.action_path }}/free_disk_space.sh
3818
- shell: bash
3919
run: |
4020
echo $HOME
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
3+
# Script to free up disk space on CI systems
4+
# Source: https://github.com/apache/flink/blob/02d30ace69dc18555a5085eccf70ee884e73a16e/tools/azure-pipelines/free_disk_space.sh
5+
6+
echo "Freeing up disk space on CI system"
7+
8+
echo "Listing 100 largest packages"
9+
dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -n | tail -n 100
10+
df -h
11+
12+
echo "Removing large packages"
13+
sudo apt-get remove -y '^ghc-8.*'
14+
sudo apt-get remove -y '^dotnet-.*'
15+
sudo apt-get remove -y '^llvm-.*'
16+
sudo apt-get remove -y 'php.*'
17+
sudo apt-get remove -y azure-cli google-cloud-sdk hhvm google-chrome-stable firefox powershell mono-devel
18+
sudo apt-get autoremove -y
19+
sudo apt-get clean
20+
df -h
21+
22+
echo "Removing large directories"
23+
rm -rf /usr/share/dotnet/
24+
df -h

0 commit comments

Comments
 (0)