Commit graph

119 commits

Author SHA1 Message Date
John Howard
f7fd408ba7 Windows: OCI remove first start
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-09-16 16:05:55 -07:00
Alexander Morozov
e4ddcb37c1 libcontainerd: use healthcheck to track containerd conn
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2016-09-12 14:22:38 -07:00
boucher
d8fef66b03 Initial implementation of containerd Checkpoint API.
Signed-off-by: boucher <rboucher@gmail.com>
2016-09-08 21:31:52 -04:00
Brian Goff
4219c0018f Merge pull request #25777 from swernli/servicing_race
Fixing race in Windows container servicing
2016-09-08 10:42:15 -04:00
John Howard
52f0474851 Windows: docker top implementation
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-09-07 16:29:02 -07:00
Matt Richardson
bc8eabce25 Allow windows environment variables to contain =
Fix issue where environment variables with embedded equals signs were
being dropped and not passed to the container.

Fixes #26178.

Signed-off-by: Matt Richardson <matt.richardson@octopus.com>
2016-09-05 08:49:07 +10:00
allencloud
52637848a7 correct some nits in comment and test files
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-08-29 18:37:14 +08:00
John Howard
d56c2ea9ed Fix minor typo
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-08-17 16:10:01 -07:00
Michael Crosby
041e5a21dc Replace old oci specs import with runtime-specs
Fixes #25804

The upstream repo changed the import paths.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-08-17 09:38:34 -07:00
Darren Stahl
c58d0358c3 Revendor hcsshim
Signed-off-by: Darren Stahl <darst@microsoft.com>
2016-08-16 17:28:49 -07:00
Stefan J. Wernli
6591a37aaf Fixing race in Windows container servicing
There exists a race in container servicing on Windows where, during normal operation, the container will begin to shut itself down while docker calls shutdown explicitly.  If the former succeeds just as the latter is attempting to communicate with the container to request the shutdown, an error comes back that can cause the servicing to incorrectly register as a failure.  Instead, we just wait for the servicing container to shutdown on it's own, using a reasonable timeout to allow for merging in the updates.

Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
2016-08-15 14:32:50 -07:00
Sebastiaan van Stijn
92ef3f615a Merge pull request #25505 from darrenstahlmsft/SignalProcessNewAPI
Changed SignalProcess to use new hcsshim API
2016-08-11 23:21:31 +02:00
Alexander Morozov
64605d709f Merge pull request #23951 from allencloud/defer-os-file-close
add defer file.Close to avoid potential fd leak
2016-08-10 11:07:15 -07:00
allencloud
0ead624473 add defer file.Close to avoid potential fd leak
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-08-10 08:36:09 +08:00
Sebastiaan van Stijn
04e021d751 Merge pull request #23391 from Microsoft/WindowsSandboxSize
Windows: Added support for storage-opt size
2016-08-09 15:34:39 +02:00
Darren Stahl
5eaf86c6db Changed SignalProcess to use new hcsshim API
Signed-off-by: Darren Stahl <darst@microsoft.com>
2016-08-08 14:03:12 -07:00
Tõnis Tiigi
6401bd65b1 Merge pull request #25072 from mlaventure/oos-libcontainerd-client
Handle out-of-sync libcontainerd client on restore
2016-08-05 14:23:25 -07:00
Tonis Tiigi
9be0fb45c2 libcontainerd: mark container exited after failed restart
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-08-03 17:44:30 -07:00
Tonis Tiigi
495448b290 libcontainerd: wait for restart after state change
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-08-03 15:28:07 -07:00
Kenfe-Mickael Laventure
51f21a1674 Handle out-of-sync libcontainerd client on restore
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-07-28 11:26:07 -07:00
Michael Crosby
2650b1b6ab Check if the container is running if no event
When there is no event for the container it can happen because of a
crash and the container state on the persistent disk will have a
mismatch between what was in `/run` ( machine crash ).

This situation will create an unkillable container in docker because
containerd does not see it and it is not running but docker thinks it is
and you cannot tell it anything different.

This fixes the issue by checking if containerd has the container running
if we do not have an event instead of just returning.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-07-28 11:17:02 -07:00
Lei Jitang
c75de8e33c Fix daemon panic on restoring containers
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2016-07-26 22:52:52 -04:00
Kenfe-Mickael Laventure
ac068a1f9d Fix missing unlock in libcontainerd.Restore()
This was preventing the "exit" event to be correctly processed during
the restore process without live-restore enabled.

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-07-22 15:21:10 -07:00
Kenfe-Mickael Laventure
5231c55346 Prepend libcontainerd log message with "libcontainerd:"
This will make it easier to pinpoint error messages in the daemon
logs.

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-07-22 15:20:14 -07:00
Kenfe-Mickael Laventure
c02f82756e Update libcontainerd.AddProcess to accept a context
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-07-19 08:24:39 -07:00
Kenfe-Mickael Laventure
64483c3bda Do not rely on "live" event anymore
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-07-19 08:24:39 -07:00
Kenfe-Mickael Laventure
29b2714580 Vendor in new containerd
This version introduces the following:
 - uses nanosecond timestamps for event
 - ensure events are sent once their effect is "live"

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-07-18 11:44:24 -07:00
Tonis Tiigi
0b2023130e Wait for the reader fifo opening to block
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-07-14 10:14:53 -07:00
Antonio Murdaca
0a96ba8a0f Merge pull request #24593 from mlaventure/fix-libcontainerd-data-race
Fix data race in libcontainerd
2016-07-14 17:27:24 +02:00
Kenfe-Mickael Laventure
8e9fbc8f5f Fix data race in libcontainerd
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-07-13 10:04:42 -07:00
Michael Crosby
a894aec8d8 Add --oom-score-adjust to daemon
This adds an `--oom-score-adjust` flag to the daemon so that the value
provided can be set for the docker daemon's process.  The default value
for the flag is -500.  This will allow the docker daemon to have a
less chance of being killed before containers do.  The default value for
processes is 0 with a min/max of -1000/1000.

