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

add: nvidia-cdi-hook to nvidia-container-toolkit #150

Merged
merged 1 commit into from
Sep 19, 2024

Conversation

isaac-400
Copy link

@isaac-400 isaac-400 commented Sep 14, 2024

Issue number:

Closes # N/A

Description of changes:

Downstream users want to use the base nvidia-container-toolkit package with CDI. For full CDI support, the nvidia-container-toolkit package should include the nvidia-cdi-hook. The hook nvidia-cdi-hook is the CLI tool that is expected to be called by the container runtime, when specified by the CDI file.

For more information about how this hook is packaged by NVIDIA, see the official RPM 1.
For how the CDI hook interacts with the container runtime, see the CDI hook documentation 2.

Testing done:

Before this change, running nvidia-ctk cdi generate includes the following log message:

...
WARN[0000] Failed to locate nvidia-cdi-hook: pattern nvidia-cdi-hook not found
...

Running the same command with this change. The output spec contains references to nvidia-cdi-hook and the binary is found on the host:

bash-5.2# find . -name nvidia-cdi-hook
./x86_64-bottlerocket-linux-gnu/sys-root/usr/bin/nvidia-cdi-hook
bash-5.2# $(find . -name nvidia-cdi-hook)
NAME:
   NVIDIA CDI Hook - Command to structure files for usage inside a container, called as hooks from a container runtime, defined in a CDI yaml file

USAGE:
   NVIDIA CDI Hook [global options] command [command options]

VERSION:
   unknown

COMMANDS:
   update-ldcache   Update ldcache in a container by running ldconfig
   create-symlinks  A hook to create symlinks in the container. This can be used to process CSV mount specs
   chmod            Set the permissions of folders in the container by running chmod. The container root is prefixed to the specified paths.
   help, h          Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --debug, -d    Enable debug-level logging (default: false) [$NVIDIA_CDI_DEBUG]
   --quiet        Suppress all output except for errors; overrides --debug (default: false) [$NVIDIA_CDI_QUIET]
   --help, -h     show help
   --version, -v  print the version

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

For full CDI support, the `nvidia-container-toolkit` package should
include the `nvidia-cdi-hook`. The hook nvidia-cdi-hook is the CLI
tool that is expected to be called by the container runtime, when
specified by the CDI file.

For more information about how this hook is packaged by NVIDIA, see
the official RPM [1]. For how the CDI hook interacts with the
container runtime, see the CDI hook documentation [2].

[1]: https://github.com/NVIDIA/nvidia-container-toolkit/blob/main/packaging/rpm/SPECS/nvidia-container-toolkit.spec
[2]: https://github.com/NVIDIA/nvidia-container-toolkit/blob/main/cmd/nvidia-cdi-hook/README.md
@isaac-400 isaac-400 marked this pull request as ready for review September 17, 2024 00:19
@yeazelm
Copy link
Contributor

yeazelm commented Sep 18, 2024

Nit: we typically list the package first in the commit message and then the change so it should be "nvidia-container-toolkit: add nvidia-cdi-hook" for the first line. Otherwise the code looks good to me!

@arnaldo2792 arnaldo2792 merged commit f3a8d3a into bottlerocket-os:develop Sep 19, 2024
2 checks 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.

4 participants