Skip to content

Commit 395c231

Browse files
committed
OCPBUGS-6268 updated the hardware enablement guide
1 parent 15274bc commit 395c231

File tree

6 files changed

+49
-46
lines changed

6 files changed

+49
-46
lines changed

_topic_maps/_topic_map.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2559,7 +2559,7 @@ Topics:
25592559
- Name: About specialized hardware and driver enablement
25602560
File: about-hardware-enablement
25612561
- Name: Driver Toolkit
2562-
File: psap-driver-toolkit
2562+
File: he-driver-toolkit
25632563
- Name: Node Feature Discovery Operator
25642564
File: psap-node-feature-discovery-operator
25652565
---

hardware_enablement/about-hardware-enablement.adoc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ include::_attributes/common-attributes.adoc[]
66

77
toc::[]
88

9-
Many applications require specialized hardware or software that depends on kernel modules or drivers. You can use driver containers to load out-of-tree kernel modules on {op-system-first} nodes. To deploy out-of-tree drivers during cluster installation, use the `kmods-via-containers` framework. To load drivers or kernel modules on an existing {product-title} cluster, {product-title} offers several tools:
9+
The Driver Toolkit (DTK) is a container image in the {product-title} payload which is meant to be used as a base image on which to build driver containers. The Driver Toolkit image contains the kernel packages commonly required as dependencies to build or install kernel modules as well as a few tools needed in driver containers. The version of these packages will match the kernel version running on the RHCOS nodes in the corresponding {product-title} release.
1010

11-
* The Driver Toolkit is a container image that is a part of every {product-title} release. It contains the kernel packages and other common dependencies that are needed to build a driver or kernel module. The Driver Toolkit can be used as a base image for driver container image builds on {product-title}.
12-
* The Node Feature Discovery (NFD) Operator adds node labels for CPU capabilities, kernel version, PCIe device vendor IDs, and more.
11+
Driver containers are container images used for building and deploying out-of-tree kernel modules and drivers on container operating systems such as :op-system-first:. Kernel modules and drivers are software libraries running with a high level of privilege in the operating system kernel. They extend the kernel functionalities or provide the hardware-specific code required to control new devices. Examples include hardware devices like field-programmable gate arrays (FPGA) or graphics processing units (GPU), and software-defined storage solutions, which all require kernel modules on client machines. Driver containers are the first layer of the software stack used to enable these technologies on {product-title} deployments.

hardware_enablement/psap-driver-toolkit.adoc renamed to hardware_enablement/he-driver-toolkit.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ include::_attributes/common-attributes.adoc[]
66

77
toc::[]
88

9-
Learn about the Driver Toolkit and how you can use it as a base image for driver containers for enabling special software and hardware devices on Kubernetes.
9+
Learn about the Driver Toolkit and how you can use it as a base image for driver containers for enabling special software and hardware devices on {product-title} deployments.
1010

1111
:FeatureName: The Driver Toolkit
1212

modules/psap-driver-toolkit-pulling.adoc

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ The `driver-toolkit` image is available from the link:https://registry.redhat.io
1111
[id="pulling-the-driver-toolkit-from-registry"]
1212
== Pulling the Driver Toolkit container image from registry.redhat.io
1313

14-
Instructions for pulling the `driver-toolkit` image from `registry.redhat.io` with podman or in {product-title} can be found on the link:https://catalog.redhat.com/software/containers/openshift4/driver-toolkit-rhel8/604009d6122bd89307e00865?container-tabs=gti[Red Hat Ecosystem Catalog].
15-
The driver-toolkit image for the latest minor release will be tagged with the minor release version on registry.redhat.io for example `registry.redhat.io/openshift4/driver-toolkit-rhel8:v4.12`.
14+
Instructions for pulling the `driver-toolkit` image from `registry.redhat.io` with `podman` or in {product-title} can be found on the link:https://catalog.redhat.com/software/containers/openshift4/driver-toolkit-rhel8/604009d6122bd89307e00865?container-tabs=gti[Red Hat Ecosystem Catalog].
15+
The driver-toolkit image for the latest minor release are tagged with the minor release version on `registry.redhat.io`, for example: `registry.redhat.io/openshift4/driver-toolkit-rhel8:v{product-version}`.
1616

1717
[id="pulling-the-driver-toolkit-from-payload"]
1818
== Finding the Driver Toolkit image URL in the payload
@@ -26,9 +26,13 @@ The driver-toolkit image for the latest minor release will be tagged with the mi
2626

2727
. The image URL of the `driver-toolkit` corresponding to a certain release can be extracted from the release image using the `oc adm` command:
2828
+
29-
[source,terminal]
29+
[source,terminal,subs="attributes+"]
3030
----
31-
$ oc adm release info 4.12.0 --image-for=driver-toolkit
31+
# For x86 image:
32+
$ oc adm release info quay.io/openshift-release-dev/ocp-release:{product-version}.z-x86_64 --image-for=driver-toolkit
33+
34+
# For ARM image:
35+
$ oc adm release info quay.io/openshift-release-dev/ocp-release:{product-version}.z-aarch64 --image-for=driver-toolkit
3236
----
3337
+
3438
.Example output
@@ -37,7 +41,7 @@ $ oc adm release info 4.12.0 --image-for=driver-toolkit
3741
quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:0fd84aee79606178b6561ac71f8540f404d518ae5deff45f6d6ac8f02636c7f4
3842
----
3943