-500 is a good middle ground because it is less than the default for
most processes and still not -1000 which basically means never kill this
process in an OOM condition on the host machine.  The only processes on
my machine that have a score less than -500 are dbus at -900 and sshd
and xfce( my window manager ) at -1000.  I don't think docker should be
set lower, by default, than dbus or sshd so that is why I chose -500.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-07-12 15:53:15 -07:00
Tibor Vass
efcf24f0c4 Merge pull request #24156 from Microsoft/jjh/clearbasefs
Windows: Clear volume path for Hyper-V containers
2016-07-07 15:35:14 -07:00
Otto Kekäläinen
644a7426cc Fix spelling in comments, strings and documentation
Signed-off-by: Otto Kekäläinen <otto@seravo.fi>
2016-07-03 20:58:11 +03:00
John Howard
fd4f5c2365 Windows: Ensure VolumePath is not set for Hyper-V containers
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-06-29 16:49:09 -07:00
John Starks
8e34322253 Windows: Disable VM cloning for TP5 image
The Windows TP5 image is not compatible with the Hyper-V isolated
container clone feature. Detect old images and pass a flag specifying that
clone should not be enabled.

Signed-off-by: John Starks <jostarks@microsoft.com>
2016-06-24 16:12:44 -07:00
Aaron Lehmann
c9175a6deb Merge pull request #23862 from LK4D4/fix_unused
all: fix usage of some variables
2016-06-23 10:21:10 -07:00
Alexander Morozov
138f9538f3 Merge pull request #23776 from Microsoft/ShutdownError
Windows: Prevent logging errors when shutting down an already shut down container
2016-06-22 12:11:00 -07:00
Alexander Morozov
57e14714ee all: fix usage of some variables
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2016-06-22 10:40:32 -07:00
Darren Stahl
9aa9bda178 Added stateinfo to WaitExit info to aid debugging daemon hangs
Signed-off-by: Darren Stahl <darst@microsoft.com>
2016-06-21 12:41:08 -07:00
Darren Stahl
7e5ee6d176 Windows: Added support for storage-opt size
Signed-off-by: Darren Stahl <darst@microsoft.com>
2016-06-21 10:53:29 -07:00
Darren Stahl
79060e8212 Windows: Prevent logging errors when shutting down an already shut down container
Signed-off-by: Darren Stahl <darst@microsoft.com>
2016-06-20 16:57:08 -07:00
Tibor Vass
a590a6b180 Merge pull request #23532 from swernli/exitCodeFix
Fixing exit code return on error case in Windows.
2016-06-16 19:01:18 -07:00
Stefan J. Wernli
17c1b9c061 Fixing exit code return on error case in Windows.
Right now, if we hit an error retrieving the exit code in HCS process.ExitCode, we return that 0 and that error.  Golang convention says that if an error is returned the other values should not be used, but the caller of ExitCode in libcontainerd has to fall through if an error is received.  Rather than return a success exit code in that failure case, we should return -1 to indicate a generic failure.

Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
2016-06-14 10:19:55 -07:00
Kenfe-Mickael Laventure
7b2e5216b8 Add support for multiples runtimes
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-06-14 07:47:31 -07:00
Michael Crosby
3020081e94 Merge pull request #23213 from crosbymichael/restore-option
Add --live-restore flag
2016-06-13 20:57:19 -07:00
Michael Crosby
d705dab1b1 Add --live-restore flag
This flags enables full support of daemonless containers in docker.  It
ensures that docker does not stop containers on shutdown or restore and
properly reconnects to the container when restarted.

This is not the default because of backwards compat but should be the
desired outcome for people running containers in prod.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-06-13 19:16:26 -07:00
Sebastiaan van Stijn
50c7bcac1e Merge pull request #23443 from swernli/servicing-async
Updating call sequence for servicing Windows containers
2016-06-13 19:49:23 +02:00
Antonio Murdaca
44ccbb317c *: fix logrus.Warn[f]
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-06-11 19:42:38 +02:00
Stefan J. Wernli
f2ad7be2c4 Updating call sequence for servicing Windows containers
This change adjusts the calling pattern for servcing containers to use waiting on the process instead of expecting start to block.  This is safer, as it avoids timeouts in the start code path for the potentially expensive update operation.

Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
2016-06-10 15:19:10 -07:00
Kenfe-Mickael Laventure
64a91ee74e Increase containerd start-timeout to 2 minutes
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
(cherry picked from commit 4251e1e99e)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-06-10 16:22:19 +02:00