Skip to content

Commit 7a256e1

Browse files
committed
Add upgrade-informer for rhel images only
1 parent d2fe974 commit 7a256e1

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

training/nvidia-bootc/Containerfile

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,20 @@ RUN mv /etc/selinux /etc/selinux.tmp \
150150
dnf module enable -y nvidia-driver:${DRIVER_BRANCH} && \
151151
dnf install -y nvidia-fabric-manager-${DRIVER_VERSION} libnvidia-nscq-${DRIVER_BRANCH}-${DRIVER_VERSION} ; \
152152
fi \
153-
# Install rhc connect for insights telemetry gathering
154153
&& . /etc/os-release && if [ "${ID}" == "rhel" ]; then \
154+
# Install rhc connect for insights telemetry gathering
155155
dnf install -y rhc rhc-worker-playbook; \
156+
# Adding rhel ai identity to os-release file for insights usage
156157
sed -i -e "/^VARIANT=/ {s/^VARIANT=.*/VARIANT=\"RHEL AI\"/; t}" -e "\$aVARIANT=\"RHEL AI\"" /usr/lib/os-release; \
157158
sed -i -e "/^VARIANT_ID=/ {s/^VARIANT_ID=.*/VARIANT_ID=rhel_ai/; t}" -e "\$aVARIANT_ID=rhel_ai" /usr/lib/os-release; \
158159
sed -i -e "/^BUILD_ID=/ {s/^BUILD_ID=.*/BUILD_ID='${IMAGE_VERSION}'/; t}" -e "\$aBUILD_ID='${IMAGE_VERSION}'" /usr/lib/os-release; \
160+
161+
# enable upgrade informer timer
162+
ln -s /usr/lib/systemd/system/upgrade-informer.timer /usr/lib/systemd/system/timers.target.wants/upgrade-informer.timer; \
163+
# enable upgrade informer service, added as we need it to start on boot
164+
ln -s /usr/lib/systemd/system/upgrade-informer.service /usr/lib/systemd/system/basic.target.wants/upgrade-informer.service; \
165+
# disable auto upgrade service
166+
rm -f /usr/lib/systemd/system/default.target.wants/bootc-fetch-apply-updates.timer;
159167
fi \
160168
&& dnf clean all \
161169
&& ln -s ../cloud-init.target /usr/lib/systemd/system/default.target.wants \
@@ -164,13 +172,8 @@ RUN mv /etc/selinux /etc/selinux.tmp \
164172
&& echo "blacklist nouveau" > /etc/modprobe.d/blacklist_nouveau.conf \
165173
&& sed '/\[Unit\]/a ConditionPathExists = /dev/nvidia-nvswitchctl' /usr/lib/systemd/system/nvidia-fabricmanager.service \
166174
&& ln -s /usr/lib/systemd/system/nvidia-fabricmanager.service /etc/systemd/system/multi-user.target.wants/nvidia-fabricmanager.service \
167-
&& ln -s /usr/lib/systemd/system/nvidia-persistenced.service /etc/systemd/system/multi-user.target.wants/nvidia-persistenced.service \
168-
# enable upgrade informer timer
169-
&& ln -s /usr/lib/systemd/system/upgrade-informer.timer /usr/lib/systemd/system/timers.target.wants/upgrade-informer.timer \
170-
# enable upgrade informer service, added as we need it to start on boot
171-
&& ln -s /usr/lib/systemd/system/upgrade-informer.service /usr/lib/systemd/system/basic.target.wants/upgrade-informer.service \
172-
# disable auto upgrade service
173-
&& rm -f /usr/lib/systemd/system/default.target.wants/bootc-fetch-apply-updates.timer
175+
&& ln -s /usr/lib/systemd/system/nvidia-persistenced.service /etc/systemd/system/multi-user.target.wants/nvidia-persistenced.service
176+
174177

175178
ARG SSHPUBKEY
176179

0 commit comments

Comments
 (0)