40-
. This image can be pulled using a valid pull secret, such as the pull secret required to install {product-title}.
44+
. This image can be obtained using a valid pull secret, such as the pull secret required to install {product-title}.
4145

4246
[source,terminal]
4347
----

modules/psap-driver-toolkit-using.adoc

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
[id="using-the-driver-toolkit_{context}"]
77
= Using the Driver Toolkit
88

9-
As an example, the Driver Toolkit can be used as the base image for building a very simple kernel module called simple-kmod.
9+
As an example, the Driver Toolkit can be used as the base image for building a very simple kernel module called `simple-kmod`.
1010

1111
[NOTE]
1212
====
13-
The Driver Toolkit contains the necessary dependencies, `openssl`, `mokutil`, and `keyutils`, needed to sign a kernel module. However, in this example, the simple-kmod kernel module is not signed and therefore cannot be loaded on systems with `Secure Boot` enabled.
13+
The Driver Toolkit includes the necessary dependencies, `openssl`, `mokutil`, and `keyutils`, needed to sign a kernel module. However, in this example, the `simple-kmod` kernel module is not signed and therefore cannot be loaded on systems with `Secure Boot` enabled.
1414
====
1515

1616
[id="create-simple-kmod-image_{context}"]
@@ -59,42 +59,40 @@ spec:
5959
- type: "ConfigChange"
6060
- type: "ImageChange"
6161
source:
62-
git:
63-
ref: "master"
64-
uri: "https://github.com/openshift-psap/kvc-simple-kmod.git"
65-
type: Git
6662
dockerfile: |
67-
FROM DRIVER_TOOLKIT_IMAGE
63+
ARG DTK
64+
FROM ${DTK} as builder
65+
66+
ARG KVER
6867
6968
WORKDIR /build/
70-
71-
# Expecting kmod software version as an input to the build
72-
ARG KMODVER
7369
74-
# Grab the software from upstream
7570
RUN git clone https://github.com/openshift-psap/simple-kmod.git
76-
WORKDIR simple-kmod
77-
78-
# Build and install the module
79-
RUN make all KVER=$(rpm -q --qf "%{VERSION}-%{RELEASE}.%{ARCH}" kernel-core) KMODVER=${KMODVER} \
80-
&& make install KVER=$(rpm -q --qf "%{VERSION}-%{RELEASE}.%{ARCH}" kernel-core) KMODVER=${KMODVER}
81-
82-
# Add the helper tools
83-
WORKDIR /root/kvc-simple-kmod
84-
ADD Makefile .
85-
ADD simple-kmod-lib.sh .
86-
ADD simple-kmod-wrapper.sh .
87-
ADD simple-kmod.conf .
88-
RUN mkdir -p /usr/lib/kvc/ \
89-
&& mkdir -p /etc/kvc/ \
90-
&& make install
91-
92-
RUN systemctl enable kmods-via-containers@simple-kmod
71+
72+
WORKDIR /build/simple-kmod
73+
74+
RUN make all install KVER=${KVER}
75+
76+
FROM registry.redhat.io/ubi8/ubi-minimal
77+
78+
ARG KVER
79+
80+
# Required for installing `modprobe`
81+
RUN microdnf install kmod
82+
83+
COPY --from=builder /lib/modules/${KVER}/simple-kmod.ko /lib/modules/${KVER}/
84+
COPY --from=builder /lib/modules/${KVER}/simple-procfs-kmod.ko /lib/modules/${KVER}/
85+
RUN depmod ${KVER}
9386
strategy:
9487
dockerStrategy:
9588
buildArgs:
9689
- name: KMODVER
9790
value: DEMO
91+
# $ oc adm release info quay.io/openshift-release-dev/ocp-release:<cluster version>-x86_64 --image-for=driver-toolkit
92+
- name: DTK
93+
value: quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:34864ccd2f4b6e385705a730864c04a40908e57acede44457a783d739e377cae
94+
- name: KVER
95+
value: 4.18.0-372.26.1.el8_6.x86_64
9896
output:
9997
to:
10098
kind: ImageStreamTag
@@ -183,11 +181,14 @@ spec:
183181
- image: image-registry.openshift-image-registry.svc:5000/simple-kmod-demo/simple-kmod-driver-container:demo
184182
name: simple-kmod-driver-container
185183
imagePullPolicy: Always
186-
command: ["/sbin/init"]
184+
command: [sleep, infinity]
187185
lifecycle:
186+
postStart:
187+
exec:
188+
command: ["modprobe", "-v", "-a" , "simple-kmod", "simple-procfs-kmod"]
188189
preStop:
189190
exec:
190-
command: ["/bin/sh", "-c", "systemctl stop kmods-via-containers@simple-kmod"]
191+
command: ["modprobe", "-r", "-a" , "simple-kmod", "simple-procfs-kmod"]
191192
securityContext:
192193
privileged: true
193194
nodeSelector:

