Add nvidia gpu support via libnvidia-container
This adds nvidia gpu support via the libnvidia-container project and `nvidia-container-cli`. Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
@@ -31,7 +31,7 @@ import (
|
||||
|
||||
var ociHook = cli.Command{
|
||||
Name: "oci-hook",
|
||||
Usage: "provides a base for OCI runtime hooks that allow arguements to be templated.",
|
||||
Usage: "provides a base for OCI runtime hooks to allow arguments to be injected.",
|
||||
Action: func(context *cli.Context) error {
|
||||
state, err := loadHookState(os.Stdin)
|
||||
if err != nil {
|
||||
@@ -70,6 +70,7 @@ func newTemplateContext(state *specs.State) *templateContext {
|
||||
"rootfs": t.rootfs,
|
||||
"pid": t.pid,
|
||||
"annotation": t.annotation,
|
||||
"status": t.status,
|
||||
}
|
||||
return t
|
||||
}
|
||||
@@ -99,6 +100,10 @@ func (t *templateContext) annotation(k string) string {
|
||||
return t.state.Annotations[k]
|
||||
}
|
||||
|
||||
func (t *templateContext) status() string {
|
||||
return t.state.Status
|
||||
}
|
||||
|
||||
func render(ctx *templateContext, source string, out io.Writer) error {
|
||||
t, err := template.New("oci-hook").Funcs(ctx.funcs).Parse(source)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user