Commit graph

44 commits

Author SHA1 Message Date
John Howard
5207ff7202 Windows: Plumb through user
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-11-08 17:41:56 -08:00
Tonis Tiigi
37a3be2449 Move stdio attach from libcontainerd backend to callback
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-10-24 00:20:36 -07:00
Tonis Tiigi
6d26464502 Fix issues with fifos blocking on open
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-10-20 17:02:02 -07:00
John Howard
e736b9a172 Merge pull request #27310 from swernli/servicing-error-reporting
Fixing error reporting on servicing failure
2016-10-12 08:47:54 -07:00
Stefan J. Wernli
f65647463e Fixing error reporting on servicing failure
The code that handles waiting for the servicing container to complete correctly grabs the exit code and logs a failure, but doesn't return that failure to the caller, mistakenly causing servicing operations to look successful when they really failed during processing.

Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
2016-10-11 17:11:56 -07:00
Tonis Tiigi
606a245d85 Remove restartmanager from libcontainerd
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-10-07 12:09:54 -07:00
Darren Stahl
267c04aa36 Revendor hcsshim to v0.5.1
Signed-off-by: Darren Stahl <darst@microsoft.com>
2016-10-05 14:40:51 -07:00
John Howard
02309170a5 Remove hacked Windows OCI spec, compile fixups
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-09-27 12:07:35 -07:00
Sebastiaan van Stijn
221d4fca0c Merge pull request #26796 from Microsoft/jjh/race-lcd-si
Windows: Data race in libcontainerd (si)
2016-09-22 19:44:17 +02:00
John Howard
c2499dff64 Windows: Data race in libcontainerd (si)
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-09-21 14:36:51 -07:00
Darren Stahl
f6d5f7b975 Revert the fix to invalid handles due to a platform bug
Signed-off-by: Darren Stahl <darst@microsoft.com>
2016-09-20 17:31:24 -07:00
John Howard
4348878242 Merge pull request #25849 from darrenstahlmsft/LibcontainerdRaces
Lock all calls to hcsshim to prevent close races
2016-09-20 10:34:54 -07:00
Sebastiaan van Stijn
8c508ef813 Merge pull request #26579 from Microsoft/jjh/ociprocess
Windows: OCI `process` struct and console size to uint
2016-09-19 22:52:16 +02:00
Darren Stahl
740e26f384 Lock all calls to hcsshim to prevent close races
Signed-off-by: Darren Stahl <darst@microsoft.com>
2016-09-19 12:59:02 -07:00
John Howard
53774423ff Windows: OCI process struct convergence
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-09-19 10:34:31 -07:00
John Howard
72de562943 Windows: Remove osversion from OCI
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-09-19 10:16:15 -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
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
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
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
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
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
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
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
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
Brian Goff
bcf0c8ca28 Merge pull request #23142 from Microsoft/ExtraCleanup
Windows: Remove a double free on hcs container handle
2016-06-01 11:09:06 -04:00
Vincent Demeester
c7aba69cc1 Merge pull request #22989 from Microsoft/StartCleanup
Windows: Adding missing cleanup call when container start fails
2016-06-01 15:42:47 +02:00
Darren Stahl
c8454394f7 Windows: Remove a double free on hcs container handle
Signed-off-by: Darren Stahl <darst@microsoft.com>
2016-05-31 10:25:38 -07:00
Darren Stahl
054992e291 Windows: Adding missing cleanup call when container start fails
Signed-off-by: Darren Stahl <darst@microsoft.com>
2016-05-31 10:19:05 -07:00
Darren Stahl
717209c9ff Fix a leaked process handle of the first container to start on Windows
Signed-off-by: Darren Stahl <darst@microsoft.com>
2016-05-25 21:33:50 -07:00
John Starks
6508c015fe Windows: Use image version, not OS version for TTY fixup
A previous change added a TTY fixup for stdin on older Windows versions to
work around a Windows issue with backspace/delete behavior. This change
used the OS version to determine whether to activate the behavior.
However, the Windows bug is actually in the image, not the OS, so it
should have used the image's OS version.

This ensures that a Server TP5 container running on Windows 10 will have
reasonable console behavior.

Signed-off-by: John Starks <jostarks@microsoft.com>
2016-05-25 12:22:52 -07:00
Darren Stahl
959c1a52bf Change Docker to use the new HCS RPC API
Signed-off-by: Darren Stahl <darst@microsoft.com>
2016-05-24 16:36:51 -07:00
John Starks
f124829c9b Windows: Work around Windows BS/DEL behavior
In Windows containers in TP5, DEL is interpreted as the delete key, but
Linux generally interprets it as backspace. This prevents backspace from
working when using a Linux terminal or the native console terminal
emulation in Windows.

To work around this, translate DEL to BS in Windows containers stdin when
TTY is enabled. Do this only for builds that do not have the fix in
Windows itself.

Signed-off-by: John Starks <jostarks@microsoft.com>
2016-05-20 19:04:20 -07:00
Stefan J. Wernli
a5b64f2847 Fixing Windows update logic.
Removing the call to Shutdown from within Signal in order to rely on waitExit handling the exit of the process.

Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
2016-05-12 17:45:53 -07:00
John Howard
feacb1205b Windows: Terminate on failed shutdown
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-05-10 10:09:50 -07:00
Stefan J. Wernli
da92dad59f Adding servicing update to postRunProcessing for Windows containers.
This change enables the workflow of finishing installing Windows OS updates in the container after it has completed running, via a special servicing container.

Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
2016-04-25 12:16:26 -07:00
Michael Crosby
b6db56b5eb Reset restart timeout if execution longer than 10s
Restore the 1.10 logic that will reset the restart manager's timeout or
backoff delay if a container executes longer than 10s reguardless of
exit status or policy.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-04-22 10:37:34 -07:00
John Howard
d691b4af18 Windows: Timeout TestContainerApiPostContainerStop
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-04-12 18:21:54 -07:00
Zhang Wei
51e42e6ee0 Fix ShouldRestart for on-failure handle
Currently if you restart docker daemon, all the containers with restart
policy `on-failure` regardless of its `RestartCount` will be started,
this will make daemon cost more extra time for restart.

This commit will stop these containers to do unnecessary start on
daemon's restart.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-04-10 15:44:47 +08:00
Stefan J. Wernli
818a5198e4 Adding postRunProcessing infrastructure for hanlding Windows Update.
Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
2016-04-06 14:03:05 -07:00
John Howard
94d70d8355 Windows libcontainerd implementation
Signed-off-by: John Howard <jhoward@microsoft.com>
Signed-off-by: John Starks <jostarks@microsoft.com>
Signed-off-by: Darren Stahl <darst@microsoft.com>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-03-18 13:38:41 -07:00