Make a list prettier in image-compatibility blog

pull/51449/head
windsonsea 2025-07-01 09:31:34 +08:00
parent 5f6e4038a6
commit c958319703
1 changed files with 30 additions and 22 deletions

View File

@ -27,7 +27,7 @@ A container image is built on a base image, which provides a minimal runtime env
Host driver versions must match the supported range of a library version inside the container to avoid compatibility problems. Examples include GPUs and network drivers.
- **Libraries or Software**:
The container must come with a specific version or range of versions for a library or software to run optimally in the environment. Examples from high performance computing are MPI, EFA, or Infiniband.
- **Kernel Modules or Features:**:
- **Kernel Modules or Features**:
Specific kernel features or modules must be present. Examples include having support of write protected huge page faults, or the presence of VFIO
- And more…
@ -121,33 +121,41 @@ Additionally, it could potentially enable automatic node configuration to some e
### Examples of usage
1. **Define image compatibility metadata**
A [container image](/docs/concepts/containers/images) can have metadata that describes its requirements based on features discovered from nodes, like kernel modules or CPU models.
The previous compatibility specification example in this article exemplified this use case.
1. **Define image compatibility metadata**
2. **Attach the artifact to the image**
The image compatibility specification is stored as an OCI artifact.
You can attach this metadata to your container image using the [oras](https://oras.land/) tool.
The registry only needs to support OCI artifacts, support for arbitrary types is not required.
Keep in mind that the container image and the artifact must be stored in the same registry.
Use the following command to attach the artifact to the image:
A [container image](/docs/concepts/containers/images) can have metadata that describes
its requirements based on features discovered from nodes, like kernel modules or CPU models.
The previous compatibility specification example in this article exemplified this use case.
```bash
oras attach \
--artifact-type application/vnd.nfd.image-compatibility.v1alpha1 <image-url> \
<path-to-spec>.yaml:application/vnd.nfd.image-compatibility.spec.v1alpha1+yaml
```
2. **Attach the artifact to the image**
3. **Validate image compatibility**
After attaching the compatibility specification, you can validate whether a node meets the image's requirements.
This validation can be done using the [nfd client](https://kubernetes-sigs.github.io/node-feature-discovery/v0.17/reference/node-feature-client-reference.html):
The image compatibility specification is stored as an OCI artifact.
You can attach this metadata to your container image using the [oras](https://oras.land/) tool.
The registry only needs to support OCI artifacts, support for arbitrary types is not required.
Keep in mind that the container image and the artifact must be stored in the same registry.
Use the following command to attach the artifact to the image:
`nfd compat validate-node --image <image-url>`
```bash
oras attach \
--artifact-type application/vnd.nfd.image-compatibility.v1alpha1 <image-url> \
<path-to-spec>.yaml:application/vnd.nfd.image-compatibility.spec.v1alpha1+yaml
```
4. **Read the output from the client**
Finally you can read the report generated by the tool or use your own tools to act based on the generated JSON report.
3. **Validate image compatibility**
![validate-node command output](validate-node-output.png)
After attaching the compatibility specification, you can validate whether a node meets the
image's requirements. This validation can be done using the
[nfd client](https://kubernetes-sigs.github.io/node-feature-discovery/v0.17/reference/node-feature-client-reference.html):
```bash
nfd compat validate-node --image <image-url>
```
4. **Read the output from the client**
Finally you can read the report generated by the tool or use your own tools to act based on the generated JSON report.
![validate-node command output](validate-node-output.png)
## Conclusion