This repository was archived by the owner on May 12, 2021. It is now read-only.
  
  
  - 
                Notifications
    
You must be signed in to change notification settings  - Fork 369
 
    This repository was archived by the owner on May 12, 2021. It is now read-only.
  
  
Implement containerd shim v2 API for Kata Containers #485
Copy link
Copy link
Closed
Description
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,
- It creates a containerd-shim
 - The containerd-shim call runtime cli -- the cli is specified by the 
runtime=kataflag, and the cli should be compatible with runc - The containerd-shim served at the address specified by containerd, and feedback events to containerd’s listening address
 
Though the containerd-shim designed to be an replaceable component
- There still has to be one containerd shim per container (or process?)
 
Benefits from shim v2 API
With the proposed shim v2 API, the most significant change is
- The shim will write the serving address back to containerd through stdout, instead of specified by containerd
 
As a result
- We may replace the containerd-shim with a customized shim, and don’t need to implement a runc compatible CLI for containerd-shim.
 - We may use a single shim for a couple of containers, such as one shim per pod
 
Then the architecture may change to the follows:
- One shim for containerd per pod
 - No proxies and kata-shim processes any more
 
And in v2 API, stats function is moved to shim, which makes the shim more self-contained.
Where we start
- This routing pattern (built-in proxy + built-in shim) has already been implemented in A draft commit of Kata support hyperhq/hyperd#727
 - The OCI Spec processing part exists in kata runtime
 - And the other stuff could reference the current kata-shim and v2 shim PR (Runtime v2 (shim API) containerd/containerd#2434).
 
thaJeztah, resouer and renzhengeek

