google / gvisor-containerd-shim

containerd shim for gVisor
https://gvisor.dev
Apache License 2.0
80 stars 28 forks source link

Add containerd shim v2 support. #13

Closed Random-Liu closed 5 years ago

Random-Liu commented 5 years ago

For #1.

The shim v2 binary name is containerd-shim-runsc-v1.

Containerd 1.2

To use containerd-shim-runsc-v1:

[plugins.cri.containerd.runtimes.runsc]
  runtime_type = "io.containerd.runsc.v1"

A config.toml can be put in the runtime root (/run/containerd/runsc by default) to set runtime-handler specific options for containerd-shim-runsc-v1. An example of /run/containerd/runsc/config.toml:

[runsc_config]
  debug = "true"
  debug-log = "/tmp/runsc-logs/runsc.log.%ID%.%TIMESTAMP%.%COMMAND%"
  user-log = "/tmp/runsc-logs/runsc.log.%ID%.user"

Containerd 1.3+

The containerd config to use containrd-shim-runsc-v1 is the same with containerd 1.2.

Containerd 1.3+ explicitly added config file support to configure runtime-handler specific options:

[plugins.cri.containerd.runtimes.runsc.options]
  TypeUrl = "io.containerd.runsc.v1.options"
  ConfigPath = "/somewhere/config.toml"

I'll send a follow-up PR to update the document.

Random-Liu commented 5 years ago

Please note that this PR also ported the fixes https://github.com/containerd/containerd/commit/18f57e20b0800fd7501c4e7abfba788792813f8c#diff-2775e018eedd9942bc5c2c3c7f9039a8 and https://github.com/containerd/containerd/commit/18f57e20b0800fd7501c4e7abfba788792813f8c#diff-2775e018eedd9942bc5c2c3c7f9039a8.

Random-Liu commented 5 years ago

Merging based on https://github.com/google/gvisor-containerd-shim/pull/13#pullrequestreview-197368396.