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

Settings extension for Nvidia settings APIs #43

Merged
merged 1 commit into from
Jul 30, 2024

Conversation

monirul
Copy link
Contributor

@monirul monirul commented Jul 23, 2024

Issue #, if available:

Description of changes:
This PR contains the settings sdk changes for Nvidia api. In this PR, we have add the settings for settings.nvidia-container-runtime and settings.kubernetes.device-plugin.nvidia.

Testing done:
Yes.

bash-5.1# apiclient set settings.kubernetes.device-plugins.nvidia.pass-device-specs=true
bash-5.1# cat /etc/nvidia-k8s-device-plugin/settings.yaml
version: v1
flags:
  migStrategy: "none"
  failOnInitError: true
  plugin:
    passDeviceSpecs: true
    deviceListStrategy: volume-mounts
    deviceIDStrategy: index
bash-5.1# apiclient set settings.kubernetes.device-plugins.nvidia.device-list-strategy=envvar
bash-5.1# cat /etc/nvidia-k8s-device-plugin/settings.yaml
version: v1
flags:
  migStrategy: "none"
  failOnInitError: true
  plugin:
    passDeviceSpecs: true
    deviceListStrategy: envvar
    deviceIDStrategy: index
bash-5.1# apiclient set settings.kubernetes.device-plugins.nvidia.device-id-strategy=uuid
bash-5.1# cat /etc/nvidia-k8s-device-plugin/settings.yaml
version: v1
flags:
  migStrategy: "none"
  failOnInitError: true
  plugin:
    passDeviceSpecs: true
    deviceListStrategy: envvar
    deviceIDStrategy: uuid

bash-5.1# cat /etc/nvidia-container-runtime/config.toml
accept-nvidia-visible-devices-as-volume-mounts = true
accept-nvidia-visible-devices-envvar-when-unprivileged = false

[nvidia-container-cli]
root = "/"
path = "/usr/bin/nvidia-container-cli"
environment = []
ldconfig = "@/sbin/ldconfig"
bash-5.1# apiclient set settings.nvidia-container-runtime.visible-devices-as-volume-mounts=false
bash-5.1# apiclient set settings.nvidia-container-runtime.visible-devices-envvar-when-unprivileged=true
bash-5.1# cat /etc/nvidia-container-runtime/config.toml
accept-nvidia-visible-devices-as-volume-mounts = false
accept-nvidia-visible-devices-envvar-when-unprivileged = true

[nvidia-container-cli]
root = "/"
path = "/usr/bin/nvidia-container-cli"
environment = []
ldconfig = "@/sbin/ldconfig"

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@cbgbt
Copy link
Contributor

cbgbt commented Jul 23, 2024

Looks like you may need to run cargo fmt to get the linter to pass.

@monirul monirul force-pushed the nvidia-settings-api branch 2 times, most recently from 9a174d9 to bf4bf8f Compare July 23, 2024 22:20
Copy link
Contributor

@cbgbt cbgbt left a comment

Choose a reason for hiding this comment

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

The GitHub actions CI workflow runs make build -- you could use the same target locally to iterate on getting it to pass.

Cargo.toml Outdated Show resolved Hide resolved
@monirul monirul force-pushed the nvidia-settings-api branch 5 times, most recently from 8b5de17 to 4df0197 Compare July 24, 2024 21:19
@cbgbt
Copy link
Contributor

cbgbt commented Jul 25, 2024

I'm overall pretty happy with this, other than some minor suggestions (and of course, getting the build to pass 😄)

@monirul monirul force-pushed the nvidia-settings-api branch 5 times, most recently from a8f37fd to efc4613 Compare July 28, 2024 21:24
#[serde(rename_all = "kebab-case")]
pub enum NvidiaDeviceListStrategy {
Envvar,
VolumeMounts,
Copy link
Contributor

Choose a reason for hiding this comment

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

Does device-list-strategy = "volume-mounts" here imply that visible-devices-as-volume-mounts should also be true?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes.

bottlerocket-settings-models: prepare for v0.2.0 release
@monirul monirul merged commit 4709409 into bottlerocket-os:develop Jul 30, 2024
1 check passed
@cbgbt
Copy link
Contributor

cbgbt commented Jul 30, 2024

Looks good to me.

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.

3 participants