modules/psap-driver-toolkit.adoc

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
[discrete]
1010
== Background
11-
The Driver Toolkit is a container image in the {product-title} payload used as a base image on which you can build driver containers. The Driver Toolkit image contains the kernel packages commonly required as dependencies to build or install kernel modules, as well as a few tools needed in driver containers. The version of these packages will match the kernel version running on the {op-system-first} nodes in the corresponding {product-title} release.
11+
The Driver Toolkit is a container image in the {product-title} payload used as a base image on which you can build driver containers. The Driver Toolkit image includes the kernel packages commonly required as dependencies to build or install kernel modules, as well as a few tools needed in driver containers. The version of these packages will match the kernel version running on the {op-system-first} nodes in the corresponding {product-title} release.
1212

13-
Driver containers are container images used for building and deploying out-of-tree kernel modules and drivers on container operating systems like {op-system}. Kernel modules and drivers are software libraries running with a high level of privilege in the operating system kernel. They extend the kernel functionalities or provide the hardware-specific code required to control new devices. Examples include hardware devices like Field Programmable Gate Arrays (FPGA) or GPUs, and software-defined storage (SDS) solutions, such as Lustre parallel file systems, which require kernel modules on client machines. Driver containers are the first layer of the software stack used to enable these technologies on Kubernetes.
13+
Driver containers are container images used for building and deploying out-of-tree kernel modules and drivers on container operating systems like {op-system}. Kernel modules and drivers are software libraries running with a high level of privilege in the operating system kernel. They extend the kernel functionalities or provide the hardware-specific code required to control new devices. Examples include hardware devices like Field Programmable Gate Arrays (FPGA) or GPUs, and software-defined storage (SDS) solutions, such as Lustre parallel file systems, which require kernel modules on client machines. Driver containers are the first layer of the software stack used to enable these technologies on Kubernetes.
1414

1515
The list of kernel packages in the Driver Toolkit includes the following and their dependencies:
1616

@@ -27,7 +27,7 @@ In addition, the Driver Toolkit also includes the corresponding real-time kernel
2727
* `kernel-rt-modules`
2828
* `kernel-rt-modules-extra`
2929

30-
The Driver Toolkit also has several tools which are commonly needed to build and install kernel modules, including:
30+
The Driver Toolkit also has several tools that are commonly needed to build and install kernel modules, including:
3131

3232
* `elfutils-libelf-devel`
3333
* `kmod`
@@ -37,7 +37,6 @@ The Driver Toolkit also has several tools which are commonly needed to build and
3737

3838
[discrete]
3939
== Purpose
40-
Prior to the Driver Toolkit's existence, you could install kernel packages in a pod or build config on {product-title} using link:https://www.openshift.com/blog/how-to-use-entitled-image-builds-to-build-drivercontainers-with-ubi-on-openshift[entitled builds] or by installing from the kernel RPMs in the hosts `machine-os-content`. The Driver Toolkit simplifies the process by removing the entitlement step, and avoids the privileged operation of accessing the machine-os-content in a pod. The Driver Toolkit can also be used by partners who have access to pre-released {product-title} versions to prebuild driver-containers for their hardware devices for future {product-title} releases.
41-
42-
The Driver Toolkit is also used by the Special Resource Operator (SRO), which is currently available as a community Operator on OperatorHub. SRO supports out-of-tree and third-party kernel drivers and the support software for the underlying operating system. Users can create _recipes_ for SRO to build and deploy a driver container, as well as support software like a device plugin, or metrics. Recipes can include a build config to build a driver container based on the Driver Toolkit, or SRO can deploy a prebuilt driver container.
40+
Prior to the Driver Toolkit's existence, users would install kernel packages in a pod or build config on {product-title} using link:https://www.openshift.com/blog/how-to-use-entitled-image-builds-to-build-drivercontainers-with-ubi-on-openshift[entitled builds] or by installing from the kernel RPMs in the hosts `machine-os-content`. The Driver Toolkit simplifies the process by removing the entitlement step, and avoids the privileged operation of accessing the machine-os-content in a pod. The Driver Toolkit can also be used by partners who have access to pre-released {product-title} versions to prebuild driver-containers for their hardware devices for future {product-title} releases.
4341

42+
The Driver Toolkit is also used by the Kernel Module Management (KMM), which is currently available as a community Operator on OperatorHub. KMM supports out-of-tree and third-party kernel drivers and the support software for the underlying operating system. Users can create modules for KMM to build and deploy a driver container, as well as support software like a device plugin, or metrics. Modules can include a build config to build a driver container-based on the Driver Toolkit, or KMM can deploy a prebuilt driver container.

0 commit comments

Comments
 (0)