Skip to content

Conversation

@ArangoGutierrez
Copy link
Collaborator

@ArangoGutierrez ArangoGutierrez commented Sep 19, 2025

Since we have introduced drop-in configs renaming Config option to the TopLevelConfig improves readability.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements drop-in configuration file support for NVIDIA Container Toolkit, enabling containerized environments to write NVIDIA-specific runtime configurations to separate drop-in files instead of modifying main configuration files directly.

  • Adds drop-in config file support for containerd and CRI-O container runtimes
  • Introduces a new engine.Config abstraction that separates source and destination configurations
  • Updates test cases to validate both top-level and drop-in configuration file handling

Reviewed Changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pkg/config/engine/engine.go Introduces defaultRuntimesGetter interface to narrow function dependencies
pkg/config/engine/config.go New abstraction for source/destination config separation
pkg/config/engine/containerd/containerd.go Implements drop-in config support with import management
pkg/config/engine/containerd/config_drop_in.go New drop-in config wrapper with import path management
pkg/config/engine/crio/crio.go Updates CRI-O config to use source/destination pattern
cmd/nvidia-ctk-installer/container/runtime/runtime.go Adds drop-in config path validation and default values
Multiple test files Updated test expectations for drop-in configuration behavior

Comment on lines 73 to 74
// TODO: Only do this if we've actually modified the config.
if err := c.topLevelConfig.flush(); err != nil {
Copy link

Copilot AI Sep 19, 2025

Choose a reason for hiding this comment

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

The TODO comment indicates that the top-level config is always flushed, even when unchanged. This could cause unnecessary file I/O operations. Consider implementing a change tracking mechanism to only flush when the config has been modified.

Copilot uses AI. Check for mistakes.
opts.ExecutablePath = ""
}
if opts.DropInConfig != "" && opts.DropInConfig != runtimeSpecificDefault {
logger.Warningf("Ignorining drop-in-config=%q flag for %v", opts.DropInConfig, opts.RuntimeName)
Copy link

Copilot AI Sep 19, 2025

Choose a reason for hiding this comment

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

There's a typo in the warning message. 'Ignorining' should be 'Ignoring'.

Suggested change
logger.Warningf("Ignorining drop-in-config=%q flag for %v", opts.DropInConfig, opts.RuntimeName)
logger.Warningf("Ignoring drop-in-config=%q flag for %v", opts.DropInConfig, opts.RuntimeName)

Copilot uses AI. Check for mistakes.
@ArangoGutierrez ArangoGutierrez self-assigned this Sep 19, 2025
@ArangoGutierrez ArangoGutierrez added this to the v1.18.0 milestone Sep 19, 2025
@elezar elezar force-pushed the dropins_ctk_installer_defaults branch from 531c96e to bf68dc3 Compare September 19, 2025 12:45
@ArangoGutierrez ArangoGutierrez marked this pull request as ready for review September 19, 2025 12:51
@elezar elezar force-pushed the dropins_ctk_installer_defaults branch from bf68dc3 to 58356af Compare September 19, 2025 12:52
This change renames the Config struct member to TopLevelConfigPath.
This aids readability and better distinguishes between the top-level
config file and a drop-in config file.

Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
@elezar elezar force-pushed the dropins_ctk_installer_defaults branch from 58356af to 4a56d13 Compare September 19, 2025 12:58
@elezar elezar changed the title [no-relnote] Add Drop-in ctk installer default paths [no-relnote] Rename Config to TopLevelConfigPath Sep 19, 2025
@elezar elezar merged commit c3f5ed2 into NVIDIA:main Sep 19, 2025
16 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