{"action":"created","issue":{"url":"https://api.github.com/repos/kata-containers/runtime/issues/485","repository_url":"https://api.github.com/repos/kata-containers/runtime","labels_url":"https://api.github.com/repos/kata-containers/runtime/issues/485/labels{/name}","comments_url":"https://api.github.com/repos/kata-containers/runtime/issues/485/comments","events_url":"https://api.github.com/repos/kata-containers/runtime/issues/485/events","html_url":"https://github.com/kata-containers/runtime/issues/485","id":341414997,"node_id":"MDU6SXNzdWUzNDE0MTQ5OTc=","number":485,"title":"Implement containerd shim v2 API for Kata Containers","user":{"login":"gnawux","id":54124,"node_id":"MDQ6VXNlcjU0MTI0","avatar_url":"https://avatars0.githubusercontent.com/u/54124?v=4","gravatar_id":"","url":"https://api.github.com/users/gnawux","html_url":"https://github.com/gnawux","followers_url":"https://api.github.com/users/gnawux/followers","following_url":"https://api.github.com/users/gnawux/following{/other_user}","gists_url":"https://api.github.com/users/gnawux/gists{/gist_id}","starred_url":"https://api.github.com/users/gnawux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gnawux/subscriptions","organizations_url":"https://api.github.com/users/gnawux/orgs","repos_url":"https://api.github.com/users/gnawux/repos","events_url":"https://api.github.com/users/gnawux/events{/privacy}","received_events_url":"https://api.github.com/users/gnawux/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-07-16T07:31:02Z","updated_at":"2018-07-16T15:03:26Z","closed_at":null,"author_association":"MEMBER","body":"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.\r\n\r\n## Current kata & containerd working pattern\r\n\r\nRight now, containerd and runtime work in the following pattern:\r\n\r\n![containerd-kata-shimv1](https://user-images.githubusercontent.com/54124/42746640-62634562-890b-11e8-9a20-c648400b029d.png)\r\n\r\nWhenever containerd tries to create a container, \r\n\r\n- It creates a containerd-shim\r\n- The containerd-shim call runtime cli -- the cli is specified by the `runtime=kata` flag, and the cli should be compatible with runc\r\n- The containerd-shim served at the address specified by containerd, and feedback events to containerd’s listening address\r\n\r\nThough the containerd-shim designed to be an replaceable component\r\n\r\n- There still has to be one containerd shim per container (or process?)\r\n\r\n## Benefits from shim v2 API\r\n\r\nWith the proposed shim v2 API, the most significant change is\r\n\r\n- The shim will write the serving address back to containerd through stdout, instead of specified by containerd\r\n\r\nAs a result\r\n\r\n- We may replace the containerd-shim with a customized shim, and don’t need to implement a runc compatible CLI for containerd-shim.\r\n- We may use a single shim for a couple of containers, such as one shim per pod\r\n\r\nThen the architecture may change to the follows:\r\n\r\n![containerd-shimv2-per-pod](https://user-images.githubusercontent.com/54124/42746721-d280b23a-890b-11e8-902e-df0d0eb61fd3.png)\r\n\r\n- One shim for containerd per pod\r\n- No proxies and kata-shim processes any more\r\n\r\nAnd in v2 API, stats function is moved to shim, which makes the shim more self-contained.\r\n\r\n## Where we start\r\n\r\n- This routing pattern (built-in proxy + built-in shim) has already been implemented in hyperhq/hyperd#727 \r\n- The OCI Spec processing part exists in kata runtime\r\n- And the other stuff could reference the current kata-shim and v2 shim PR (containerd/containerd#2434).\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/kata-containers/runtime/issues/comments/405278106","html_url":"https://github.com/kata-containers/runtime/issues/485#issuecomment-405278106","issue_url":"https://api.github.com/repos/kata-containers/runtime/issues/485","id":405278106,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNTI3ODEwNg==","user":{"login":"bergwolf","id":88972,"node_id":"MDQ6VXNlcjg4OTcy","avatar_url":"https://avatars0.githubusercontent.com/u/88972?v=4","gravatar_id":"","url":"https://api.github.com/users/bergwolf","html_url":"https://github.com/bergwolf","followers_url":"https://api.github.com/users/bergwolf/followers","following_url":"https://api.github.com/users/bergwolf/following{/other_user}","gists_url":"https://api.github.com/users/bergwolf/gists{/gist_id}","starred_url":"https://api.github.com/users/bergwolf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bergwolf/subscriptions","organizations_url":"https://api.github.com/users/bergwolf/orgs","repos_url":"https://api.github.com/users/bergwolf/repos","events_url":"https://api.github.com/users/bergwolf/events{/privacy}","received_events_url":"https://api.github.com/users/bergwolf/received_events","type":"User","site_admin":false},"created_at":"2018-07-16T15:03:26Z","updated_at":"2018-07-16T15:03:26Z","author_association":"MEMBER","body":"@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."}}
{"actor":{"display_login":"bergwolf"}}