containers / ai-lab-recipes

Examples for building and running LLM services and applications locally with Podman
Apache License 2.0
103 stars 106 forks source link

Driver Toolkit: Get kernel version from bootc image #736

Closed fabiendupont closed 1 month ago

fabiendupont commented 1 month ago

Driver Toolkit: Get kernel version from bootc image

When building the driver-toolkit image, It is cumbersome to find kernel version that matches the future nvidia-bootc and intel-bootc images. However, the kernel version is stored as a label on the rhel-bootc images, which are exposed as the FROM variable in the Makefile.

This change collects the kernel version using skopeo inspect and jq.

The DRIVER_TOOLKIT_BASE_IMAGE variable is introduced in the Makefile to dissociate it from the FROM variable that is used as the nvidia-bootc and intel-bootc base image.

The user can now specify something like:

make nvidia-bootc \
    FROM=quay.io/centos-bootc/centos-bootc:stream9 \
    DRIVER_TOOLKIT_BASE_IMAGE=quay.io/centos/centos:stream9

Also, the VERSION variable in /etc/os-release is the full version, so this change modifies the command to retrieve the OS_VERSION_MAJOR value.

Signed-off-by: Fabien Dupont fdupont@redhat.com