firecracker-microvm / firecracker-microvm/firecracker-containerd

Shim Connect method returns VM-internal information

Open
#210 4 comments 0 reactions 0 assignees View on GitHub
area/runtime
Dominant language
Go
Stars
2.9k
Forks
247
PR merge metrics
No merged PRs in 30d

Description

The `Connect` method served by a v2 runtime service is supposed to provide the Shim's PID and a given Task's PID.

Right now, our host-side runtime shim just forwards the request to the VM Agent, so the results returned are specific to the VM, which is a bit surprising for a caller outside the VM to receive (they can't really do much with a PID that exists inside the VM): https://github.com/firecracker-microvm/firecracker-containerd/blob/c0abc8b8ec0d6045f0ed72b2513e9dea13d213c7/runtime/service.go#L938-L950

At the time of this writing, the `Connect` API doesn't appear to be exposed to containerd clients; [it does however appear to be used by containerd internally in order to reconnect to a shim after the containerd service restarts](https://github.com/containerd/containerd/blob/bc944553a8f3b113a3769a4e23f39910757079a6/runtime/v2/shim.go#L165).

There needs to be more investigation to determine the proper fix here. I suspect it would make sense to at least return the host-side Shim PID instead of the VM Agent PID, however it's less immediately clear what we should return as the Task PID since there is not a host-side PID for the task. Depending on how containerd ends up actually using that Task PID it may or may not make sense to just return the PID of the VM as the Task PID.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.