From 7a256e1e8c1960651b0ad0b8d66a90fdd80b3a80 Mon Sep 17 00:00:00 2001 From: Igal Tsoiref Date: Mon, 15 Jul 2024 14:10:30 +0300 Subject: [PATCH] Add upgrade-informer for rhel images only --- training/nvidia-bootc/Containerfile | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/training/nvidia-bootc/Containerfile b/training/nvidia-bootc/Containerfile index fb4952ea..30e4b996 100644 --- a/training/nvidia-bootc/Containerfile +++ b/training/nvidia-bootc/Containerfile @@ -150,12 +150,20 @@ RUN mv /etc/selinux /etc/selinux.tmp \ dnf module enable -y nvidia-driver:${DRIVER_BRANCH} && \ dnf install -y nvidia-fabric-manager-${DRIVER_VERSION} libnvidia-nscq-${DRIVER_BRANCH}-${DRIVER_VERSION} ; \ fi \ - # Install rhc connect for insights telemetry gathering && . /etc/os-release && if [ "${ID}" == "rhel" ]; then \ + # Install rhc connect for insights telemetry gathering dnf install -y rhc rhc-worker-playbook; \ + # Adding rhel ai identity to os-release file for insights usage sed -i -e "/^VARIANT=/ {s/^VARIANT=.*/VARIANT=\"RHEL AI\"/; t}" -e "\$aVARIANT=\"RHEL AI\"" /usr/lib/os-release; \ sed -i -e "/^VARIANT_ID=/ {s/^VARIANT_ID=.*/VARIANT_ID=rhel_ai/; t}" -e "\$aVARIANT_ID=rhel_ai" /usr/lib/os-release; \ sed -i -e "/^BUILD_ID=/ {s/^BUILD_ID=.*/BUILD_ID='${IMAGE_VERSION}'/; t}" -e "\$aBUILD_ID='${IMAGE_VERSION}'" /usr/lib/os-release; \ + + # enable upgrade informer timer + ln -s /usr/lib/systemd/system/upgrade-informer.timer /usr/lib/systemd/system/timers.target.wants/upgrade-informer.timer; \ + # enable upgrade informer service, added as we need it to start on boot + ln -s /usr/lib/systemd/system/upgrade-informer.service /usr/lib/systemd/system/basic.target.wants/upgrade-informer.service; \ + # disable auto upgrade service + rm -f /usr/lib/systemd/system/default.target.wants/bootc-fetch-apply-updates.timer; fi \ && dnf clean all \ && ln -s ../cloud-init.target /usr/lib/systemd/system/default.target.wants \ @@ -164,13 +172,8 @@ RUN mv /etc/selinux /etc/selinux.tmp \ && echo "blacklist nouveau" > /etc/modprobe.d/blacklist_nouveau.conf \ && sed '/\[Unit\]/a ConditionPathExists = /dev/nvidia-nvswitchctl' /usr/lib/systemd/system/nvidia-fabricmanager.service \ && ln -s /usr/lib/systemd/system/nvidia-fabricmanager.service /etc/systemd/system/multi-user.target.wants/nvidia-fabricmanager.service \ - && ln -s /usr/lib/systemd/system/nvidia-persistenced.service /etc/systemd/system/multi-user.target.wants/nvidia-persistenced.service \ - # enable upgrade informer timer - && ln -s /usr/lib/systemd/system/upgrade-informer.timer /usr/lib/systemd/system/timers.target.wants/upgrade-informer.timer \ - # enable upgrade informer service, added as we need it to start on boot - && ln -s /usr/lib/systemd/system/upgrade-informer.service /usr/lib/systemd/system/basic.target.wants/upgrade-informer.service \ - # disable auto upgrade service - && rm -f /usr/lib/systemd/system/default.target.wants/bootc-fetch-apply-updates.timer + && ln -s /usr/lib/systemd/system/nvidia-persistenced.service /etc/systemd/system/multi-user.target.wants/nvidia-persistenced.service + ARG SSHPUBKEY