提交 1ac122a9 编写于 作者: R Renaud Gaubert

Add support for 18.09.1

上级 95836f33
......@@ -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"
......
From e2f8af42d9d0f8d7afc236323994a9ebe6bb0c3b Mon Sep 17 00:00:00 2001
From: Felix Abecassis <fabecassis@nvidia.com>
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 <fabecassis@nvidia.com>
---
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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册