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 support for CDI devices to device flag #2280
base: main
Are you sure you want to change the base?
Conversation
73defce
to
bde1b0a
Compare
/cc @mikebrow Do you know who should have a look at this? Changes are similar to containerd/containerd#8525. |
github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 // indirect | ||
google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect | ||
gopkg.in/yaml.v2 v2.4.0 // indirect | ||
sigs.k8s.io/yaml v1.3.0 // indirect |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we minimize these dependencies?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code for loading the CDI specifications reads YAML files -- and contains the functionaility to set up watchers on the filesystem that updates the spec in daemonized cases. We are looking to reduce the set of dependencies required, but that work has not yet been started.
Are there any dependencies in particular that you are concerned about? (To be clear, this should be a similar set to those for containerd
which includes the same feature when using CRI).
if err != nil { | ||
return | ||
} | ||
for _, device := range allDevices { | ||
if cdi.IsQualifiedName(device) { | ||
opt.CDIDevices = append(opt.CDIDevices, device) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we want to keep this experimental until the syntax gets accepted in Docker CLI
https://github.com/containerd/nerdctl/blob/main/docs/experimental.md?plain=1
https://github.com/search?q=repo%3Acontainerd%2Fnerdctl+checkExperimental&type=code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we have an integration test too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. I will add an integration test and also gate this behind an experimental flag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Docker CLI PR has been merged, so I will pick up this PR again in the next couple of days.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@elezar ping?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay. I will look at this again this week.
Needs rebase |
bde1b0a
to
b6931e4
Compare
dae7a2d
to
c00e0f5
Compare
This change adds support for specifying fully-qualified CDI device names in the --device flag. This allows the Container Device Interface (CDI) to be used to inject devices into container being run. Signed-off-by: Evan Lezar <elezar@nvidia.com>
Signed-off-by: Evan Lezar <elezar@nvidia.com>
Signed-off-by: Evan Lezar <elezar@nvidia.com>
c00e0f5
to
0d4ec2a
Compare
This change adds support for specifying fully-qualified CDI device names in the --device flag. This allows the Container Device Interface (CDI) to be used to inject devices into container being run.
This mirrors the support recently added to
ctr
(see containerd/containerd#8525) and under review for the Docker CLI (see docker/cli#4084).Note that this assumes that the CLI is used to inject devices and additional work would be required for other mechanisms such as compose files.