-
Notifications
You must be signed in to change notification settings - Fork 18.7k
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
Containerd 1.0 client #34895
Containerd 1.0 client #34895
Conversation
667a411
to
cd4a2d0
Compare
cd4a2d0
to
ff82e26
Compare
cmd/dockerd/daemon_unix.go
Outdated
libcontainerd.WithOOMScore(cli.Config.OOMScoreAdjust), | ||
libcontainerd.WithPlugin("linux", &linux.Config{ | ||
Shim: fmt.Sprintf("%s", daemon.DefaultShimBinary), |
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.
Maybe planned clean-up, but extra Sprintf
|
||
// DefaultRuntimeName is the default runtime to be used by | ||
// containerd if none is specified | ||
DefaultRuntimeName = "docker-runc" |
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.
How differs from DefaultRuntimeBinary?
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 the name used for the --runtime option map
@@ -56,6 +51,21 @@ func (daemon *Daemon) FillPlatformInfo(v *types.Info, sysInfo *sysinfo.SysInfo) | |||
v.RuncCommit.ID = "N/A" | |||
} | |||
|
|||
v.ContainerdCommit.Expected = dockerversion.ContainerdCommitID | |||
if rv, err := exec.Command("docker-containerd", "--version").Output(); err == nil { |
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.
Can we let docker-containerd --version
print JSON?
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.
That's a request for https://github.com/containerd/containerd ;-)
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.
opened containerd/containerd#1561
@@ -1448,7 +1449,7 @@ func (s *DockerDaemonSuite) TestCleanupMountsAfterDaemonAndContainerKill(c *chec | |||
c.Assert(strings.Contains(string(mountOut), id), check.Equals, true, comment) | |||
|
|||
// kill the container | |||
icmd.RunCommand(ctrBinary, "--address", "unix:///var/run/docker/libcontainerd/docker-containerd.sock", "containers", "kill", id).Assert(c, icmd.Success) | |||
icmd.RunCommand(ctrBinary, "--address", "/var/run/docker/containerd/docker-containerd.sock", "--namespace", "docker", "tasks", "kill", id).Assert(c, icmd.Success) |
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.
namespace: docker
-> moby
? moby-core
?
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.
@mlaventure maybe put "docker"
in a variable so we can change it easily.
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.
Will do, will call the namespace moby too while at it.
libcontainerd/remote_daemon.go
Outdated
defer func() { | ||
if err != nil { | ||
err = errors.Wrap(err, "Failed to connect to containerd. "+ | ||
"Please make sure containerd is installed in your PATH or that you have specified the correct address.") |
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.
containerd
-> value of binaryName
?
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.
If using an already running containerd, that value might be wrong
ff82e26
to
177235a
Compare
pkg/signal/trap.go
Outdated
@@ -58,6 +59,9 @@ func Trap(cleanup func(), logger interface { | |||
logger.Info("Forcing docker daemon shutdown without cleanup; 3 interrupts received") | |||
} | |||
case syscall.SIGQUIT: | |||
logger.Info("Kill USR1 docker-containerd") | |||
exec.Command("pkill", "-USR1", "docker-c").Run() | |||
<-time.After(500 * time.Millisecond) |
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.
Leftover debug code?
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.
Not really, in general we want both together
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 seems like the wrong place to implement this logic. pkg/signal
shouldn't really know about the binary names.
I think Trap()
needs to be refactored to accept a function to call when it receives SIGQUIT
.
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.
Oh, completely forgot it was inside pkg/trap
. Will remove it for now.
a4b39a9
to
263d181
Compare
Those errors are fixed when upgrading the kernel pass 3.13, could we upgrade CI to something a bit more recent? The lts kernel in trusty is 4.4.0 now (cc @andrewhsu) |
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.
I'm ok that an upgrade breaks people who have live-restore on the previous version, while this has generally worked in the past it really should never be a guarantee.... people consuming moby will need to make sure to handle this properly.
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
89d90b3
to
617f89b
Compare
It seems that there are enough LGTMs. Move it to |
ping @crosbymichael |
I think there are several breaking back compatibility. |
@allencloud changing the runtime binary is still supported by containerd 1.0 You will notice that I did not remove any test, and setting the runtime binary is part of them. I've replicated all of the previous features, there should be no regressions normally. If there is, it means we're lacking tests for it. |
LGTM |
Wait; why did Janky show it passed?
|
@thaJeztah from the jenkins-job config, not sure why this is the case: |
The
|
Oh, possibly because those tests are only used in the internal e2e suite, yes. I got confused, was looking why the vendor check didn't fail on this PR (https://github.com/moby/moby/pull/35283/files#r146650223) edit: see @dnephin's comment, our comments just crossed |
- What I did
Replaced containerd v0.2.x with v1.0
- How I did it
Refactored libcontainerd
- How to verify it
CI must be green
- Description for the changelog
Move to containerd v1.0
- A picture of a cute animal (not mandatory but encouraged)
🐼
--
What's not finished
Closes #34662