Skip to content

Commit

Permalink
Add upgrade-informer for rhel images only
Browse files Browse the repository at this point in the history
  • Loading branch information
tsorya committed Jul 15, 2024
1 parent d2fe974 commit 7a256e1
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions training/nvidia-bootc/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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

Expand Down

0 comments on commit 7a256e1

Please sign in to comment.