Skip to content

Commit 2f1620e

Browse files
jiridanekopenshift-merge-bot[bot]
authored andcommitted
ISSUE #971: chore(gha): switch from ext4 to btrfs with compression and add log printing for the future
1 parent 5e3046a commit 2f1620e

File tree

2 files changed

+22
-8
lines changed

2 files changed

+22
-8
lines changed

.github/workflows/build-notebooks-TEMPLATE.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ jobs:
5454
with:
5555
cache-dependency-path: "**/*.sum"
5656

57+
- run: sudo apt-get update
58+
5759
- name: Login to GitHub Container Registry
5860
uses: docker/login-action@v3
5961
with:
@@ -93,6 +95,8 @@ jobs:
9395
9496
df -h
9597
98+
- run: sudo apt-get install -y btrfs-compsize
99+
96100
- name: Mount lvm overlay for podman builds
97101
run: |
98102
df -h
@@ -244,6 +248,9 @@ jobs:
244248

245249
- name: "push|schedule|workflow_dispatch: make ${{ inputs.target }}"
246250
run: |
251+
# print running stats on disk occupancy
252+
(while true; do df -h | grep "${HOME}/.local/share/containers"; sleep 30; done) &
253+
247254
make ${{ inputs.target }}
248255
if: ${{ fromJson(inputs.github).event_name == 'push' ||
249256
fromJson(inputs.github).event_name == 'schedule' ||
@@ -253,6 +260,9 @@ jobs:
253260
CONTAINER_BUILD_CACHE_ARGS: "--cache-from ${{ env.CACHE }} --cache-to ${{ env.CACHE }}"
254261
- name: "pull_request: make ${{ inputs.target }}"
255262
run: |
263+
# print running stats on disk occupancy
264+
(while true; do df -h | grep "${HOME}/.local/share/containers"; sleep 30; done) &
265+
256266
make ${{ inputs.target }}
257267
if: "${{ fromJson(inputs.github).event_name == 'pull_request' }}"
258268
env:
@@ -568,3 +578,6 @@ jobs:
568578

569579
- run: df -h
570580
if: "${{ !cancelled() }}"
581+
582+
- run: sudo compsize -x "${HOME}/.local/share/containers"
583+
if: "${{ !cancelled() }}"

ci/cached-builds/gha_lvm_overlay.sh

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ build_mount_path_ownership="runner:runner"
1717

1818
pv_loop_path=/pv.img
1919
tmp_pv_loop_path=/mnt/tmp-pv.img
20-
overprovision_lvm=false
2120

2221
VG_NAME=buildvg
2322

@@ -60,14 +59,16 @@ sudo swapon "/dev/mapper/${VG_NAME}-swap"
6059
echo "Creating build volume"
6160
# create and mount build volume
6261
sudo lvcreate --type raid0 --stripes 2 --stripesize 4 --alloc anywhere --extents 100%FREE --name buildlv "${VG_NAME}"
63-
if [[ ${overprovision_lvm} == 'true' ]]; then
64-
sudo mkfs.ext4 -m0 "/dev/mapper/${VG_NAME}-buildlv"
65-
else
66-
sudo mkfs.ext4 -Enodiscard -m0 "/dev/mapper/${VG_NAME}-buildlv"
67-
fi
62+
# https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html
63+
# https://btrfs.readthedocs.io/en/latest/Administration.html
64+
sudo mkfs.btrfs "/dev/mapper/${VG_NAME}-buildlv"
65+
6866
mkdir -p "${build_mount_path}"
69-
# https://www.alibabacloud.com/help/en/ecs/use-cases/mount-parameters-for-ext4-file-systems?spm=a2c63.p38356.help-menu-25365.d_5_10_12.48ce3be5RixoUB#8e740ed072m5o
70-
sudo mount -o defaults,noatime,nodiratime,nobarrier,nodelalloc,data=writeback "/dev/mapper/${VG_NAME}-buildlv" "${build_mount_path}"
67+
68+
# https://github.com/btrfs/btrfs-todo/issues/29
69+
# https://fedoramagazine.org/working-with-btrfs-compression/
70+
sudo mount -t btrfs -o defaults,noatime,noautodefrag,nobarrier,compress=zstd:3,nodatasum,nodiscard,nodatacow,space_cache=v2 "/dev/mapper/${VG_NAME}-buildlv" "${build_mount_path}"
71+
findmnt -vno OPTIONS "${build_mount_path}"
7172
sudo chown -R "${build_mount_path_ownership}" "${build_mount_path}"
7273

7374
# if build mount path is a parent of $GITHUB_WORKSPACE, and has been deleted, recreate it

0 commit comments

Comments
 (0)