Expand description

A library to implement custom runtime v2 shims for containerd.

Runtime

Runtime v2 introduces a first class shim API for runtime authors to integrate with containerd. The shim API is minimal and scoped to the execution lifecycle of a container.

This crate simplifies shim v2 runtime development for containerd. It handles common tasks such as command line parsing, setting up shim’s TTRPC server, logging, events, etc.

Clients are expected to implement Shim and Task traits with task handling routines. This generally replicates same API as in Go version.

Once implemented, shim’s bootstrap code is as easy as:

shim::run::<Service>("io.containerd.empty.v1")

Modules

Macros

  • Logs a message at the debug level.
  • Logs a message at the error level.
  • Logs a message at the info level.
  • Logs a message at the warn level.

Structs

  • Helper structure that wraps atomic bool to signal shim server when to shutdown the TTRPC server.

Traits

  • Main shim interface that must be implemented by all shims.

Functions

  • Shim entry point that must be invoked from main.
  • Spawn is a helper func to launch shim process. Typically this expected to be called from StartShim.