Skip to content

Conversation

@elezar
Copy link
Member

@elezar elezar commented Sep 19, 2025

This change adds support for drop-in files in a container. Here the user needs to set RUNTIME_DROP_IN_CONFIG_HOST_PATH in addition to RUNTIME_DROP_IN_CONFIG. In this case when updating the top-level containerd config, the imports will use the host path instead of the container path.

@elezar elezar added this to the v1.18.0 milestone Sep 19, 2025
@ArangoGutierrez ArangoGutierrez self-requested a review September 19, 2025 13:25
@elezar elezar force-pushed the drop-in-in-container branch 2 times, most recently from cd51b1e to 71a4612 Compare September 19, 2025 14:14
@elezar elezar linked an issue Sep 19, 2025 that may be closed by this pull request
This change adds support for drop-in files in a container. Here
the user needs to set RUNTIME_DROP_IN_CONFIG_HOST_PATH in addition
to RUNTIME_DROP_IN_CONFIG. In this case when updating the top-level
containerd config, the imports will use the host path instead of the
container path.

Signed-off-by: Evan Lezar <[email protected]>
@elezar elezar force-pushed the drop-in-in-container branch from 71a4612 to 0f11fb2 Compare September 19, 2025 14:23
@coveralls
Copy link

Pull Request Test Coverage Report for Build 17861099938

Details

  • 13 of 42 (30.95%) changed or added relevant lines in 5 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.05%) to 36.259%

Changes Missing Coverage Covered Lines Changed/Added Lines %
cmd/nvidia-ctk-installer/container/runtime/runtime.go 0 7 0.0%
pkg/config/engine/containerd/option.go 0 9 0.0%
pkg/config/engine/containerd/config_drop_in.go 4 17 23.53%
Totals Coverage Status
Change from base Build 17861009052: -0.05%
Covered Lines: 4813
Relevant Lines: 13274

💛 - Coveralls

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 adds support for drop-in configuration files when running in a container environment by allowing users to specify both container and host paths for drop-in configs. This enables correct path mapping when updating top-level containerd configurations that need to reference host-relative paths.

  • Introduces a new RUNTIME_DROP_IN_CONFIG_HOST_PATH environment variable and corresponding CLI flag
  • Adds path mapping functionality to translate container paths to host paths in configuration imports
  • Updates the containerd config builder to accept and use container-to-host path mappings

Reviewed Changes

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

Show a summary per file
File Description
pkg/config/engine/containerd/option.go Adds new builder field and option function for container-to-host path mapping
pkg/config/engine/containerd/containerd.go Updates config creation to pass path mapping to NewConfigWithDropIn
pkg/config/engine/containerd/config_drop_in.go Implements path translation logic for import patterns and adds host path mapping methods
cmd/nvidia-ctk-installer/container/runtime/runtime.go Adds new CLI flag for drop-in config host path
cmd/nvidia-ctk-installer/container/runtime/containerd/containerd.go Integrates path mapping into runtime config creation logic
cmd/nvidia-ctk-installer/container/runtime/containerd/config_test.go Adds test case to verify host path mapping functionality
cmd/nvidia-ctk-installer/container/container.go Adds DropInConfigHostPath field to Options struct

Comment on lines +133 to +141
func (c *topLevelConfig) asHostPath(path string) string {
if c.containerToHostPathMap == nil {
return path
}
if hostPath, ok := c.containerToHostPathMap[path]; ok {
return hostPath
}
return path
}
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.

[nitpick] This function performs exact path matching only. Consider if prefix matching would be more robust for nested paths within mapped directories, or document that only exact directory matches are supported.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

@ArangoGutierrez ArangoGutierrez left a comment

Choose a reason for hiding this comment

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

First pass looks good, or maybe my eyes are tired.
LGTM
I'll give the next round early on Monday

Copy link
Collaborator

@ArangoGutierrez ArangoGutierrez left a comment

Choose a reason for hiding this comment

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

Let's get this in so we can test it on NVIDIA/gpu-operator#1710

@elezar elezar merged commit b3ce3a4 into NVIDIA:main Sep 22, 2025
16 checks passed
@elezar elezar deleted the drop-in-in-container branch September 22, 2025 15:35
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.

Use drop-in files to configure containerd or cri-o

3 participants