-
Notifications
You must be signed in to change notification settings - Fork 18.9k
daemon: use shim v2 by default #41115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
thaJeztah
left a comment
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.
left some suggestions
0ba160c to
cbd6907
Compare
|
I think we need to revisit how we are handling this. I would prefer to rely on the containerd config for this. Packagers can set the preferred runtime configuration in the containerd packaging, or rely on containerd's default. |
No, containerd daemon doesn't have any concept of "default runtime".
Yes, but it is a separate topic. |
|
Right, the default is determined by the client.
But I can create and run a container without manually specifying a runtime.
What I'm really getting at, is all the extra env var and function arguments to determine which shim to use does not seem right.
We should be able to change the default and if someone wants something different they should be able to configure that in the runtime config.
|
|
Discussed on the maintainers call with @thaJeztah and @tonistiigi I think we agreed it would be best to remove all the configuration we have regarding v1 vs v2 shim. Just use the v2 shim only, and then we can follow up by allowing the |
containerd has three shim binaries: * containerd-shim: implements shim API v1. * containerd-shim-runc-v1: implements shim API v2. Introduced in containerd v1.2. * containerd-shim-runc-v2: implements shim API v2. Introduced in containerd v1.3. We have been using containerd-shim on cgroup v1 mode, containerd-shim-runc-v2 on cgroup v2 mode. This commit changes the daemon to use containerd-shim-runc-v2 by default regardless to the cgroup mode. To provide a workaround for potential regression issues, the daemon supports switching back to shim v1 mode via an env var `MOBY_DISABLE_SHIM_V2=1`. The env var is only intended to be used as a workaround and is deprecated from its birth. (So there is no daemon.json flag and no output in `docker info`) Fix moby#41107 Needs containerd v1.3.0 or later. v1.3.5 or later is recommended. Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
|
Ready for review/merge |
Did you want that in this PR? Looks like the current implementation still adds the env-var |
I interpreted |
I was referring to the env var to disable, and passing bools around on what shim to use. |
|
Don't we need to provide a workaround for potential regression? |
|
The work-around would be to allow configuring it at the runtime level. |
|
What is runtime level? |
|
dockerd has a config for custom runtimes, and users can specify which runtime with |
|
If we are confident that shim v2 is already matured enough, we can go ahead without any rollback knob. |
|
@AkihiroSuda I don't think we're mixing anything up here. |
|
Discussing in the maintainers meeting with @cpuguy83 @tonistiigi.
@cpuguy83 wants to have a look at a runtime option; if that works out, I'd say wait with merging until we have the alternative |
The previous default runtime `io.containerd.runtime.v1.linux` is being deprecated (containerd/containerd#4365) `io.containerd.runc.v2` is available since containerd v1.3.0. Using v1.3.5 or later is recommended. v1.3.0-v1.3.4 doesn't pass `TestContainerStartOnDaemonRestart`. Fix moby#41107 Replace moby#41115 Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
|
new PR: #41210 |
- What I did
containerd has three shim binaries:
We have been using containerd-shim on cgroup v1 mode, containerd-shim-runc-v2 on cgroup v2 mode.
This commit changes the daemon to use containerd-shim-runc-v2 by default regardless to the cgroup mode.
To provide a workaround for potential regression issues, the daemon supports switching back to shim v1 mode via an env var
MOBY_DISABLE_SHIM_V2=1.The env var is only intended to be used as a workaround and is deprecated from its birth.
(So there is no daemon.json flag and no output in
docker info)The env var is discarded on cgroup v2 hosts, as shim v1 does not support cgroup v2.
Fix #41107
- How I did it
Updated
*Daemon.useShimV2()to use shim v2 by default.Requires containerd v1.3.0 or later. Using v1.3.5 or later is recommended. v1.3.0-v1.3.4 doesn't pass
TestContainerStartOnDaemonRestartdue to lack of containerd/containerd#4329 .- How to verify it
containerd-shim-runc-v2processes are launched.containerd-shimby launchingdockerdwithMOBY_DISABLE_SHIM_V2=1.- Description for the changelog
daemon: use shim v2 by default. Requires containerd v1.3.0 or later. Using v1.3.5 or later is recommended.
- A picture of a cute animal (not mandatory but encouraged)
🐧