-
Notifications
You must be signed in to change notification settings - Fork 374
Implement containerd shim v2 API for Kata Containers #485
Comments
This is a good proposal, and simplifies the architecture a lot! One question: I think we need to keep the compatibility with older containerd-shim, we can't only support containerd-shim V2 because it's so new. |
@WeiZhang555 I agree we should keep the runc compatible cli as long as possible. For this new shim, IMO it should have its own repo so that in future we can push it to containerd to be a first class citizen there. |
As said during the Arch committee meeting, I would like to see the Kata implementation of the containerd-shim v2 as a separate directory (different repo might come further down the road, but right now, let's keep this simple). The same way we have the |
Looks good! |
And as @crosbymichael described in the Arch Committee meeting, containerd-shim-v2 isn't aware of POD concept, so the containerd-shim should be one per container, so I think the final arch should be: Is this right? @gnawux |
@WeiZhang555 we investigated the APIs and code in the PR and has the following conclusion -- though containerd will request shim service for every container, it does not expect there is a new shim socket or process for the container. As a result, we think it could be implemented as one shim per pod. Let's just try to prove it with a prototype. |
@WeiZhang555 Per discussions in containerd/containerd/issues/2426, |
Oh, cool, this sounds a little hacky but workable. |
Yes, that is correct. We updated the v2 API to introduce a |
I pushed an README this morning for shim authoring. Please take a look and provide any feedback if you have questions or if something does not make sense. https://github.com/containerd/containerd/pull/2434/files#diff-9bb937a499e2e6fdc4536481d6315c50 |
thank you @crosbymichael. One more question -- is it essential for a v2shim commandline to implement the "no action" behavior default:
client := NewShimClient(ctx, service, signals)
return client.Serve() or it's ok to support |
If you want to split it into multiple binaries then that is fine, all we care about is that |
[Update] A temporary branch has been created in develop repo here. Will send out PRs to upstream when core apis are ready so you can set up basic tests. |
@grahamwhaley Oh, yes. The link I posted seems to be the merged PRs to that branch :/ |
Looking forward to the implement ! |
regroup the imported modules according the projects they belonged to. Fixes: kata-containers#485 Signed-off-by: fupan <[email protected]>
In order to get rid of the confusion with shim's api version, rename kata shimv2's shim to containerd-shim-kata-v2, here the "v2" means the api version instead of the binary shim's version. For the cri plugin, please set runtime_type as: io.containerd.kata.v2 Fixes: kata-containers#485 Signed-off-by: fupan <[email protected]>
regroup the imported modules according the projects they belonged to. Fixes: kata-containers#485 Signed-off-by: fupan <[email protected]>
In order to get rid of the confusion with shim's api version, rename kata shimv2's shim to containerd-shim-kata-v2, here the "v2" means the api version instead of the binary shim's version. For the cri plugin, please set runtime_type as: io.containerd.kata.v2 Fixes: kata-containers#485 Signed-off-by: fupan <[email protected]>
regroup the imported modules according the projects they belonged to. Fixes: kata-containers#485 Signed-off-by: fupan <[email protected]>
In order to get rid of the confusion with shim's api version, rename kata shimv2's shim to containerd-shim-kata-v2, here the "v2" means the api version instead of the binary shim's version. For the cri plugin, please set runtime_type as: io.containerd.kata.v2 Fixes: kata-containers#485 Signed-off-by: fupan <[email protected]>
If the networkNs hasn't been created, created it here. Fixes: kata-containers#485 Signed-off-by: fupan <[email protected]>
kata has moved running network hooks from virtcontainer to cli, thus it's needed to running those hooks in shimv2 also. Fixes: kata-containers#485 Signed-off-by: fupan <[email protected]>
regroup the imported modules according the projects they belonged to. Fixes: kata-containers#485 Signed-off-by: fupan <[email protected]>
If the networkNs hasn't been created, created it here. Fixes: kata-containers#485 Signed-off-by: fupan <[email protected]>
Replace the vci APIs with the sandbox apis. Fixes: kata-containers#485 Signed-off-by: fupan <[email protected]>
refactor the codes based on the katautils pkg, and rename the directory as containerd-shim-v2. Fixes: kata-containers#485 Signed-off-by: fupan <[email protected]>
Replace the vci APIs with the sandbox apis. Fixes: kata-containers#485 Signed-off-by: fupan <[email protected]>
refactor the codes based on the katautils pkg, and rename the directory as containerd-shim-v2. Fixes: kata-containers#485 Signed-off-by: fupan <[email protected]>
Replace the vci APIs with the sandbox apis. Fixes: kata-containers#485 Signed-off-by: fupan <[email protected]>
Add the Makefile target of building shimv2. Fixes: kata-containers#485 Signed-off-by: fupan <[email protected]>
Add the Makefile target of building shimv2. Fixes: kata-containers#485 Signed-off-by: fupan <[email protected]>
Add the Makefile target of building shimv2. Fixes: kata-containers#485 Signed-off-by: fupan <[email protected]>
Add the Makefile target of building shimv2. Fixes: kata-containers#485 Signed-off-by: fupan <[email protected]>
Add the Makefile target of building shimv2. Fixes: kata-containers#485 Signed-off-by: fupan <[email protected]>
Add the Makefile target of building shimv2. Fixes: kata-containers#485 Signed-off-by: fupan <[email protected]>
Add the Makefile target of building shimv2. Fixes: kata-containers#485 Signed-off-by: fupan <[email protected]>
Add the Makefile target of building shimv2. Fixes: kata-containers#485 Signed-off-by: fupan <[email protected]>
Add the Makefile target of building shimv2. Fixes: kata-containers#485 Signed-off-by: fupan <[email protected]>
Add the Makefile target of building shimv2. Fixes: kata-containers#485 Signed-off-by: fupan <[email protected]>
Add the Makefile target of building shimv2. Fixes: kata-containers#485 Signed-off-by: fupan <[email protected]>
Add the Makefile target of building shimv2. Fixes: kata-containers#485 Signed-off-by: fupan <[email protected]>
Add the Makefile target of building shimv2. Fixes: kata-containers#485 Signed-off-by: fupan <[email protected]>
Add the Makefile target of building shimv2. Fixes: kata-containers#485 Signed-off-by: fupan <[email protected]>
Add the Makefile target of building shimv2. Fixes: kata-containers#485 Signed-off-by: fupan <[email protected]>
Add the Makefile target of building shimv2. Fixes: kata-containers#485 Signed-off-by: fupan <[email protected]>
Add the Makefile target of building shimv2. Fixes: kata-containers#485 Signed-off-by: fupan <[email protected]>
Add the Makefile target of building shimv2. Fixes: kata-containers#485 Signed-off-by: fupan <[email protected]>
Add the Makefile target of building shimv2. Fixes: kata-containers#485 Signed-off-by: fupan <[email protected]>
Add the Makefile target of building shimv2. Fixes: kata-containers#485 Signed-off-by: fupan <[email protected]>
This version of vsock fully supports Go 1.12 runtime network poller integration, and is complaint with net.Listener and net.Conn as checked by golang.org/x/net/nettest. Fixes kata-containers#485. Signed-off-by: Matt Layher <[email protected]>
In the arch committee meeting last week, Michael Crosby introduced the containerd shim API v2. After the meeting, read related documents, patches, and discussed with @bergwolf @lifupan and related folks. And I think we could begin to implement the kata shim for containerd v2 API now.
Current kata & containerd working pattern
Right now, containerd and runtime work in the following pattern:
Whenever containerd tries to create a container,
runtime=kata
flag, and the cli should be compatible with runcThough the containerd-shim designed to be an replaceable component
Benefits from shim v2 API
With the proposed shim v2 API, the most significant change is
As a result
Then the architecture may change to the follows:
And in v2 API, stats function is moved to shim, which makes the shim more self-contained.
Where we start
The text was updated successfully, but these errors were encountered: