From ee74a256ce4d53a317e4e35a9a91b21244e2cad9 Mon Sep 17 00:00:00 2001 From: Eric MacDonald Date: Wed, 3 Aug 2022 14:59:20 +0000 Subject: [PATCH] Debian: Modify kickstart to implement single OSTREE pull This update implements kickstart changes required to install controller nodes with a single network ostree_repo pull. Test Plan: Verify single network pull for all PASS: Verify AIO provisioning from a USB install PASS: Verify AIO provisioning from a PXE install PASS: Verify Standard 2+1 System provisioning from a USB install PASS: Verify worker only install PASS: Verify controller-1 install from controller-0 (5+) PASS: Verify Standard controller-0 install from controller-1 PASS: Verify Standard worker install from controller-1 Story: 2009968 Task: 45932 Signed-off-by: Eric MacDonald Change-Id: I72684d65237c3596ef07a8fdcfc0555fc9e95a3e --- kickstart/files/kickstart.cfg | 83 ++++++++++++++++++++++++++++++++--- 1 file changed, 77 insertions(+), 6 deletions(-) diff --git a/kickstart/files/kickstart.cfg b/kickstart/files/kickstart.cfg index a7d917c1..6ec4a98a 100644 --- a/kickstart/files/kickstart.cfg +++ b/kickstart/files/kickstart.cfg @@ -1483,6 +1483,75 @@ udevadm settle --timeout=300 || report_failure_with_msg "udevadm settle failed" # Rescan LVM cache to avoid warnings for VGs that were recreated. pvscan --cache 2>/dev/null +# Stage the ostree_repo in /sysroot for network installations +# of controller nodes. Doing so avoids a double ostree pull of +# the huge ostree_repo over the network. +if is_usb_install -eq 0 ; then + + ilog "USB Install" + +else + + ilog "Network Install" + + ################################################################## + # + # System node installs of worker and storage nodes are installed + # over the network rather than from a staged archive. + # This is because these node types do not have/need a local feed. + # + ################################################################## + + if [ "${controller}" = true ] ; then + + ilog "Controller Install" + + ############################################################## + # + # Controller node network installs pull the ostree_repo from + # the pxeboot server's feed directory in 'archive' mode into + # /sysroot as a local staging location. In this case LAT's + # INSTL (install) variable is updated to install from that + # local stage. + # + # This is done to avoid a second (double) ostree_repo pull + # over the network that would otherwise be needed to populate + # the controller's feed directory. + # + # This staged ostree_repo archive is later moved to the + # controller's feed directory to be used for future installs + # of other system nodes from this controller. + # + ############################################################## + + PHYS_SYSROOT="/sysroot" + OSTREE_ROOT_DEVICE="LABEL=otaroot" + mkdir -p ${PHYS_SYSROOT} + mount -o rw,noatime "${OSTREE_ROOT_DEVICE}" "${PHYS_SYSROOT}" || elog "Error mounting ${OSTREE_ROOT_DEVICE}" + + repo="${PHYS_SYSROOT}/var/www/pages/feed/rel-xxxPLATFORM_RELEASExxx/ostree_repo" + mkdir -p "${repo}" + + # Tell LAT to install friom this local stage + # i.e. override where LAT installs from. + export instl=${repo} + export INSTL=${instl} + + ostree --repo=${repo} init --mode=archive + if [ "${insturl}" = "file://NOT_SET" ] ; then + ilog "ostree_repo archive pull from file:///instboot/ostree_repo" + ostree --repo=${repo} remote add ${instbr} file:///instboot/ostree_repo + else + ilog "ostree_repo archive pull from ${insturl}" + ostree --repo=${repo} remote add ${instbr} ${insturl} + fi + + ostree --repo=${repo} pull --depth=-1 --mirror ${instbr}:${instbr} + umount ${PHYS_SYSROOT} + + fi +fi + true %end @@ -2087,14 +2156,16 @@ if [ "${controller}" = true ] ; then mkdir -p "${pxeboot}/rel-${sw_release}" if [ ${OSTREE_REPO_FETCHED} -eq 0 ] ; then - ilog "Pull ostree_repo to ${repo}" - ostree --repo=${repo} init --mode=archive - if [ "${insturl}" = "file://NOT_SET" ] ; then + if is_usb_install -eq 0 ; then + + ilog "Stage ostree_repo from USB device to ${repo}" + ostree --repo=${repo} init --mode=archive ostree --repo=${repo} remote add ${instbr} file:///instboot/ostree_repo + ostree --repo=${repo} pull ${pull_options} ${instbr}:${instbr} else - ostree --repo=${repo} remote add ${instbr} ${insturl} + ilog "Stage ostree_repo from previous /sysroot pull to ${repo}" + mv -f /sysroot/var/www/pages/feed/rel-${sw_release}/ostree_repo ${IMAGE_ROOTFS}/var/www/pages/feed/rel-${sw_release}/ fi - ostree --repo=${repo} pull ${pull_options} ${instbr}:${instbr} # This is used by patching. # Set ostree remote to the local install feed @@ -2143,7 +2214,7 @@ if [ "${controller}" = true ] ; then # handle pxeboot install else pxeurl=$(echo $insturl | sed -e s/ostree_repo//) - ilog "Fetch bzImage and initrd files from ${pxeurl}/pxeboot to ${feed}/pxeboot and ${pxeboot}/rel-${sw_release}" + ilog "Fetch bzImage and initrd files from ${pxeurl}/pxeboot" pushd ${feed}/pxeboot > /dev/null for f in bzImage bzImage-rt bzImage-rt.sig bzImage.sig bzImage-std bzImage-std.sig initrd initrd.sig; do if [ ! -e "./${f}" ] ; then