Skip to content

Commit 0b15ffd

Browse files
committed
apply changes to install podman step to fix arm64 errors
1 parent 43e689f commit 0b15ffd

File tree

5 files changed

+49
-5
lines changed

5 files changed

+49
-5
lines changed

.github/actions/free-up-disk-space/action.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@ description: 'Removes unnecessary packages and files to free up disk space on Gi
44
runs:
55
using: "composite"
66
steps:
7-
- name: Free up additional disk space
7+
- name: Free up disk space
88
shell: bash
99
run: |
1010
set -x
1111
df -h
12+
sudo docker system prune -af || true
13+
sudo apt-get clean
14+
sudo rm -rf /tmp/*
1215
sudo apt-get update
1316
sudo apt-get purge -y '^dotnet-.*' '^llvm-.*' 'php.*' '^mongodb-.*'
1417
sudo apt-get autoremove -y --purge
@@ -20,6 +23,5 @@ runs:
2023
sudo rm -rf /usr/share/dotnet &
2124
sudo rm -rf /opt/ghc &
2225
sudo rm -rf /opt/hostedtoolcache/CodeQL &
23-
sudo docker image prune --all --force &
2426
wait
2527
df -h

.github/actions/install-podman-action/action.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ runs:
1313
shell: bash
1414
run: sudo apt-get -qq remove podman crun
1515

16+
# Ensure parent dir exists and is runner-owned so cache restore can set file modes (avoids "Cannot change mode: Operation not permitted").
17+
- name: Prepare .linuxbrew parent for cache
18+
shell: bash
19+
run: |
20+
sudo mkdir -p /home/linuxbrew
21+
sudo chown -R "$(whoami):$(whoami)" /home/linuxbrew
22+
1623
- uses: actions/cache@v5
1724
# https://docs.github.com/en/actions/reference/variables-reference#default-environment-variables
1825
# https://docs.github.com/en/actions/how-tos/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables
@@ -21,6 +28,17 @@ runs:
2128
path: /home/linuxbrew/.linuxbrew
2229
key: linuxbrew-${{ runner.os }}-${{ runner.arch }}
2330

31+
# Restored cache can have wrong ownership or immutable flags; fix so brew/podman and mode changes work.
32+
- name: Fix .linuxbrew ownership and permissions after cache restore
33+
if: steps.cached-linuxbrew.outputs.cache-hit == 'true'
34+
shell: bash
35+
run: |
36+
if [[ -d /home/linuxbrew/.linuxbrew ]]; then
37+
sudo chattr -R -i /home/linuxbrew/.linuxbrew 2>/dev/null || true
38+
sudo chown -R "$(whoami):$(whoami)" /home/linuxbrew/.linuxbrew
39+
sudo chmod -R u+rwX,go=rX /home/linuxbrew/.linuxbrew
40+
fi
41+
2442
- name: Install podman (linux/amd64, or qemu-user emulation)
2543
if: contains(fromJSON('["linux/amd64", "linux/s390x", "linux/ppc64le"]'), inputs.platform) && steps.cached-linuxbrew.outputs.cache-hit != 'true'
2644
shell: bash

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ jobs:
6868
# Makefile variables
6969
BUILD_ARCH: ${{ inputs.platform }}
7070
RELEASE_PYTHON_VERSION: ${{ inputs.python }}
71+
# Faster/smaller cache restore on resource-constrained runners (e.g. arm64). RHAIENG-2819
72+
GHA_CACHE_ZSTD_LEVEL: "3"
7173

7274
steps:
7375

@@ -160,7 +162,7 @@ jobs:
160162

161163
# region Free up disk space
162164

163-
- name: Free up additional disk space
165+
- name: Free up disk space
164166
uses: ./.github/actions/free-up-disk-space
165167
# https://docs.github.com/en/actions/learn-github-actions/expressions
166168
# NOTE: the arm64 GitHub hosted runner does not have the /mnt-mounted scratch disk
@@ -324,7 +326,7 @@ jobs:
324326
# leave a breadcrumb trail in the logs.
325327
(while true; do
326328
echo "=== $(date -u '+%H:%M:%S') ==="
327-
df -h | grep "${HOME}/.local/share/containers"
329+
df -h / /mnt "${HOME}/.local/share/containers" 2>/dev/null || df -h
328330
free -h
329331
sleep 30
330332
done) &
@@ -567,7 +569,12 @@ jobs:
567569
- run: df -h
568570
if: "${{ !cancelled() }}"
569571

570-
- run: sudo compsize -x "${HOME}/.local/share/containers"
572+
- run: |
573+
if mountpoint -q "${HOME}/.local/share/containers"; then
574+
sudo compsize -x "${HOME}/.local/share/containers"
575+
else
576+
echo "Skipping compsize: ${HOME}/.local/share/containers is not a btrfs mountpoint."
577+
fi
571578
if: "${{ !cancelled() && steps.install-compsize.outcome == 'success' }}"
572579
573580
# print system logs, useful when hunting for OOM kills

ci/cached-builds/gha_lvm_overlay.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,20 @@ tmp_pv_loop_path=/mnt/tmp-pv.img
2121

2222
VG_NAME=buildvg
2323

24+
25+
# Detect if /mnt is a separate block device from /
26+
ROOT_DEV=$(df --output=source / | tail -1)
27+
MNT_DEV=$(df --output=source /mnt | tail -1)
28+
if [[ "$ROOT_DEV" == "$MNT_DEV" ]]; then
29+
echo "Single-disk runner (/mnt on same fs as root) — skipping LVM, using root fs directly."
30+
mkdir -p "${build_mount_path}"
31+
sudo chown -R "${build_mount_path_ownership}" "${build_mount_path}"
32+
if [[ ! -d "${GITHUB_WORKSPACE}" ]]; then
33+
sudo mkdir -p "${GITHUB_WORKSPACE}"
34+
sudo chown -R "${WORKSPACE_OWNER}" "${GITHUB_WORKSPACE}"
35+
fi
36+
exit 0
37+
fi
2438
# github runners have an active swap file in /mnt/swapfile
2539
# we want to reuse the temp disk, so first unmount swap and clean the temp disk
2640
echo "Unmounting and removing swap file."

ci/cached-builds/storage.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
# Multiple users sharing the same containers/storage is not "supported" as it tends to cause
44
# various permission issues on the host or wrong uid/gids in the containers. C.f.
55
# https://access.redhat.com/solutions/6986565
6+
#
7+
# graphroot/runroot point at the LVM-backed build volume (gha_lvm_overlay.sh) so heavy
8+
# image pulls and layers stay off the runner root partition. RHAIENG-2819
69
[storage]
710
driver = "overlay"
811

0 commit comments

Comments
 (0)