Skip to content
This repository was archived by the owner on Jul 10, 2024. It is now read-only.

Commit 6ed412e

Browse files
committed
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
1 parent 42785be commit 6ed412e

File tree

5 files changed

+68
-4
lines changed

5 files changed

+68
-4
lines changed

.github/scripts/free-disk-space.sh

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#!/usr/bin/env bash
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to You under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
18+
# Reference from
19+
# https://github.com/apache/flink/blob/master/tools/azure-pipelines/free_disk_space.sh
20+
# There is a lot of extra space in ubuntu that is not being used.
21+
# Therefore, we can remove these unused packages
22+
23+
echo "=============================================================================="
24+
echo "Freeing up disk space on CI system"
25+
echo "=============================================================================="
26+
27+
echo "Listing 100 largest packages"
28+
dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -n | tail -n 100
29+
df -h
30+
31+
echo "Removing large packages"
32+
sudo apt-get remove -y '^dotnet-.*'
33+
sudo apt-get remove -y '^llvm-.*'
34+
sudo apt-get remove -y 'php.*'
35+
sudo apt-get remove -y '^mongodb-.*'
36+
sudo apt-get remove -y '^mysql-.*'
37+
sudo apt-get remove -y azure-cli google-cloud-sdk hhvm google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri
38+
sudo apt-get autoremove -y
39+
sudo apt-get clean
40+
df -h
41+
42+
echo "Removing large directories"
43+
sudo rm -rf /usr/share/dotnet/
44+
sudo rm -rf /usr/local/graalvm/
45+
sudo rm -rf /usr/local/.ghcup/
46+
sudo rm -rf /usr/local/share/powershell
47+
sudo rm -rf /usr/local/share/chromium
48+
sudo rm -rf /usr/local/lib/android
49+
sudo rm -rf /usr/local/lib/node_modules
50+
df -h
51+
52+
echo "Removing docker images"
53+
sudo docker image prune --all --force
54+
df -h

.github/scripts/start-submarine.sh

+6
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ kubectl label namespace submarine istio-injection=enabled
3232
kubectl label namespace "$submarine_user_namespace" istio-injection=enabled
3333
helm dependency update ./helm-charts/submarine
3434
helm install --wait --set storageClass.provisioner=rancher.io/local-path --set storageClass.volumeBindingMode=WaitForFirstConsumer submarine ./helm-charts/submarine -n submarine
35+
36+
# replace storage size
37+
sed -i "s/10Gi/1Gi/" ./submarine-cloud-v3/config/samples/_v1_submarine.yaml
38+
cat ./submarine-cloud-v3/config/samples/_v1_submarine.yaml
39+
40+
# install submarine
3541
kubectl apply -f ./submarine-cloud-v3/config/samples/_v1_submarine.yaml -n "$submarine_user_namespace"
3642

3743
# Polling waiting for the submarine to be in the RUNNING state

.github/workflows/master.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,9 @@ jobs:
214214
steps:
215215
- uses: actions/checkout@v2
216216
with:
217-
fetch-depth: 50
217+
fetch-depth: 1
218+
- name: Free Disk Space
219+
run: bash ./.github/scripts/free-disk-space.sh
218220
- name: Cache jacoco.exec
219221
uses: actions/cache@v2
220222
with:

.github/workflows/python.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@ jobs:
109109
steps:
110110
- uses: actions/checkout@v3
111111
with:
112-
fetch-depth: 50
112+
fetch-depth: 1
113+
- name: Free Disk Space
114+
run: bash ./.github/scripts/free-disk-space.sh
113115
- name: Setup python environment
114116
uses: actions/setup-python@v4
115117
with:

submarine-server/server-database/src/main/resources/org/apache/submarine/database/mappers/ExperimentMapper.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
<insert id="insert" parameterType="org.apache.submarine.server.database.experiment.entity.ExperimentEntity">
6262
insert into experiment (id, experiment_spec, create_by, create_time, update_by, update_time, experiment_status, accepted_time, running_time, finished_time, uid)
6363
values (#{id,jdbcType=VARCHAR}, #{experimentSpec,jdbcType=VARCHAR},
64-
#{createBy,jdbcType=VARCHAR}, now(), #{updateBy,jdbcType=VARCHAR}, now(), #{experimentStatus,jdbcType=VARCHAR},
64+
#{createBy,jdbcType=VARCHAR}, #{acceptedTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, now(), #{experimentStatus,jdbcType=VARCHAR},
6565
#{acceptedTime,jdbcType=TIMESTAMP}, #{runningTime,jdbcType=TIMESTAMP}, #{finishedTime,jdbcType=TIMESTAMP}, #{uid,jdbcType=VARCHAR})
6666
</insert>
6767

@@ -84,7 +84,7 @@
8484

8585
<update id="create" >
8686
update experiment
87-
set experiment_status='Created', accepted_time=#{acceptedTime,jdbcType=TIMESTAMP}, update_time=now()
87+
set experiment_status='Created', update_time=now()
8888
where id = #{id,jdbcType=VARCHAR}
8989
</update>
9090

0 commit comments

Comments
 (0)