Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Driver Toolkit: Get kernel version from bootc image #736

Merged

Conversation

fabiendupont
Copy link
Contributor

@fabiendupont fabiendupont commented Aug 7, 2024

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

training/common/Makefile.common Outdated Show resolved Hide resolved
training/common/driver-toolkit/Containerfile Outdated Show resolved Hide resolved
training/common/driver-toolkit/Containerfile Outdated Show resolved Hide resolved
@fabiendupont fabiendupont force-pushed the get-kernel-version-from-bootc-image branch 2 times, most recently from 377a775 to 0a5a1a3 Compare August 8, 2024 06:35
@fabiendupont fabiendupont requested a review from javipolo August 8, 2024 06:36
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:

```shell
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>
@fabiendupont fabiendupont force-pushed the get-kernel-version-from-bootc-image branch from 0a5a1a3 to 78c57fe Compare August 8, 2024 06:56
@javipolo javipolo merged commit acb2b5d into containers:main Aug 8, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants