Skip to content

Commit 089e780

Browse files
authored
Free disk space before releasing (#4329)
1 parent 49eb9f4 commit 089e780

File tree

3 files changed

+73
-0
lines changed

3 files changed

+73
-0
lines changed

.github/workflows/release-dry-run.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ jobs:
7272
with:
7373
fetch-depth: 0
7474

75+
- name: Free up disk space
76+
run: |
77+
./scripts/free_disk_space.sh
78+
7579
- name: Set up Go
7680
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
7781
with:

.github/workflows/release.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ jobs:
2828
with:
2929
fetch-depth: 0
3030

31+
- name: Free up disk space
32+
run: |
33+
./scripts/free_disk_space.sh
34+
3135
- name: Set up Go
3236
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
3337
with:

scripts/free_disk_space.sh

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#!/usr/bin/env bash
2+
# Copyright 2024 The Parca Authors
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# Licensed to the Apache Software Foundation (ASF) under one or more
16+
# contributor license agreements. See the NOTICE file distributed with
17+
# this work for additional information regarding copyright ownership.
18+
# The ASF licenses this file to You under the Apache License, Version 2.0
19+
# (the "License"); you may not use this file except in compliance with
20+
# the License. You may obtain a copy of the License at
21+
#
22+
# http://www.apache.org/licenses/LICENSE-2.0
23+
#
24+
# Unless required by applicable law or agreed to in writing, software
25+
# distributed under the License is distributed on an "AS IS" BASIS,
26+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27+
# See the License for the specific language governing permissions and
28+
# limitations under the License.
29+
30+
#
31+
# The Azure provided machines typically have the following disk allocation:
32+
# Total space: 85GB
33+
# Allocated: 67 GB
34+
# Free: 17 GB
35+
# This script frees up 28 GB of disk space by deleting unneeded packages and
36+
# large directories.
37+
# The Flink end to end tests download and generate more than 17 GB of files,
38+
# causing unpredictable behavior and build failures.
39+
#
40+
echo "=============================================================================="
41+
echo "Freeing up disk space on CI system"
42+
echo "=============================================================================="
43+
44+
echo "Listing 100 largest packages"
45+
dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -n | tail -n 100
46+
df -h
47+
echo "Removing large packages"
48+
sudo apt-get remove -y '^dotnet-.*'
49+
sudo apt-get remove -y '^llvm-.*'
50+
sudo apt-get remove -y 'php.*'
51+
sudo apt-get remove -y '^mongodb-.*'
52+
sudo apt-get remove -y '^mysql-.*'
53+
sudo apt-get remove -y azure-cli google-cloud-sdk hhvm google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri
54+
sudo apt-get autoremove -y
55+
sudo apt-get clean
56+
df -h
57+
echo "Removing large directories"
58+
59+
sudo rm -rf /usr/share/dotnet/
60+
sudo rm -rf /usr/local/graalvm/
61+
sudo rm -rf /usr/local/.ghcup/
62+
sudo rm -rf /usr/local/share/powershell
63+
sudo rm -rf /usr/local/share/chromium
64+
sudo rm -rf /usr/local/lib/android
65+
df -h

0 commit comments

Comments
 (0)