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 option to set additional containerd configs per runtime #497

Merged
merged 2 commits into from
May 21, 2024

Conversation

elezar
Copy link
Member

@elezar elezar commented May 16, 2024

This change allows for the containerd configuration using the nvidia-ctk CLI as well as the toolkit container to set additional configuration options. This can be used, for example, to specify the value of SystemdCgroup explicitly.

For example:

./nvidia-ctk runtime configure --runtime=containerd --dry-run --runtime-config-override="{\"options\": {\"SystemdCgroup\": true}}"
INFO[0000] Config file does not exist; using empty config
version = 2

[plugins]

  [plugins."io.containerd.grpc.v1.cri"]

    [plugins."io.containerd.grpc.v1.cri".containerd]

      [plugins."io.containerd.grpc.v1.cri".containerd.runtimes]

        [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.nvidia]
          privileged_without_host_devices = false
          runtime_engine = ""
          runtime_root = ""
          runtime_type = "io.containerd.runc.v2"

          [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.nvidia.options]
            BinaryName = "/usr/bin/nvidia-container-runtime"
            SystemdCgroup = true

This can also be set using an envvar:

RUNTIME_CONFIG_OVERRIDE="{\"options\": {\"SystemdCgroup\": true}}" ./nvidia-ctk runtime configure --runtime=containerd --dry-run
INFO[0000] Config file does not exist; using empty config
version = 2

[plugins]

  [plugins."io.containerd.grpc.v1.cri"]

    [plugins."io.containerd.grpc.v1.cri".containerd]

      [plugins."io.containerd.grpc.v1.cri".containerd.runtimes]

        [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.nvidia]
          privileged_without_host_devices = false
          runtime_engine = ""
          runtime_root = ""
          runtime_type = "io.containerd.runc.v2"

          [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.nvidia.options]
            BinaryName = "/usr/bin/nvidia-container-runtime"
            SystemdCgroup = true

@elezar elezar self-assigned this May 16, 2024
@elezar elezar requested a review from zvonkok May 16, 2024 08:46
@elezar elezar force-pushed the systemdcgroup branch 2 times, most recently from d86c221 to 0e446de Compare May 16, 2024 11:36
elezar added 2 commits May 17, 2024 12:58
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This allow for options such as SystemdCgroup to be optionally set.

Signed-off-by: Evan Lezar <elezar@nvidia.com>
@elezar elezar marked this pull request as ready for review May 17, 2024 10:59
@elezar elezar requested a review from shivamerla May 17, 2024 10:59
Copy link
Contributor

@shivamerla shivamerla left a comment

Choose a reason for hiding this comment

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

lgtm

@elezar elezar merged commit 2d7b236 into NVIDIA:main May 21, 2024
8 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.

2 participants