Skip to content

Commit f2515e9

Browse files
committed
Adding rhel ai version
Set github hash by defautl as image version. Add RHEL_AI_VERSION into /etc/os-release in order to use it in insights
1 parent 241e0e4 commit f2515e9

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

training/common/Makefile.common

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

2021
AUTH_JSON ?=
2122

training/nvidia-bootc/Containerfile

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

102+
ARG IMAGE_VERSION
103+
102104
# TODO: rework this monstrosity into a build.sh (or even not shell script)
103105
# The need for the `cp /etc/dnf/dnf.conf` is a workaround for https://github.com/containers/bootc/issues/637
104106
RUN mv /etc/selinux /etc/selinux.tmp \
@@ -141,6 +143,7 @@ RUN mv /etc/selinux /etc/selinux.tmp \
141143
# Install rhc connect for insights telemetry gathering
142144
&& . /etc/os-release && if [ "${ID}" == "rhel" ]; then \
143145
dnf install -y rhc rhc-worker-playbook; \
146+
echo "RHEL_AI_VERSION='${IMAGE_VERSION}'" >> /etc/os-release;\
144147
fi \
145148
&& dnf clean all \
146149
&& 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)