Skip to content

Commit ba3e1dc

Browse files
free up disk space in CI runners (#234)
This change frees up disk space in CI runners. See https://github.com/apache/flink/blob/02d30ace69dc18555a5085eccf70ee884e73a16e/tools/azure-pipelines/free_disk_space.sh Before ``` 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 ``` Filesystem Size Used Avail Use% Mounted on /dev/root 72G 47G 25G 66% / tmpfs 7.9G 84K 7.9G 1% /dev/shm tmpfs 3.2G 1.1M 3.2G 1% /run tmpfs 5.0M 0 5.0M 0% /run/lock /dev/sdb16 881M 62M 758M 8% /boot /dev/sdb15 105M 6.2M 99M 6% /boot/efi /dev/sda1 74G 4.1G 66G 6% /mnt tmpfs 1.6G 12K 1.6G 1% /run/user/1001 ```
1 parent 83efd9e commit ba3e1dc

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

.github/actions/setup/action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ inputs:
1212
runs:
1313
using: 'composite'
1414
steps:
15+
- name: Free up disk space
16+
shell: bash
17+
run: ${{ github.action_path }}/free_disk_space.sh
1518
- shell: bash
1619
run: |
1720
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)