This repository was archived by the owner on Jul 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 254
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SUBMARINE-1408. Fix ubuntu low disk space issue
### What is this PR for? Recently, in the github actions, there is less and less space left in ubuntu, which leads to a no disk space exception in one of the steps of the workflow. Therefore, we need to remove unneeded packages and files from the ubuntu to make as much space as possible for python packages, docker images, and k8s. ### What type of PR is it? Hot Fix ### Todos * [x] - Reduce ubuntu disk space. * [x] - don't update `accpted_time` while agent is processing to avoid unit test errors on ·accpted_time·. ### What is the Jira issue? https://issues.apache.org/jira/browse/SUBMARINE-1408 ### How should this be tested? CI test ### Screenshots (if appropriate) Before: <img width="478" alt="image" src="https://github.com/apache/submarine/assets/12069428/eea00bd5-8ddb-4759-918e-06e4ed821916"> After: <img width="421" alt="image" src="https://github.com/apache/submarine/assets/12069428/5aac5f25-16bb-43a5-b93d-7e9729e9c55e"> ### Questions: * Do the license files need updating? No * Are there breaking changes for older versions? No * Does this need new documentation? No Author: cdmikechen <[email protected]> Signed-off-by: cdmikechen <[email protected]> Closes #1104 from cdmikechen/reduce-ci-storage and squashes the following commits: 282251b [cdmikechen] free disk space 6f9d7f9 [cdmikechen] Remove accpted_time update 2682226 [cdmikechen] repalce 10G to 1G
- Loading branch information
1 parent
e7c6a54
commit e84d4d4
Showing
5 changed files
with
68 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#!/usr/bin/env bash | ||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
|
||
# Reference from | ||
# https://github.com/apache/flink/blob/master/tools/azure-pipelines/free_disk_space.sh | ||
# There is a lot of extra space in ubuntu that is not being used. | ||
# Therefore, we can remove these unused packages | ||
|
||
echo "==============================================================================" | ||
echo "Freeing up disk space on CI system" | ||
echo "==============================================================================" | ||
|
||
echo "Listing 100 largest packages" | ||
dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -n | tail -n 100 | ||
df -h | ||
|
||
echo "Removing large packages" | ||
sudo apt-get remove -y '^dotnet-.*' | ||
sudo apt-get remove -y '^llvm-.*' | ||
sudo apt-get remove -y 'php.*' | ||
sudo apt-get remove -y '^mongodb-.*' | ||
sudo apt-get remove -y '^mysql-.*' | ||
sudo apt-get remove -y azure-cli google-cloud-sdk hhvm google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri | ||
sudo apt-get autoremove -y | ||
sudo apt-get clean | ||
df -h | ||
|
||
echo "Removing large directories" | ||
sudo rm -rf /usr/share/dotnet/ | ||
sudo rm -rf /usr/local/graalvm/ | ||
sudo rm -rf /usr/local/.ghcup/ | ||
sudo rm -rf /usr/local/share/powershell | ||
sudo rm -rf /usr/local/share/chromium | ||
sudo rm -rf /usr/local/lib/android | ||
sudo rm -rf /usr/local/lib/node_modules | ||
df -h | ||
|
||
echo "Removing docker images" | ||
sudo docker image prune --all --force | ||
df -h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters