Commit graph

238 commits

Author SHA1 Message Date
Tonis Tiigi
4e262f6387 Fix race on sending stdin close event
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-11-21 17:43:01 -08:00
Darren Stahl
8b50324273 Shutdown instead of terminate process on Windows
Signed-off-by: Darren Stahl <darst@microsoft.com>
2016-11-18 12:05:08 -08:00
Akshay Karle
2d08a76421 fix a typo
Signed-off-by: Akshay Karle <akshay.a.karle@gmail.com>
2016-11-17 16:51:37 -05:00
Victor Vieux
0427afa409 Merge pull request #27955 from mlaventure/runc-docker-info
Add external binaries version to docker info
2016-11-10 21:27:14 -08:00
Darren Stahl
0ed00b36ff Adding more strict resource checks on Windows
Signed-off-by: Darren Stahl <darst@microsoft.com>
2016-11-09 16:29:54 -08:00
Victor Vieux
f67d4b897a Merge pull request #28184 from Microsoft/jjh/user
Windows: Plumb through user
2016-11-09 11:32:42 -08:00
Kenfe-Mickael Laventure
2790ac68b3 Add expected 3rd party binaries commit ids to info
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-11-09 07:42:44 -08:00
Darren Stahl
ae35c0f70e Stop returning errors that should be ignored while closing stdin
Signed-off-by: Darren Stahl <darst@microsoft.com>
2016-11-08 18:25:43 -08:00
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
ee9d28bd3f Don’t warn on missing fifo
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-11-08 09:59:49 -08:00
Amit Krishnan
934328d8ea Add functional support for Docker sub commands on Solaris
Signed-off-by: Amit Krishnan <krish.amit@gmail.com>

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2016-11-07 09:06:34 -08:00
Darren Stahl
4e15420b9b Windows: Add cpu count option
Signed-off-by: Darren Stahl <darst@microsoft.com>
2016-11-04 13:38:50 -07:00
Yanqiang Miao
1ad989559f Clean up the constants in 'libcontainerd' that are no longer in use
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>

update

Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
2016-10-28 13:39:04 +08:00
Tonis Tiigi
aa01ee4ac5 Fix logging formatting
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-10-25 18:34:35 -07: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
6f2658fb8c Refactor stdin closing
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-10-20 17:10:15 -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
Antonio Murdaca
1808348136
record pid of exec'd process
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-10-20 17:06:11 +02:00
Jonh Wendell
e03bf1221e Exec: Add ability to set environment variables
Keeping the current behavior for exec, i.e., inheriting
variables from main process. New variables will be added
to current ones. If there's already a variable with that
name it will be overwritten.

Example of usage: docker exec -it -e TERM=vt100 <container> top

Closes #24355.

Signed-off-by: Jonh Wendell <jonh.wendell@redhat.com>
2016-10-19 12:39:25 -02:00
Sebastiaan van Stijn
dd383898cd Merge pull request #26795 from darrenstahlmsft/PauseResume
Implement Pause Resume support for Windows
2016-10-13 18:08:11 -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
Darren Stahl
69985e85d3 Implement Pause Resume support for Windows
Signed-off-by: Darren Stahl <darst@microsoft.com>
2016-10-11 16:23:35 -07:00
Justin Cormack
d316e172da Merge pull request #26690 from mwhudson/ignore-oom_score_adj-failure
Ignore failure to set oom_score_adj, as happens in an unprivileged container.
2016-10-11 10:01:22 +01:00
Tonis Tiigi
606a245d85 Remove restartmanager from libcontainerd
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-10-07 12:09:54 -07:00
Vincent Demeester
b3cc3d7bf9 Merge pull request #23389 from Microsoft/jjh/credentialspec
Windows: Support credential specs
2016-10-07 18:32:44 +02:00
John Howard
e85867cb68 Windows: Support credential specs
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-10-06 09:32:22 -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
Alexander Morozov
33ae7d4c19 Merge pull request #27149 from swernli/servicing_fix
Fixing servicing bug by always specifying LayerFolderPath
2016-10-05 13:21:47 -07:00
Michael Crosby
214b70e6ef Merge pull request #27038 from jstarks/non_base_utilityvm
Windows: support Windows servicing layers
2016-10-05 10:02:31 -07:00
Brian Goff
c48317ad7c Merge pull request #27152 from darrenstahlmsft/Rounding
Windows: fix rounding error in container resources
2016-10-04 21:08:14 -04:00
Stefan J. Wernli
78540d0d18 Fixing servicing bug by always specifying LayerFolderPath
During the recent OCI changes, I mistakenly thought LayerFolderPath is only needed for Windows Server containers (isolation=process) and not for Hyper-V Containers, but it turns out it is also required for servicing containers used to finish installing updates.  Since the servicing containers need to reuse the container's create options, this change makes it so that LayerFolderPath is always filled in for all containers as part of constructing the create options.

Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
2016-10-04 15:29:30 -07:00
Darren Stahl
1b48203f17 Windows: fix rounding error in container resources
Signed-off-by: Darren Stahl <darst@microsoft.com>
2016-10-04 14:11:32 -07:00
allencloud
5143be0ccf add lock in libcontainerd client AddProcess of Windows
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-10-04 10:29:21 +08:00
allencloud
278273bc16 add lock in libcontainerd client AddProcess
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-10-02 00:36:25 +08:00
John Starks
2a765279fa Windows: Use the top-most utility VM image
Microsoft will be distributing non-base layers that have utility VM image
updates. Update libcontainerd to use the top-most utility VM image that is
available in the image chain when launching Hyper-V-isolated container.

