From eb2aec9da87efa05eafc4314bdf8e378ab1f7831 Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Thu, 9 Mar 2023 12:25:05 +0200 Subject: [PATCH 1/3] Allow CDI options to be set by envvars Signed-off-by: Evan Lezar --- tools/container/toolkit/toolkit.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/container/toolkit/toolkit.go b/tools/container/toolkit/toolkit.go index e1ffb716..80f81737 100644 --- a/tools/container/toolkit/toolkit.go +++ b/tools/container/toolkit/toolkit.go @@ -168,12 +168,14 @@ func main() { Usage: "the directory where the CDI output files are to be written. If this is set to '', no CDI specification is generated.", Value: "/var/run/cdi", Destination: &opts.cdiOutputDir, + EnvVars: []string{"CDI_OUTPUT_DIR"}, }, &cli.StringFlag{ Name: "cdi-kind", Usage: "the vendor string to use for the generated CDI specification", Value: "management.nvidia.com/gpu", Destination: &opts.cdiKind, + EnvVars: []string{"CDI_KIND"}, }, } From 5ee040ba956cdb35397128737a47a36fa31047cc Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Thu, 9 Mar 2023 12:25:18 +0200 Subject: [PATCH 2/3] Disable CDI spec generation for integration tests --- test/container/containerd_test.sh | 5 +++-- test/container/docker_test.sh | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/test/container/containerd_test.sh b/test/container/containerd_test.sh index ea03f77a..48b00347 100755 --- a/test/container/containerd_test.sh +++ b/test/container/containerd_test.sh @@ -52,8 +52,9 @@ testing::containerd::toolkit::run() { --volumes-from "${containerd_dind_ctr}" \ -v "${shared_dir}/etc/containerd/config_${version}.toml:${containerd_dind_containerd_dir}/containerd.toml" \ --pid "container:${containerd_dind_ctr}" \ - -e "RUNTIME=containerd" \ - -e "RUNTIME_ARGS=--config=${containerd_dind_containerd_dir}/containerd.toml --socket=${containerd_dind_containerd_dir}/containerd.sock" \ + -e RUNTIME="containerd" \ + -e RUNTIME_ARGS="--config=${containerd_dind_containerd_dir}/containerd.toml --socket=${containerd_dind_containerd_dir}/containerd.sock" \ + -e CDI_OUTPUT_DIR="" \ --name "${containerd_test_ctr}" \ "${toolkit_container_image}" "/usr/local/nvidia" "--no-daemon" diff --git a/test/container/docker_test.sh b/test/container/docker_test.sh index 6d66adbe..b314c8c0 100755 --- a/test/container/docker_test.sh +++ b/test/container/docker_test.sh @@ -38,7 +38,8 @@ testing::docker::toolkit::run() { docker run -d --rm --privileged \ --volumes-from "${docker_dind_ctr}" \ --pid "container:${docker_dind_ctr}" \ - -e "RUNTIME_ARGS=--socket ${docker_dind_socket}" \ + -e RUNTIME_ARGS="--socket ${docker_dind_socket}" \ + -e CDI_OUTPUT_DIR="" \ --name "${docker_test_ctr}" \ "${toolkit_container_image}" "/usr/local/nvidia" "--no-daemon" From 25ea7fa98e3c6b2e199ab2e52253c7ddc3ce2f16 Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Thu, 9 Mar 2023 15:31:49 +0200 Subject: [PATCH 3/3] Remove whitespace in Makefile Signed-off-by: Evan Lezar --- build/container/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/container/Makefile b/build/container/Makefile index 789365e2..3f5ebd3c 100644 --- a/build/container/Makefile +++ b/build/container/Makefile @@ -50,7 +50,7 @@ META_TARGETS := packaging BUILD_TARGETS := $(patsubst %,build-%,$(DISTRIBUTIONS) $(META_TARGETS)) PUSH_TARGETS := $(patsubst %,push-%,$(DISTRIBUTIONS) $(META_TARGETS)) -TEST_TARGETS := $(patsubst %,test-%, $(DISTRIBUTIONS)) +TEST_TARGETS := $(patsubst %,test-%,$(DISTRIBUTIONS)) .PHONY: $(DISTRIBUTIONS) $(PUSH_TARGETS) $(BUILD_TARGETS) $(TEST_TARGETS)