Skip to content

Commit 4a1c175

Browse files
committed
documentation: add configuration instructions
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
1 parent 3b39456 commit 4a1c175

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,36 @@ However, as devices and software grows more complex, vendors want to perform mor
2020
In the absence of a standard for third party devices, vendors often have to write and maintain multiple plugins for different runtimes or even directly contribute vendor specific code in the runtime.
2121
Additionally runtimes don't uniformly expose a plugin system (or even expose a plugin system at all) leading to duplication of the functionality in higher level abstractions (such as Kubernetes device plugins).
2222

23+
## How does CDI work?
24+
25+
For CDI to work the following needs to be done:
26+
27+
- CDI file containing update for the OCI spec in JSON format should be present in the CDI
28+
spec directory. Default directories are /etc/cdi and /var/run/cdi
29+
30+
- Fully qualified device name should be passed to the runtime either
31+
using command line parameters for podman or using container annotations
32+
for CRI-O and Containerd
33+
34+
- Container runtime should be able to find CDI file by the device name
35+
and update container config using CDI file content.
36+
37+
## How to configure CDI?
38+
39+
### CRI-O configuration
40+
41+
### Containerd configuration
42+
43+
To enable and configure CDI support in the [containerd runtime](https://github.com/containerd/containerd) 2 configuration options `enable_cdi` and `cdi_spec_dirs` should be set in the `plugins."io.containerd.grpc.v1.cri` section of the containerd configuration file (`/etc/containerd/config.toml` by default):
44+
45+
```
46+
[plugins."io.containerd.grpc.v1.cri"]
47+
enable_cdi = true
48+
cdi_spec_dirs = ["/etc/cdi", "/var/run/cdi"]
49+
```
50+
51+
Remember to restart containerd for any configuration changes to take effect.
52+
2353
## Examples
2454
```bash
2555
$ mkdir /etc/cdi

0 commit comments

Comments
 (0)