Skip to content

Commit

Permalink
Register container name with kernel before Loader.createContainerProc…
Browse files Browse the repository at this point in the history
…ess().

Loader.createContainerProcess() => createDeviceFiles() calls
devutil.GoferClientFromContext() when using nvidia-container-runtime-hook.
devutil.GoferClientFromContext() expects `Kernel.containerNames` map to be
initialized with the current container's ID -> name mapping.

However, for sub-containers we were not initializing this map before
Loader.createContainerProcess(). This change fixes that. We hadn't hit this yet
because we never had multi-container usages of nvidia-container-runtime-hook.

Updates #10997

PiperOrigin-RevId: 683256638
  • Loading branch information
ayushr2 authored and gvisor-bot committed Oct 7, 2024
1 parent 1ea84d6 commit 0fae509
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion runsc/boot/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -1023,6 +1023,7 @@ func (l *Loader) startSubcontainer(spec *specs.Spec, conf *config.Config, cid st
}

containerName := l.registerContainerLocked(spec, cid)
l.k.RegisterContainerName(cid, containerName)
info := &containerInfo{
cid: cid,
containerName: containerName,
Expand Down Expand Up @@ -1091,7 +1092,6 @@ func (l *Loader) startSubcontainer(spec *specs.Spec, conf *config.Config, cid st
})
}

l.k.RegisterContainerName(cid, info.containerName)
l.k.StartProcess(ep.tg)
// No more failures from this point on.
cu.Release()
Expand Down

0 comments on commit 0fae509

Please sign in to comment.