From e1efd6a9c5c1f994268b827fc160085d2d585e8d Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 13 Nov 2025 14:39:53 -0500 Subject: [PATCH] Implement new 'uncompressed' image method This allows the FS to just live, uncompressed, in cache. This is generally a bad idea, however: - In a hypothetically super-tuned diskless image, the lack of double-cache can offset the lack of compression - The image will have supreme read performance - It will have the most deterministic memory behavior --- .../profiles/default/scripts/imageboot.sh | 2 +- .../profiles/default/scripts/imageboot.sh | 22 ++++++++++++------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/confluent_osdeploy/el8-diskless/profiles/default/scripts/imageboot.sh b/confluent_osdeploy/el8-diskless/profiles/default/scripts/imageboot.sh index 0a3d336f..bc0b8437 100644 --- a/confluent_osdeploy/el8-diskless/profiles/default/scripts/imageboot.sh +++ b/confluent_osdeploy/el8-diskless/profiles/default/scripts/imageboot.sh @@ -140,7 +140,7 @@ if [ $TETHERED -eq 1 ]; then echo $ONBOOTPID > /sysroot/run/confluent/onboot_sleep.pid wait $ONBOOTPID losetup $loopdev --direct-io=on - dd if=/mnt/remoteimg/rootimg.sfs iflag=nocache count=0 >& /dev/null + dd if=/mnt/remoteimg/rootimg.sfs iflag=nocache count=0 >& /dev/null ) & fi exec /opt/confluent/bin/start_root diff --git a/confluent_osdeploy/el9-diskless/profiles/default/scripts/imageboot.sh b/confluent_osdeploy/el9-diskless/profiles/default/scripts/imageboot.sh index 468d0a2d..f2b2176a 100644 --- a/confluent_osdeploy/el9-diskless/profiles/default/scripts/imageboot.sh +++ b/confluent_osdeploy/el9-diskless/profiles/default/scripts/imageboot.sh @@ -4,7 +4,7 @@ if [[ "$confluent_whost" == *:* ]] && [[ "$confluent_whost" != "["* ]]; then confluent_whost="[$confluent_mgr]" fi mkdir -p /mnt/remoteimg /mnt/remote /mnt/overlay /sysroot -if [ "untethered" = "$(getarg confluent_imagemethod)" ]; then +if [ "untethered" = "$(getarg confluent_imagemethod)" -o "uncompressed" = "$(getarg confluent_imagemethod)" ]; then mount -t tmpfs untethered /mnt/remoteimg curl https://$confluent_whost/confluent-public/os/$confluent_profile/rootimg.sfs -o /mnt/remoteimg/rootimg.sfs else @@ -40,14 +40,20 @@ fi #mount -t tmpfs overlay /mnt/overlay -modprobe zram -memtot=$(grep ^MemTotal: /proc/meminfo|awk '{print $2}') -memtot=$((memtot/2))$(grep ^MemTotal: /proc/meminfo | awk '{print $3'}) -echo $memtot > /sys/block/zram0/disksize -mkfs.xfs /dev/zram0 > /dev/null +if [ ! "uncompressed" = "$(getarg confluent_imagemethod)" ]; then + modprobe zram + memtot=$(grep ^MemTotal: /proc/meminfo|awk '{print $2}') + memtot=$((memtot/2))$(grep ^MemTotal: /proc/meminfo | awk '{print $3'}) + echo $memtot > /sys/block/zram0/disksize + mkfs.xfs /dev/zram0 > /dev/null +fi TETHERED=0 -if [ "untethered" = "$(getarg confluent_imagemethod)" ]; then - mount -o discard /dev/zram0 /sysroot +if [ "untethered" = "$(getarg confluent_imagemethod)" -o "uncompressed" = "$(getarg confluent_imagemethod)" ]; then + if [ "untethered" = "$(getarg confluent_imagemethod)" ]; then + mount -o discard /dev/zram0 /sysroot + else + mount -t tmpfs disklessroot /sysroot + fi echo -en "Decrypting and extracting root filesystem: 0%\r" srcsz=$(du -sk /mnt/remote | awk '{print $1}') while [ -f /mnt/remoteimg/rootimg.sfs ]; do