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 support for CDI device configuration #10081

Merged
merged 1 commit into from
Apr 26, 2021

Conversation

sjug
Copy link
Contributor

@sjug sjug commented Apr 19, 2021

Thanks to Renaud from Nvidia.

@sjug sjug force-pushed the cdi_device_lib branch 2 times, most recently from cfa0a39 to 288197b Compare April 19, 2021 14:23
libpod/options.go Outdated Show resolved Hide resolved
@sjug sjug force-pushed the cdi_device_lib branch 3 times, most recently from ea52be6 to bc07c5b Compare April 19, 2021 15:10
@TomSweeneyRedHat
Copy link
Member

The CI won't be happy until you add a test.
Quick glance, the code LGTM

@rhatdan
Copy link
Member

rhatdan commented Apr 19, 2021

Needs a rebase.

@openshift-ci openshift-ci bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 20, 2021
@sjug
Copy link
Contributor Author

sjug commented Apr 20, 2021

@TomSweeneyRedHat Ack, saw that thanks.

Rebased & test added.

@openshift-ci openshift-ci bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 20, 2021
@sjug sjug force-pushed the cdi_device_lib branch 3 times, most recently from 1378767 to f015d7f Compare April 20, 2021 12:38
for _, device := range s.Devices {
isCDIDevice, err := cdi.HasDevice(device.Path)
if err != nil {
// do nothing
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we at least log the error (warning or debug level)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This "error" will occur whenever the --device passed is not a CDI device.
Agreed it's worth logging somewhere, added.

if err != nil {
// do nothing
}
if isCDIDevice {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in case of errors, what is the value for isCDIDevice?

Would it be safer to use if err == nil && isCDIDevice?

- Persist CDIDevices in container config
- Add e2e test
- Log HasDevice error and add additional condition for safety

Signed-off-by: Sebastian Jug <seb@stianj.ug>
@zvonkok
Copy link

zvonkok commented Apr 20, 2021

@RenaudWasTaken PTAL


for _, device := range s.Devices {
isCDIDevice, err := cdi.HasDevice(device.Path)
if err != nil {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we bubble an error up the stack here?

Copy link

@RenaudWasTaken RenaudWasTaken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, one minor nit

@RenaudWasTaken
Copy link

cc @umohnani8

@umohnani8
Copy link
Member

LGTM

@umohnani8
Copy link
Member

/approve

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: RenaudWasTaken, sjug, umohnani8

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 26, 2021
@mheon
Copy link
Member

mheon commented Apr 26, 2021

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 26, 2021
@openshift-merge-robot openshift-merge-robot merged commit fef3ea8 into containers:master Apr 26, 2021
@elezar elezar mentioned this pull request Aug 10, 2021
@elezar elezar mentioned this pull request Jan 12, 2022
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 23, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants