From 083b789102012a5fcf7b322fa62f5ac6bfd3fdbc Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Thu, 22 Jun 2023 14:50:47 +0200 Subject: [PATCH 1/4] Use cdi parser package for IsQualiedName Signed-off-by: Evan Lezar --- internal/info/auto.go | 2 +- internal/modifier/cdi.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/info/auto.go b/internal/info/auto.go index 396d127b..2b7794fa 100644 --- a/internal/info/auto.go +++ b/internal/info/auto.go @@ -19,7 +19,7 @@ package info import ( "github.com/NVIDIA/nvidia-container-toolkit/internal/config/image" "github.com/NVIDIA/nvidia-container-toolkit/internal/logger" - "github.com/container-orchestrated-devices/container-device-interface/pkg/cdi" + cdi "github.com/container-orchestrated-devices/container-device-interface/pkg/parser" "gitlab.com/nvidia/cloud-native/go-nvlib/pkg/nvlib/info" ) diff --git a/internal/modifier/cdi.go b/internal/modifier/cdi.go index eba2d6f0..4578534e 100644 --- a/internal/modifier/cdi.go +++ b/internal/modifier/cdi.go @@ -24,7 +24,7 @@ import ( "github.com/NVIDIA/nvidia-container-toolkit/internal/config/image" "github.com/NVIDIA/nvidia-container-toolkit/internal/logger" "github.com/NVIDIA/nvidia-container-toolkit/internal/oci" - cdi "github.com/container-orchestrated-devices/container-device-interface/pkg/cdi" + "github.com/container-orchestrated-devices/container-device-interface/pkg/cdi" "github.com/opencontainers/runtime-spec/specs-go" ) From b2126722e563ea86ae35123376631fbb539df6ed Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Thu, 22 Jun 2023 14:51:34 +0200 Subject: [PATCH 2/4] Update vendoring Signed-off-by: Evan Lezar --- go.sum | 2 -- 1 file changed, 2 deletions(-) diff --git a/go.sum b/go.sum index c4bcb615..70d00f16 100644 --- a/go.sum +++ b/go.sum @@ -5,8 +5,6 @@ github.com/NVIDIA/go-nvml v0.12.0-1 h1:6mdjtlFo+17dWL7VFPfuRMtf0061TF4DKls9pkSw6 github.com/NVIDIA/go-nvml v0.12.0-1/go.mod h1:hy7HYeQy335x6nEss0Ne3PYqleRa6Ct+VKD9RQ4nyFs= github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= -github.com/container-orchestrated-devices/container-device-interface v0.5.4-0.20230111111500-5b3b5d81179a h1:sP3PcgyIkRlHqfF3Jfpe/7G8kf/qpzG4C8r94y9hLbE= -github.com/container-orchestrated-devices/container-device-interface v0.5.4-0.20230111111500-5b3b5d81179a/go.mod h1:xMRa4fJgXzSDFUCURSimOUgoSc+odohvO3uXT9xjqH0= github.com/container-orchestrated-devices/container-device-interface v0.6.0 h1:aWwcz/Ep0Fd7ZuBjQGjU/jdPloM7ydhMW13h85jZNvk= github.com/container-orchestrated-devices/container-device-interface v0.6.0/go.mod h1:OQlgtJtDrOxSQ1BWODC8OZK1tzi9W69wek+Jy17ndzo= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= From 481000b4cec35b29aeb85ea0243fbf44a34c387d Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Thu, 22 Jun 2023 15:37:36 +0200 Subject: [PATCH 3/4] Remove unused argument Signed-off-by: Evan Lezar --- internal/runtime/runtime_factory.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/runtime/runtime_factory.go b/internal/runtime/runtime_factory.go index 9832fd66..2ff3a1f5 100644 --- a/internal/runtime/runtime_factory.go +++ b/internal/runtime/runtime_factory.go @@ -44,7 +44,7 @@ func newNVIDIAContainerRuntime(logger logger.Interface, cfg *config.Config, argv return nil, fmt.Errorf("error constructing OCI specification: %v", err) } - specModifier, err := newSpecModifier(logger, cfg, ociSpec, argv) + specModifier, err := newSpecModifier(logger, cfg, ociSpec) if err != nil { return nil, fmt.Errorf("failed to construct OCI spec modifier: %v", err) } @@ -61,7 +61,7 @@ func newNVIDIAContainerRuntime(logger logger.Interface, cfg *config.Config, argv } // newSpecModifier is a factory method that creates constructs an OCI spec modifer based on the provided config. -func newSpecModifier(logger logger.Interface, cfg *config.Config, ociSpec oci.Spec, argv []string) (oci.SpecModifier, error) { +func newSpecModifier(logger logger.Interface, cfg *config.Config, ociSpec oci.Spec) (oci.SpecModifier, error) { rawSpec, err := ociSpec.Load() if err != nil { return nil, fmt.Errorf("failed to load OCI spec: %v", err) @@ -73,7 +73,7 @@ func newSpecModifier(logger logger.Interface, cfg *config.Config, ociSpec oci.Sp } mode := info.ResolveAutoMode(logger, cfg.NVIDIAContainerRuntimeConfig.Mode, image) - modeModifier, err := newModeModifier(logger, mode, cfg, ociSpec, argv) + modeModifier, err := newModeModifier(logger, mode, cfg, ociSpec) if err != nil { return nil, err } @@ -106,7 +106,7 @@ func newSpecModifier(logger logger.Interface, cfg *config.Config, ociSpec oci.Sp return modifiers, nil } -func newModeModifier(logger logger.Interface, mode string, cfg *config.Config, ociSpec oci.Spec, argv []string) (oci.SpecModifier, error) { +func newModeModifier(logger logger.Interface, mode string, cfg *config.Config, ociSpec oci.Spec) (oci.SpecModifier, error) { switch mode { case "legacy": return modifier.NewStableRuntimeModifier(logger, cfg.NVIDIAContainerRuntimeHookConfig.Path), nil From 3c9d95c62f1a45532f9324ed84e0cdbd35e64169 Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Tue, 18 Jul 2023 12:03:44 +0200 Subject: [PATCH 4/4] Fix usage string in CLI Signed-off-by: Evan Lezar --- cmd/nvidia-ctk/cdi/generate/generate.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/nvidia-ctk/cdi/generate/generate.go b/cmd/nvidia-ctk/cdi/generate/generate.go index 00f8e4b5..24ad57a4 100644 --- a/cmd/nvidia-ctk/cdi/generate/generate.go +++ b/cmd/nvidia-ctk/cdi/generate/generate.go @@ -130,7 +130,7 @@ func (m command) build() *cli.Command { }, &cli.StringSliceFlag{ Name: "csv.file", - Usage: "The path to the list of CSV files to use when generating the CDI specification in CDI mode.", + Usage: "The path to the list of CSV files to use when generating the CDI specification in CSV mode.", Value: cli.NewStringSlice(csv.DefaultFileList()...), Destination: &opts.csv.files, },