Skip to content

Commit 1fa557e

Browse files
committed
crihook: update documentation
1 parent ca6f8f3 commit 1fa557e

File tree

4 files changed

+33
-38
lines changed

4 files changed

+33
-38
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ The FPGA plugin comes as three parts.
6666

6767
- the [device plugin](#device-plugin)
6868
- the [admission controller](#admission-controller)
69-
- the [CRIO-O prestart hook](#cri-o-prestart-hook)
69+
- the [CDI prestart hook](#CDI-prestart-hook)
7070

7171
Refer to each individual sub-components documentation for more details.
7272
Brief overviews of the sub-components are below.
@@ -88,9 +88,9 @@ is responsible for performing mapping from user-friendly function IDs to the
8888
Interface ID and Bitstream ID that are required for FPGA programming. It also
8989
implements access control by namespacing FPGA configuration information.
9090

91-
#### CRI-O Prestart Hook
91+
#### CDI Prestart Hook
9292

93-
The [FPGA prestart CRI-O hook](cmd/fpga_crihook/README.md) performs discovery
93+
The [FPGA CDI prestart hook](cmd/fpga_crihook/README.md) performs discovery
9494
of the requested FPGA function bitstream and programs FPGA devices based on the
9595
environment variables in the workload description.
9696

cmd/fpga_admissionwebhook/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ devices to Kubernetes.
2323
2424
The FPGA admission controller webhook is responsible for performing mapping from user-friendly
2525
function IDs to the Interface ID and Bitstream ID that are required for FPGA programming by
26-
the [FPGA CRI-O hook](../fpga_crihook/README.md).
26+
the [FPGA CDI prestart hook](../fpga_crihook/README.md).
2727

2828
Mappings are stored in namespaced custom resource definition (CRD) objects, therefore the admission
2929
controller also performs access control, determining which bitstream can be used for which namespace.
@@ -39,7 +39,7 @@ This component is one of a set of components that work together. You may also wa
3939
install the following:
4040

4141
- [FPGA device plugin](../fpga_plugin/README.md)
42-
- [FPGA prestart CRI-O hook](../fpga_crihook/README.md)
42+
- [FPGA CDI prestart hook](../fpga_crihook/README.md)
4343

4444
All components have the same basic dependencies as the
4545
[generic plugin framework dependencies](../../README.md#about)
@@ -129,7 +129,7 @@ The same mapping, but with its mode field set to `region`, would translate
129129
and the corresponding AF IDs are set in environment variables for the container.
130130
Though in this case the cluster administrator would probably want to rename
131131
the mapping `arria10.dcp1.2-nlb0-preprogrammed` to something like `arria10.dcp1.2-nlb0-orchestrated`
132-
to reflect its mode. The [FPGA CRI-O hook](../fpga_crihook/README.md) then loads the requested
132+
to reflect its mode. The [FPGA CDI prestart hook](../fpga_crihook/README.md) then loads the requested
133133
bitstream to a region before the container is started.
134134

135135
Mappings of resource names are configured with objects of `AcceleratorFunction` and
@@ -183,4 +183,4 @@ and they are applicable to pods created in the corresponding namespaces.
183183

184184
## Next steps
185185

186-
Continue with [FPGA prestart CRI-O hook](../fpga_crihook/README.md).
186+
Continue with [FPGA CDI prestart hook](../fpga_crihook/README.md).

cmd/fpga_crihook/README.md

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,26 @@
1-
# Intel FPGA prestart CRI-O webhook for Kubernetes
1+
# Intel FPGA CDI prestart hook for Kubernetes
22

33
Table of Contents
44

55
* [Introduction](#introduction)
66
* [Dependencies](#dependencies)
7-
* [Configuring CRI-O](#configuring-cri-o)
7+
* [Configuring CRI runtimes](#configuring-cri-runtimes)
88

99
## Introduction
1010

11-
The FPGA CRI-O webhook is one of the components used to add support for Intel FPGA
11+
The FPGA CDI hook is one of the components used to add support for Intel FPGA
1212
devices to Kubernetes.
1313

14-
The FPGA prestart CRI-O hook is triggered by container annotations, such as set by the
15-
[FPGA device plugin](../fpga_plugin/README.md). It performs discovery of the requested FPGA
16-
function bitstream and then programs FPGA devices based on the environment variables
17-
in the workload description.
14+
The FPGA prestart hook is passed by the [FPGA device plugin](../fpga_plugin/README.md) as
15+
a CDI device attribute to the Kubelet and then to the CRI runtime.
16+
It performs discovery of the requested FPGA function bitstream and then programs FPGA devices
17+
based on the environment variables in the workload description.
1818

19-
The CRI-O prestart hook is only *required* when the
20-
[FPGA admission webhook](../fpga_admissionwebhook/README.md) is configured for orchestration
21-
programmed mode, and is benign (un-used) otherwise.
19+
The hook is only *required* when the [FPGA admission webhook](../fpga_admissionwebhook/README.md)
20+
is configured for orchestration programmed mode, and is benign (un-used) otherwise.
2221

23-
> **Note:** The fpga CRI-O webhook is usually installed by the same DaemonSet as the
24-
> FPGA device plugin. If building and installing the CRI-O webhook by hand, it is
22+
> **Note:** The fpga CDI hook is usually installed by the same DaemonSet as the
23+
> FPGA device plugin. If building and installing the hook by hand, it is
2524
> recommended you reference the
2625
> [fpga plugin DaemonSet YAML](/deployments/fpga_plugin/base/intel-fpga-plugin-daemonset.yaml ) for
2726
> more details.
@@ -39,11 +38,8 @@ All components have the same basic dependencies as the
3938

4039
See [the development guide](../../DEVEL.md) for details if you want to deploy a customized version of the CRI hook.
4140

42-
## Configuring CRI-O
41+
## Configuring CRI runtimes
4342

44-
Recent versions of [CRI-O](https://github.com/cri-o/cri-o) are shipped with default configuration
45-
file that prevents CRI-O to discover and configure hooks automatically.
46-
For FPGA orchestration programmed mode, the OCI hooks are the key component.
47-
Please ensure that your `/etc/crio/crio.conf` parameter `hooks_dir` is either unset
48-
(to enable default search paths for OCI hooks configuration) or contains the directory
49-
`/etc/containers/oci/hooks.d`.
43+
CDI should be enabled for the CRI runtime to call the hook. CRI-O has it enabled by
44+
default and for Containerd it should be enabled explicitly in its configuration file as
45+
explained in the [CDI documentation](https://github.com/cncf-tags/container-device-interface?tab=readme-ov-file#how-to-configure-cdi)

cmd/fpga_plugin/README.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,18 @@ Kubernetes:
4747
which can be used to dynamically convert logical resource names in pod specifications into actual FPGA
4848
resource names, as advertised by the device plugin.
4949

50-
The webhook can also set environment variables to instruct the CRI-O prestart hook to program the FPGA
50+
The webhook can also set environment variables to instruct the CDI prestart hook to program the FPGA
5151
before launching the container.
5252

5353
> **NOTE:** Installation of the [FPGA admission controller webhook](../fpga_admissionwebhook/README.md) can be skipped if the
5454
> FPGA device plugin is operated with the Intel Device Plugins Operator
5555
> since it integrates the controller's functionality.
5656
> However, [the mappings](../fpga_admissionwebhook/README.md#mappings-deployment) still must be deployed."
5757
58-
- [FPGA CRI-O prestart hook](../fpga_crihook/README.md)
58+
- [FPGA CDI prestart hook](../fpga_crihook/README.md)
5959

60-
A [CRI-O](https://github.com/cri-o/cri-o) prestart hook that, upon instruction from the FPGA admission
61-
controller, allocates and programs the FPGA before the container is launched.
60+
A [CDI](https://github.com/cncf-tags/container-device-interface) prestart hook that, upon instruction from the FPGA admission
61+
controller, programs the FPGA before the container is launched.
6262

6363
The repository also contains an [FPGA helper tool](../fpga_tool/README.md) that may be useful during
6464
development, initial deployment and debugging.
@@ -102,15 +102,14 @@ major components:
102102

103103
- [FPGA device plugin](README.md) (this component)
104104
- [FPGA admission controller webhook](../fpga_admissionwebhook/README.md)
105-
- [FPGA prestart CRI-O hook](../fpga_crihook/README.md)
105+
- [FPGA CDI prestart hook](../fpga_crihook/README.md)
106106

107-
The CRI-O hook is only *required* if `region` mode is being used, but is installed by default by the
107+
The CDI hook is only *required* if `region` mode is being used, but is installed by default by the
108108
[FPGA plugin DaemonSet YAML](/deployments/fpga_plugin/base/intel-fpga-plugin-daemonset.yaml), and is benign
109109
in `af` mode.
110110

111-
If using the `af` mode, and therefore *not* using the
112-
CRI-O prestart hook, runtimes other than CRI-O can be used (that is, the CRI-O hook presently
113-
*only* works with the CRI-O runtime).
111+
If using the `af` mode, and therefore *not* using the CDI prestart hook, any runtime can be used
112+
(that is, the CDI is not supported by all runtimes).
114113

115114
The FPGA device plugin requires a Linux Kernel FPGA driver to be installed and enabled to
116115
operate. The plugin supports the use of either of following two drivers, and auto detects
@@ -147,7 +146,7 @@ The following images are available on the Docker hub:
147146

148147
- [The FPGA plugin](https://hub.docker.com/r/intel/intel-fpga-plugin)
149148
- [The FPGA admisson webhook](https://hub.docker.com/r/intel/intel-fpga-admissionwebhook)
150-
- [The FPGA CRI-O prestart hook (in the `initcontainer` image)](https://hub.docker.com/r/intel/intel-fpga-initcontainer)
149+
- [The FPGA CDI prestart hook (in the `initcontainer` image)](https://hub.docker.com/r/intel/intel-fpga-initcontainer)
151150

152151
Depending on the FPGA mode, run either
153152
```bash
@@ -207,7 +206,7 @@ $ kubectl annotate node <node_name> 'fpga.intel.com/device-plugin-mode=af'
207206
And restart the pods on the nodes.
208207

209208
> **Note:** The FPGA plugin [DaemonSet YAML](/deployments/fpga_plugin/base/intel-fpga-plugin-daemonset.yaml)
210-
> also deploys the [FPGA CRI-O hook](../fpga_crihook/README.md) `initcontainer` image, but it will be
209+
> also deploys the [FPGA CDI prestart hook](../fpga_crihook/README.md) `initcontainer` image, but it will be
211210
> benign (un-used) when running the FPGA plugin in `af` mode.
212211
213212
#### Verify Plugin Registration
@@ -223,6 +222,6 @@ fpga.intel.com/region-ce48969398f05f33946d560708be108a: 1
223222
```
224223

225224
> **Note:** The FPGA plugin [DaemonSet YAML](/deployments/fpga_plugin/fpga_plugin.yaml)
226-
> also deploys the [FPGA CRI-O hook](../fpga_crihook/README.md) `initcontainer` image as well. You may
225+
> also deploys the [FPGA CDI prestart hook](../fpga_crihook/README.md) `initcontainer` image as well. You may
227226
> also wish to build that image locally before deploying the FPGA plugin to avoid deploying
228227
> the Docker hub default image.

0 commit comments

Comments
 (0)