Add containerd shim v2 support.#13
Conversation
Signed-off-by: Lantao Liu <lantaol@google.com>
ce31f39 to
37e687c
Compare
Signed-off-by: Lantao Liu <lantaol@google.com>
37e687c to
41a8b59
Compare
|
Please note that this PR also ported the fixes containerd/containerd@18f57e2#diff-2775e018eedd9942bc5c2c3c7f9039a8 and containerd/containerd@18f57e2#diff-2775e018eedd9942bc5c2c3c7f9039a8. |
8a8b7c7 to
09ea670
Compare
Signed-off-by: Lantao Liu <lantaol@google.com>
09ea670 to
5ccc68b
Compare
ianlewis
left a comment
There was a problem hiding this comment.
LGTM
Please address comments as best as possible before merging
| @@ -0,0 +1,187 @@ | |||
| # Runtime Handler Quickstart (Shim V2) | |||
|
|
|||
| This document describes how to install and run the `containerd-shim-runsc-v1` | |||
There was a problem hiding this comment.
This document describes how to install and run containerd-shim-runsc-v1
|
|
||
| [embedmd]:# (../test/e2e/shim-install.sh shell /{ # Step 1\(dev\)/ /^}/) | ||
| ```shell | ||
| { # Step 1(dev): Build and install gvisor-containerd-shim and containerd-shim-runsc-v1 |
There was a problem hiding this comment.
Should we make this use a release when we have it available?
| } | ||
| cmd := exec.Command(self, args...) | ||
| cmd.Dir = cwd | ||
| cmd.Env = append(os.Environ(), "GOMAXPROCS=2") |
There was a problem hiding this comment.
This should have a comment as to why it's here.
There was a problem hiding this comment.
This is from the containerd-shim, and this is to minimize the resource usage of the shim.
I want to avoid unnecessary diff with upstream containerd-shim :)
| default: | ||
| return nil, errors.Errorf("unsupported option type") | ||
| } | ||
| if path != "" { |
There was a problem hiding this comment.
Where are you setting the default path to the shim config?
There was a problem hiding this comment.
The default is empty string, means no special config.
There was a problem hiding this comment.
The description says it's /run/containerd/runsc but I missed where this was being set.
Is the config.toml that gets set there per container or per sandbox?
| } | ||
|
|
||
| func (s *service) Stats(ctx context.Context, r *taskAPI.StatsRequest) (*taskAPI.StatsResponse, error) { | ||
| // TODO(random-liu): Use `runsc events --stats`. |
There was a problem hiding this comment.
Let's have an issue for this in gVisor (I believe it's not supported per container yet)
test/e2e/shim-install.sh
Outdated
| @@ -6,22 +6,20 @@ set -ex | |||
|
|
|||
| # Build gvisor-containerd-shim | |||
| if [ "${INSTALL_LATEST}" === "1" ]; then | |||
There was a problem hiding this comment.
This should just be a == I think. Currently it shows an error in travis
if [ "${INSTALL_LATEST}" == "1" ]; then
| } | ||
| else | ||
| { # Step 1(dev): Build and install gvisor-containerd-shim and containerd-shim-runsc-v1 | ||
| make |
There was a problem hiding this comment.
Is there a good way to check as part of the test that it's actually using the v2 shim as opposed to the v1 without just trusting that the config.toml is correct?
Maybe just something like this?
ps aux | grep containerd-shim-runsc-v1
Not sure it needs to be in the quick start, but it would be nice to have as part of the test script.
|
Merging based on #13 (review). |
For #1.
The shim v2 binary name is
containerd-shim-runsc-v1.Containerd 1.2
To use
containerd-shim-runsc-v1:A
config.tomlcan be put in the runtime root (/run/containerd/runscby default) to set runtime-handler specific options forcontainerd-shim-runsc-v1.An example of
/run/containerd/runsc/config.toml:Containerd 1.3+
The containerd config to use
containrd-shim-runsc-v1is the same with containerd 1.2.Containerd 1.3+ explicitly added config file support to configure runtime-handler specific options:
I'll send a follow-up PR to update the document.