From f41f6023661fa78a811ffd465c308d810ef444d7 Mon Sep 17 00:00:00 2001 From: Jiri Kyjovsky Date: Fri, 4 Jul 2025 16:44:37 +0200 Subject: [PATCH] copr-backend: setup swap for powerful builders in osuosl --- .../files/provision/files/enable-swap.sh | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/roles/copr/backend/files/provision/files/enable-swap.sh b/roles/copr/backend/files/provision/files/enable-swap.sh index 9669dcd713..e2f03a2fa9 100644 --- a/roles/copr/backend/files/provision/files/enable-swap.sh +++ b/roles/copr/backend/files/provision/files/enable-swap.sh @@ -25,15 +25,26 @@ if test -f /config/resalloc-vars.sh; then # VMs on our hypervisors have this file created, providing some basic info # about the "pool ID" (== particular hypervisor). generic_mount -elif grep POWER9 /proc/cpuinfo; then - # OpenStack Power9 only for now. We have only one large volume there. +elif grep -E 'POWER9|POWER10' /proc/cpuinfo; then + # OpenStack Power9/Power10 setup. We have only one large volume there. # Partitioning using cloud-init isn't trival, especially considering we # share the Power8 and Power9 builder images so we create a swap file # on / filesystem. file=/sub-mounts-file swap_device_base=loop5 swap_device=/dev/$swap_device_base - truncate -s 164G "$file" + + if grep POWER10 /proc/cpuinfo; then + # WARNING/TODO: this is for powerful builders only, but it's hardcoded + # and will stop working once we switch to p10. The setup should be done + # generically, as stated in the comment above, so the large swap file + # is created automatically upon the on_demand_powerful tag configuration. + truncate -s 320G "$file" + else + # regular builder + truncate -s 164G "$file" + fi + losetup "$swap_device_base" "$file" elif test -e /dev/xvda1 && test -e /dev/nvme0n1; then # AWS aarch64 machine. We use separate volume allocation as the default