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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This document describes how to install and run containerd-shim-runsc-v1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
[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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we make this use a release when we have it available?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, added a TODO.
} | ||
cmd := exec.Command(self, args...) | ||
cmd.Dir = cwd | ||
cmd.Env = append(os.Environ(), "GOMAXPROCS=2") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should have a comment as to why it's here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where are you setting the default path to the shim config?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default is empty string, means no special config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's have an issue for this in gVisor (I believe it's not supported per container yet)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should just be a == I think. Currently it shows an error in travis
if [ "${INSTALL_LATEST}" == "1" ]; then
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
} | ||
else | ||
{ # Step 1(dev): Build and install gvisor-containerd-shim and containerd-shim-runsc-v1 | ||
make |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
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.toml
can be put in the runtime root (/run/containerd/runsc
by 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-v1
is 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.