Signed-off-by: John Starks <jostarks@microsoft.com>
2016-09-29 10:49:02 -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
Victor Vieux
f67096c20b Merge pull request #26744 from LK4D4/attach_before_start
libcontainerd: attach streams before create
2016-09-26 13:08:05 -07:00
msabansal
d1e0a78614 Changes required to support windows service discovery
Signed-off-by: msabansal <sabansal@microsoft.com>
2016-09-22 12:21:21 -07:00
John Howard
dc8631ea53 Merge pull request #26677 from Microsoft/jjh/networkendpointlist
Windows OCI: Remove endpoint list
2016-09-22 11:36:25 -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
410a8612f4 Windows OCI: Remove endpoint list
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-09-22 10:08:13 -07:00
Michael Crosby
3990f28162 Merge pull request #26746 from Microsoft/jjh/hvruntime
Windows: OCI HVRuntime and LayerPaths to options
2016-09-22 09:55:58 -07: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
Alexander Morozov
02d1934279 libcontainerd: attach streams before create
Fix #26371

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2016-09-21 09:16:12 -07:00
Michael Hudson-Doyle
9ed54d3c67 add log messages when write to oom_score_adj fails
Signed-off-by: Michael Hudson-Doyle <michael.hudson@canonical.com>
2016-09-21 19:36:36 +12: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
Vincent Demeester
758a809f54 Merge pull request #26538 from LK4D4/update_grpc
Update grpc to v1.0.1-GA
2016-09-20 23:19:26 +02:00
John Howard
a3aceeac50 Windows: OCI HVRuntime and LayerPaths to options
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-09-20 13:51:53 -07:00
Tõnis Tiigi
511fd49402 Merge pull request #26641 from Microsoft/jjh/aggressivenamespacing
Windows: OCI aggressive namespacing
2016-09-20 13:37:41 -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
Alexander Morozov
5fb3832432 libcontainerd: do not use failfast for events stream
New grpc uses failfast by default, but that code was written with other
default in mind, so just preserve it for now.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2016-09-20 09:24:40 -07:00
John Howard
bbbc720620 Oops, break should have been continue
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-09-19 14:41:27 -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
Brian Goff
b7e189ed1f Merge pull request #26640 from Microsoft/jjh/removeosversion
Windows: Remove osversion from OCI
2016-09-19 15:42:34 -04: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
c89db6c044 Windows: OCI aggressive namespacing
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-09-19 10:23:11 -07:00
Kenfe-Mickaël Laventure
3fd3d28f5f Merge pull request #26505 from Microsoft/jjh/ocistep1
Windows OCI convergence step 1
2016-09-19 10:23:11 -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
Tõnis Tiigi
b72c7f74a6 Merge pull request #26577 from Microsoft/jjh/fstabmount
Windows: Move to fstab options as per OCI
2016-09-19 10:13:46 -07:00
Akihiro Suda
69f00a137c Fix a race in libcontainerd/pausemonitor_linux.go
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2016-09-19 07:42:21 +00:00
Michael Hudson-Doyle
32f24bc3c5 Ignore failure to set oom_score_adj, as happens in an unprivileged container.
Signed-off-by: Michael Hudson-Doyle <michael.hudson@canonical.com>
2016-09-19 14:27:10 +12:00
Brian Goff
bc60f5af84 Merge pull request #26650 from Microsoft/jjh/firststart
Windows: OCI remove first start
2016-09-18 09:27:10 -04:00
Brian Goff
112ba3637d Merge pull request #26578 from Microsoft/jjh/ociuser
Windows: Unify OCI user struct
2016-09-18 09:20:45 -04:00
John Howard
f7fd408ba7 Windows: OCI remove first start
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-09-16 16:05:55 -07:00
John Howard
340e5233b2 Windows: stats support
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-09-16 11:56:15 -07:00
John Howard
bb585b9c10 Windows: Move to fstab options as per OCI
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-09-15 10:12:20 -07:00
John Howard
93f61b85eb Windows: Unify OCI user struct
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-09-15 09:59:27 -07:00
John Howard
7c7c3d7746 Windows OCI convergence step 1
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-09-12 16:11:47 -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