|
| 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