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

Tutorial / How-to for creating a CDI spec #234

Open
wahabk opened this issue Oct 21, 2024 · 2 comments
Open

Tutorial / How-to for creating a CDI spec #234

wahabk opened this issue Oct 21, 2024 · 2 comments

Comments

@wahabk
Copy link

wahabk commented Oct 21, 2024

Hello, thank you for making CDI and unifying device interfaces into a spec that is relatively simple. I'm working with a vendor to create a spec and test it in podman. I know what device nodes / driver files / environment variables I need to set.

Thank you for creating the example, I have 2 questions:

  1. How can I use the repo to validat/generate a spec?
  2. Is there a plan to write a documentation how-to?

Thanks!

@wahabk
Copy link
Author

wahabk commented Oct 21, 2024

Showing my working out so it helps with generating examples.

Something like the following would help an uninitiated user start quickly:

Requirements

  • Golang

Installation

git clone https://github.com/cncf-tags/container-device-interface.git
cd container-device-interface
make
export PATH=$PATH:$(realpath bin)

Example: Validating a spec

$ validate /etc/cdi/nvidia.yaml 
Validating against JSON schema builtin...
/etc/cdi/nvidia.yaml: document is valid.

@wahabk
Copy link
Author

wahabk commented Oct 22, 2024

To clarify, I'm still confused as to the functionality of this repo.

$ cdi inject test.yaml /dev/nvidia0
Updated OCI Spec:
  ociVersion: ""
$ cdi resolve test.yaml 
  ociVersion: ""

I've been using the help functionality of the CLI which is great, but there are no manpages.

The only example I can find of a generated CDI online is Nvidia's GPUs. So it is unclear to me how to generate a spec from scratch.

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

No branches or pull requests

1 participant