Repository navigation
feat(nvidia): exposing nvidia container runtime config in nodeadm config - #2875
Conversation
e7b4da9 to
ab906a6
Compare
mselim00
left a comment
There was a problem hiding this comment.
lgtm, thanks 🙌
just some minor notes, up to you if you think they're worth addressing or not
| if _, err := os.Stat(runtimeBinaryPath); err != nil { | ||
| if len(userConfig) > 0 { |
There was a problem hiding this comment.
nit: not a fan of duplicating this check (duplicate)
but I can see the motivation with keeping this separate from the containerd config "mixin." ok with leaving it as is since it's small enough, or maybe extracting it into a util under internal/pkg?
| // ship their own config that we don't want to lose. The original is restored | ||
| // once the user config is removed. | ||
| func updateConfig(configPath string, userConfig api.NvidiaContainerRuntimeConfig) error { | ||
| originalConfigPath := configPath + ".orig" |
There was a problem hiding this comment.
nit: this seems like it should be a dotfile
| originalConfigPath := configPath + ".orig" | |
| originalConfigPath := path.Join(path.Dir(configPath), "."+path.Base(configPath)+".orig") |
or just hardcode /etc/nvidia-container-runtime/.config.toml.orig in the const block since it's a fixed path
There was a problem hiding this comment.
Not in a dotfile, since this is primarily an implementation detail and not a config. I can do a hardcoded const though
There was a problem hiding this comment.
the dotfile approach is the same one vi uses for backup, it creates a temp file named .<filename>.swp
Issue #, if available:
#2861
Description of changes:
Adds
spec.nvidiaContainerRuntime.config, an inline TOML document thatnodeadmmerges into/etc/nvidia-container-runtime/config.toml. Customers can set any NVIDIA Container Toolkit option, such as :The setting is opt-in with no defaults, so nodes that don't use it keep the toolkit's shipped file untouched. On AMIs without the NVIDIA container runtime the setting is ignored with a warning.
Since user data can be modified on a stopped instance,
nodeadmneeds a baseline to merge back from in case the customer later unsets properties in theirnodeadmspec. So the first timenodeadmchanges the file, it saves the shipped version as.config.toml.origand merges the user config over that copy on every boot. Properties removed from the spec then revert, and removing the field entirely restores the original file. The baseline is the node's own file rather than the toolkit's defaults, so settings a custom AMI ships are kept.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Testing Done
config.toml.NVIDIA_VISIBLE_DEVICES, whilenvidia.com/gpupods still can.