Skip to content

Commit debad1a

Browse files
committed
switch to a better action without lvm hacks
1 parent 75ba468 commit debad1a

2 files changed

Lines changed: 12 additions & 116 deletions

File tree

.github/actions/pull_images/action.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,18 @@ inputs:
2222
runs:
2323
using: composite
2424
steps:
25+
- name: Free Disk Space
26+
uses: endersonmenezes/free-disk-space@v3
27+
with:
28+
remove_android: false # Takes a long time to remove even with rmz
29+
remove_dotnet: true # Pretty quick and saves a lot
30+
remove_haskell: true # Extremely quick and saves a lot
31+
remove_tool_cache: false # Decent savings but not fast enough
32+
remove_packages: false # By far the slowest option
33+
remove_packages_one_command: true
34+
remove_folders: "/usr/share/swift /usr/share/az* /usr/local/share/chromium"
35+
rm_cmd: "rmz" # Use 'rmz' for faster deletion (default: 'rm')
36+
rmz_version: "3.1.1" # Required when rm_cmd is 'rmz'
2537
- name: Get image list
2638
shell: bash
2739
run: |

.github/workflows/run-end-to-end.yml

Lines changed: 0 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -118,111 +118,6 @@ jobs:
118118
SYSTEM_TESTS_FORCE_EXECUTE: ${{ inputs.force_execute }}
119119
SYSTEM_TESTS_DEV_MODE: ${{ inputs._system_tests_dev_mode }}
120120
steps:
121-
# Cleanup code from https://github.com/easimon/maximize-build-space
122-
- name: Disk space report before modification
123-
shell: bash
124-
run: |
125-
echo "Memory and swap:"
126-
sudo free -h
127-
echo
128-
sudo swapon --show
129-
echo
130-
131-
echo "Available storage:"
132-
sudo df -h
133-
echo
134-
- name: Maximize build disk space
135-
shell: bash
136-
run: |
137-
set -euo pipefail
138-
139-
# # absolute file path for the LVM image created on the root filesystem
140-
# PV_LOOP_PATH="/pv.img"
141-
142-
# # absolute file path for the LVM image created on the temp filesystem
143-
# TMP_PV_LOOP_PATH="/mnt/tmp-pv.img"
144-
145-
# # store owner of $GITHUB_WORKSPACE in case the action deletes it
146-
# WORKSPACE_OWNER="$(stat -c '%U:%G' "${GITHUB_WORKSPACE}")"
147-
148-
# # ensure mount path exists before the action
149-
# sudo mkdir -p "${GITHUB_WORKSPACE}"
150-
# sudo find "${GITHUB_WORKSPACE}" -maxdepth 0 ! -empty -exec echo 'WARNING: directory [{}] is not empty, data loss might occur. Content:' \; -exec ls -al "{}" \;
151-
152-
# only android system images removed, the rest takes too long
153-
# docker cache not removed because we use Docker so it could be useful
154-
echo "Removing unwanted software... "
155-
echo " Android System Images... "
156-
sudo rm -rf /usr/local/lib/android/sdk/system-images
157-
echo " .NET... "
158-
sudo rm -rf /usr/share/dotnet
159-
echo " Haskell... "
160-
sudo rm -rf /opt/ghc
161-
echo " CodeQL... "
162-
sudo rm -rf /opt/hostedtoolcache/CodeQL
163-
echo "... done"
164-
165-
# VG_NAME=buildvg
166-
167-
# # github runners have an active swap file in /mnt/swapfile
168-
# # we want to reuse the temp disk, so first unmount swap and clean the temp disk
169-
# echo "Unmounting and removing swap file."
170-
# sudo swapoff -a
171-
# sudo rm -f /mnt/swapfile
172-
173-
# echo "Creating LVM Volume."
174-
# echo " Creating LVM PV on root fs."
175-
# # create loop pv image on root fs
176-
# ROOT_RESERVE_KB=$(expr 1024 \* 1024)
177-
# ROOT_FREE_KB=$(df --block-size=1024 --output=avail / | tail -1)
178-
# ROOT_LVM_SIZE_KB=$(expr $ROOT_FREE_KB - $ROOT_RESERVE_KB)
179-
# ROOT_LVM_SIZE_BYTES=$(expr $ROOT_LVM_SIZE_KB \* 1024)
180-
# sudo touch "${PV_LOOP_PATH}" && sudo fallocate -z -l "${ROOT_LVM_SIZE_BYTES}" "${PV_LOOP_PATH}"
181-
# export ROOT_LOOP_DEV=$(sudo losetup --find --show "${PV_LOOP_PATH}")
182-
# sudo pvcreate -f "${ROOT_LOOP_DEV}"
183-
184-
# # create pv on temp disk
185-
# echo " Creating LVM PV on temp fs."
186-
# TMP_RESERVE_KB=$(expr 100 \* 1024)
187-
# TMP_FREE_KB=$(df --block-size=1024 --output=avail /mnt | tail -1)
188-
# TMP_LVM_SIZE_KB=$(expr $TMP_FREE_KB - $TMP_RESERVE_KB)
189-
# TMP_LVM_SIZE_BYTES=$(expr $TMP_LVM_SIZE_KB \* 1024)
190-
# sudo touch "${TMP_PV_LOOP_PATH}" && sudo fallocate -z -l "${TMP_LVM_SIZE_BYTES}" "${TMP_PV_LOOP_PATH}"
191-
# export TMP_LOOP_DEV=$(sudo losetup --find --show "${TMP_PV_LOOP_PATH}")
192-
# sudo pvcreate -f "${TMP_LOOP_DEV}"
193-
194-
# # create volume group from these pvs
195-
# sudo vgcreate "${VG_NAME}" "${TMP_LOOP_DEV}" "${ROOT_LOOP_DEV}"
196-
197-
# echo "Recreating swap"
198-
# # create and activate swap
199-
# sudo lvcreate -L "4096M" -n swap "${VG_NAME}"
200-
# sudo mkswap "/dev/mapper/${VG_NAME}-swap"
201-
# sudo swapon "/dev/mapper/${VG_NAME}-swap"
202-
203-
# echo "Creating build volume"
204-
# # create and mount build volume
205-
# sudo lvcreate -l 100%FREE -n buildlv "${VG_NAME}"
206-
# sudo mkfs.ext4 -Enodiscard -m0 "/dev/mapper/${VG_NAME}-buildlv"
207-
# sudo mount "/dev/mapper/${VG_NAME}-buildlv" "${GITHUB_WORKSPACE}"
208-
# sudo chown -R "runner:runner" "${GITHUB_WORKSPACE}"
209-
210-
# # if build mount path is a parent of $GITHUB_WORKSPACE, and has been deleted, recreate it
211-
# if [[ ! -d "${GITHUB_WORKSPACE}" ]]; then
212-
# sudo mkdir -p "${GITHUB_WORKSPACE}"
213-
# sudo chown -R "${WORKSPACE_OWNER}" "${GITHUB_WORKSPACE}"
214-
# fi
215-
- name: Disk space report after modification
216-
shell: bash
217-
run: |
218-
echo "Memory and swap:"
219-
sudo free -h
220-
echo
221-
sudo swapon --show
222-
echo
223-
224-
echo "Available storage:"
225-
sudo df -h
226121
- name: Compute ref
227122
id: compute_ref
228123
run: |
@@ -267,17 +162,6 @@ jobs:
267162
scenarios: ${{ inputs.scenarios }}
268163
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
269164
dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }}
270-
- name: Disk space report after pulling
271-
shell: bash
272-
run: |
273-
echo "Memory and swap:"
274-
sudo free -h
275-
echo
276-
sudo swapon --show
277-
echo
278-
279-
echo "Available storage:"
280-
sudo df -h
281165
- name: Build weblog
282166
id: build
283167
run: |

0 commit comments

Comments
 (0)