Skip to content

Commit 3168496

Browse files
authored
Merge pull request #665 from tsorya/igal/rhel_ai_version
RHELAI-473: Adding rhel ai version
2 parents 3cab84c + e7bd5e3 commit 3168496

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

training/common/Makefile.common

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ CONTAINER_TOOL_EXTRA_ARGS ?=
1717
EXTRA_RPM_PACKAGES ?=
1818
GRAPH_ROOT=$(shell podman info --format '{{ .Store.GraphRoot }}')
1919
UMASK=$(shell umask)
20+
IMAGE_VERSION := $(or ${IMAGE_VERSION},$(shell git rev-parse --short HEAD))
2021

2122
AUTH_JSON ?=
2223

training/nvidia-bootc/Containerfile

+5
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ COPY --from=builder --chmod=444 /home/builder/yum-packaging-precompiled-kmod/tmp
102102
# Temporary workaround until the permanent fix for libdnf is merged
103103
COPY nvidia-toolkit-firstboot.service /usr/lib/systemd/system/nvidia-toolkit-firstboot.service
104104

105+
ARG IMAGE_VERSION
106+
105107
# TODO: rework this monstrosity into a build.sh (or even not shell script)
106108
# The need for the `cp /etc/dnf/dnf.conf` is a workaround for https://github.com/containers/bootc/issues/637
107109
RUN mv /etc/selinux /etc/selinux.tmp \
@@ -149,6 +151,9 @@ RUN mv /etc/selinux /etc/selinux.tmp \
149151
# Install rhc connect for insights telemetry gathering
150152
&& . /etc/os-release && if [ "${ID}" == "rhel" ]; then \
151153
dnf install -y rhc rhc-worker-playbook; \
154+
sed -i -e "/^VARIANT=/ {s/^VARIANT=.*/VARIANT=\"RHEL AI\"/; t}" -e "\$aVARIANT=\"RHEL AI\"\"" /etc/os-release;
155+
sed -i -e "/^VARIANT_ID=/ {s/^VARIANT_ID=.*/VARIANT_ID=rhel_ai/; t}" -e "\$aVARIANT_ID=rhel_ai" /etc/os-release;
156+
sed -i -e "/^BUILD_ID=/ {s/^BUILD_ID=.*/BUILD_ID='${IMAGE_VERSION}'/; t}" -e "\$aBUILD_ID='${IMAGE_VERSION}'" /etc/os-release;
152157
fi \
153158
&& dnf clean all \
154159
&& ln -s ../cloud-init.target /usr/lib/systemd/system/default.target.wants \

training/nvidia-bootc/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ bootc: driver-toolkit check-sshkey prepare-files
1616
$(DRIVER_TOOLKIT_IMAGE:%=--build-arg DRIVER_TOOLKIT_IMAGE=%) \
1717
$(DRIVER_VERSION:%=--build-arg DRIVER_VERSION=%) \
1818
$(DRIVER_VERSION:%=--label driver-version=%) \
19+
$(IMAGE_VERSION:%=--label image_version=%) \
20+
$(IMAGE_VERSION:%=--build-arg IMAGE_VERSION=%) \
1921
$(EXTRA_RPM_PACKAGES:%=--build-arg EXTRA_RPM_PACKAGES=%) \
2022
$(FROM:%=--build-arg BASEIMAGE=%) \
2123
$(INSTRUCTLAB_IMAGE:%=--build-arg INSTRUCTLAB_IMAGE=%) \

0 commit comments

Comments
 (0)