From 1ac122a9c7b9745749ffa72a1d4f71c70a8a8ab3 Mon Sep 17 00:00:00 2001 From: Renaud Gaubert Date: Mon, 14 Jan 2019 15:56:29 -0800 Subject: [PATCH] Add support for 18.09.1 --- runtime/Makefile | 11 ++-- ...k-nvidia-container-runtime-hook-to-t.patch | 64 +++++++++++++++++++ 2 files changed, 71 insertions(+), 4 deletions(-) create mode 100644 runtime/runc/96ec2177ae841256168fcf76954f7177af9446eb/0001-Add-prestart-hook-nvidia-container-runtime-hook-to-t.patch diff --git a/runtime/Makefile b/runtime/Makefile index 6ed46d6..3842e08 100644 --- a/runtime/Makefile +++ b/runtime/Makefile @@ -12,22 +12,25 @@ DIST_DIR := $(CURDIR)/../dist all: ubuntu18.04 ubuntu16.04 ubuntu14.04 debian9 debian8 centos7 amzn2 amzn1 -ubuntu18.04: $(addsuffix -ubuntu18.04, 18.09.0 18.06.1 18.06.0 18.03.1 17.12.1) +ubuntu18.04: $(addsuffix -ubuntu18.04, 18.09.1 18.09.0 18.06.1 18.06.0 18.03.1 17.12.1) -ubuntu16.04: $(addsuffix -ubuntu16.04, 18.09.0 18.06.1 18.06.0 18.03.1 18.03.0 17.12.1 17.12.0 17.09.1 17.09.0 17.06.2 17.03.2 1.13.1 1.12.6) +ubuntu16.04: $(addsuffix -ubuntu16.04, 18.09.1 18.09.0 18.06.1 18.06.0 18.03.1 18.03.0 17.12.1 17.12.0 17.09.1 17.09.0 17.06.2 17.03.2 1.13.1 1.12.6) ubuntu14.04: $(addsuffix -ubuntu14.04, 18.06.1 18.06.0 18.03.1 18.03.0 17.12.1 17.09.1 17.06.2 17.03.2) -debian9: $(addsuffix -debian9, 18.09.0 18.06.1 18.06.0 18.03.1 18.03.0 17.12.1 17.12.0 17.09.1 17.09.0 17.06.2 17.03.2) +debian9: $(addsuffix -debian9, 18.09.1 18.09.0 18.06.1 18.06.0 18.03.1 18.03.0 17.12.1 17.12.0 17.09.1 17.09.0 17.06.2 17.03.2) debian8: $(addsuffix -debian8, 18.06.1 18.06.0 18.03.1 18.03.0 17.12.1 17.09.1 17.06.2) -centos7: $(addsuffix -centos7, 18.09.0 18.06.1 18.06.0 18.03.1 18.03.0 17.12.1 17.12.0 17.09.1 17.09.0 17.06.2 17.03.2 1.13.1 1.12.6) +centos7: $(addsuffix -centos7, 18.09.1 18.09.0 18.06.1 18.06.0 18.03.1 18.03.0 17.12.1 17.12.0 17.09.1 17.09.0 17.06.2 17.03.2 1.13.1 1.12.6) amzn2: $(addsuffix -amzn2, 18.06.1 18.03.1 17.06.2) amzn1: $(addsuffix -amzn1, 18.06.1 18.03.1 17.12.1 17.09.1 17.06.2 17.03.2) +18.09.1-%-runc: + echo "96ec2177ae841256168fcf76954f7177af9446eb" + 18.09.0-%-runc: echo "4fc53a81fb7c994640722ac585fa9ca548971871" diff --git a/runtime/runc/96ec2177ae841256168fcf76954f7177af9446eb/0001-Add-prestart-hook-nvidia-container-runtime-hook-to-t.patch b/runtime/runc/96ec2177ae841256168fcf76954f7177af9446eb/0001-Add-prestart-hook-nvidia-container-runtime-hook-to-t.patch new file mode 100644 index 0000000..17ed23c --- /dev/null +++ b/runtime/runc/96ec2177ae841256168fcf76954f7177af9446eb/0001-Add-prestart-hook-nvidia-container-runtime-hook-to-t.patch @@ -0,0 +1,64 @@ +From e2f8af42d9d0f8d7afc236323994a9ebe6bb0c3b Mon Sep 17 00:00:00 2001 +From: Felix Abecassis +Date: Wed, 3 Jan 2018 11:50:02 -0800 +Subject: [PATCH] Add prestart hook nvidia-container-runtime-hook to the config + +Signed-off-by: Felix Abecassis +--- + utils.go | 26 ++++++++++++++++++++++++++ + 1 file changed, 26 insertions(+) + +diff --git a/utils.go b/utils.go +index 5165336..5cdd11e 100644 +--- a/utils.go ++++ b/utils.go +@@ -3,6 +3,7 @@ package main + import ( + "fmt" + "os" ++ "os/exec" + "path/filepath" + "strconv" + "strings" +@@ -54,6 +55,26 @@ func fatal(err error) { + os.Exit(1) + } + ++func addNVIDIAHook(context *cli.Context, spec *specs.Spec) error { ++ path, err := exec.LookPath("nvidia-container-runtime-hook") ++ if err != nil { ++ return err ++ } ++ args := []string{path} ++ if context.GlobalBool("debug") { ++ args = append(args, "-debug") ++ } ++ if spec.Hooks == nil { ++ spec.Hooks = &specs.Hooks{} ++ } ++ spec.Hooks.Prestart = append(spec.Hooks.Prestart, specs.Hook{ ++ Path: path, ++ Args: append(args, "prestart"), ++ }) ++ ++ return nil ++} ++ + // setupSpec performs initial setup based on the cli.Context for the container + func setupSpec(context *cli.Context) (*specs.Spec, error) { + bundle := context.String("bundle") +@@ -66,6 +87,11 @@ func setupSpec(context *cli.Context) (*specs.Spec, error) { + if err != nil { + return nil, err + } ++ ++ if err = addNVIDIAHook(context, spec); err != nil { ++ return nil, err ++ } ++ + return spec, nil + } + +-- +2.7.4 + -- GitLab