Commit Graph

256 Commits

Author SHA1 Message Date
eefbd135ae Remove solaris build tag and `contrib/mkimage/solaris
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 4785f1a7ab7ec857dc3ca849ee6ecadf519ef30e
Component: engine
2017-11-02 00:01:46 +00:00
67f37f6e34 Fixes LCOW after containerd 1.0 introduced regressions
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 71651e0b801ae874b4a899e3c47add9e3fbc2400
Component: engine
2017-10-27 09:55:43 -07:00
044d7f995b Update libcontainerd to use containerd 1.0
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Upstream-commit: ddae20c032058a0fd42c34c2e9750ee8f6296ac8
Component: engine
2017-10-20 07:11:37 -07:00
bb1c0c5aa8 Merge pull request #34846 from Microsoft/jjh/debuggcs
LCOW: Add UVM debugability by grabbing logs before tear-down
Upstream-commit: 7cbbbb95097f065757d38bcccdb1bbef81d10ddb
Component: engine
2017-09-19 22:33:46 +02:00
ddb0ee3757 Revendor Microsoft/opengcs @ v0.3.4
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 2798576b37aa99643a06366f00072b6026c0b77e
Component: engine
2017-09-19 09:56:23 -07:00
aeb89eb179 Volume refactoring for LCOW
Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>
Upstream-commit: e89b6e8c2d2c36c43f22aeaf2a885646c2994051
Component: engine
2017-09-14 12:33:31 -07:00
d011c4127f LCOW: Add GCS debugging
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 5a0e2beac330d49c2b7436bf29e87d52dab4f557
Component: engine
2017-09-13 14:54:34 -07:00
18c29c5c5f Add gosimple linter
Update gometalinter

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: f7f101d57ef8cbf2d8723a18b7d723c5c5dd04b6
Component: engine
2017-09-12 12:09:59 -04:00
8db4d9c803 LCOW: VHDX boot to read-only
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 17a24034bb4281e2b63949beaa5d3846c0891726
Component: engine
2017-09-06 10:55:19 -07:00
8ef302a435 Merge pull request #34625 from dnephin/more-linters
Add interfacer and unconvert linters
Upstream-commit: cb952bf00695b3429476f59c5534a9c604c6f010
Component: engine
2017-09-01 08:46:08 -07:00
2ca5291236 Merge pull request #34356 from mlaventure/update-containerd
Update containerd to 06b9cb35161009dcb7123345749fef02f7cea8e0
Upstream-commit: 285bc997311b75263bfac9e8ff7c4d60cdeca0bc
Component: engine
2017-08-24 14:25:44 -07:00
01392057b0 Add unconvert linter
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 2f5f0af3fdb7e9ee607a0e178dbe2af6e10cccf4
Component: engine
2017-08-24 15:08:31 -04:00
c2a60a890d Merge pull request #34451 from Microsoft/jjh/bootvhdx
LCOW: Additional flags for VHD boot
Upstream-commit: e5cdaf1bd9c5d7984e491cb346ae1453dbb79f50
Component: engine
2017-08-24 08:38:19 -07:00
08c57e48ed Update Windows and LCOW to use v1.0.0 runtime-spec
Signed-off-by: Darren Stahl <darst@microsoft.com>
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Upstream-commit: 7c29103ad9b4e02ecc6cdde01da9c3675a377fc4
Component: engine
2017-08-21 15:19:31 -07:00
6b3b192846 Add goimports to linters.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 372670b5074b077927314cdf46af30f8752e7db0
Component: engine
2017-08-21 18:15:08 -04:00
5305a1cd9e Update containerd to 06b9cb35161009dcb7123345749fef02f7cea8e0
This also update:
 - runc to 3f2f8b84a77f73d38244dd690525642a72156c64
 - runtime-specs to v1.0.0

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Upstream-commit: 45d85c99139bbd16004bbedb7d5bac6a60264538
Component: engine
2017-08-21 12:04:07 -07:00
b9168879f3 jhoward/opengcs --> Microsoft/opengcs
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: ee0587a45d94443271c695a0d407514fd36f7fa4
Component: engine
2017-08-08 14:43:43 -07:00
06000850f0 LCOW: Additional flags for VHD boot
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 71328a7af580050448ba269663e04ff3f67aea72
Component: engine
2017-08-08 14:40:33 -07:00
fae0c281b6 Windows: Add named pipe mount support
Current insider builds of Windows have support for mounting individual
named pipe servers from the host to the guest. This allows, for example,
exposing the docker engine's named pipe to a container.

This change allows the user to request such a mount via the normal bind
mount syntax in the CLI:

  docker run -v \\.\pipe\docker_engine:\\.\pipe\docker_engine <args>

Signed-off-by: John Starks <jostarks@microsoft.com>
Upstream-commit: 54354db850664783918a1fc9d208bcfcf47c28e2
Component: engine
2017-08-07 11:34:36 -07:00
cb0fd7f7e8 LCOW: Remove hard-coding
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: ffdef6255e9c81d5778864cac4726794d7c1be0d
Component: engine
2017-08-03 16:10:25 -07:00
d659edcaf5 Update logrus to v1.0.1
Fixes case sensitivity issue

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
Upstream-commit: 1009e6a40b295187e038b67e184e9c0384d95538
Component: engine
2017-07-31 13:16:46 -07:00
e95f4619cd [project] change syscall to /x/sys/unix|windows
Changes most references of syscall to golang.org/x/sys/
Ones aren't changes include, Errno, Signal and SysProcAttr
as they haven't been implemented in /x/sys/.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>

[s390x] switch utsname from unsigned to signed

per 33267e036f
char in s390x in the /x/sys/unix package is now signed, so
change the buildtags

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
Upstream-commit: 069fdc8a083cb1663e4f86fe3fd9b9a1aebc3e54
Component: engine
2017-07-11 08:00:32 -04:00
7ef86a57f5 Merge pull request #33835 from Microsoft/jjh/changedir
LCOW: Change directory from lcow to "Linux Containers"
Upstream-commit: 359ed993525eecb5009c7be1a48a9d646a9e235f
Component: engine
2017-06-27 09:33:38 +02:00
02efb01414 LCOW: Change to c:\Program Files\Linux Containers
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 2c43cbe0d5132618c74de4631c89c541bbafb8c2
Component: engine
2017-06-26 21:26:18 -07:00
a08baae726 LCOW: pass command arguments without extra quoting
Signed-off-by: John Starks <jostarks@microsoft.com>
Upstream-commit: 19645521a92869be7210fb663ed5e0e82e329ca5
Component: engine
2017-06-24 10:23:17 -07:00
553c4b8a9b Merge pull request #33785 from Microsoft/jjh/hcsschemaupdate
LCOW: Updates necessary due to platform schema change
Upstream-commit: 25a65a185b6b512117803ab25c716ca8f831ccdf
Component: engine
2017-06-23 13:08:13 -07:00
c54a797733 LCOW: Update for platforms latest schema
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 330913cadf1fcca00be4b6b841ceb8d14471f470
Component: engine
2017-06-22 14:07:23 -07:00
bfc36e79fd Merge pull request #33764 from keloyang/fix-queue-mem-leak
Fix mem leak in libcontainerd/queue/append
Upstream-commit: f88626b270827da7e8a2d668dc2e16bbe1ac53f0
Component: engine
2017-06-22 10:57:07 -07:00
e48afa3455 Merge pull request #33774 from Microsoft/jjh/lcow-networking
LCOW: owner and network endpoints
Upstream-commit: c85f92de15d8f7162b7579143d2be74d8453996d
Component: engine
2017-06-22 16:40:50 +02:00
7ccd764533 fix mem leak in libcontainerd/queue/append
Signed-off-by: yangshukui <yangshukui@huawei.com>
Upstream-commit: 5425a5ab842894d7eb7e26bb706a04be40b67075
Component: engine
2017-06-22 16:47:47 +08:00
926eab07b2 Merge pull request #33772 from cpuguy83/optimizations
Don't json marshal then immediately unmarshal
Upstream-commit: 4fc2710dc7a8fc87849e94770fcf33eececae2fc
Component: engine
2017-06-22 01:19:08 -07:00
40224fcf4b LCOW: owner and network endpoints
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: e99a633720563d8d8d2669791cee542c0f989291
Component: engine
2017-06-21 22:35:30 -07:00
f9852d6a7a Don't json marshal then immediately unmarshal
During container startup we end up spending a fair amount of time
encoding/decoding json.
This cuts out some of that since we already have the decoded object in
memory.

The old flow looked like:

1. Start container request
2. Create file
3. Encode container spec to json
4. Write to file
5. Close file
6. Open file
7. Read file
8. Decode container spec
9. Close file
10. Send to containerd.

The new flow cuts out steps 6-9 completely, and with it a lot of time
spent in reflect and file IO.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 8d588d9c5b5cd019e09bcfc4f790eae79405c7b1
Component: engine
2017-06-21 15:18:01 -07:00
01b491fce5 LCOW: Create layer folders with correct ACL
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: ed10ac6ee93cf5c389a735c0c97b08d5d5dff3a9
Component: engine
2017-06-20 19:50:12 -07:00
94ce604e3d LCOW: OCI Spec and Environment for container start
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: f1545882264e743fa6d6859ee8687407e28fc35c
Component: engine
2017-06-20 19:50:11 -07:00
b35fc7f268 Remove MkdirAllNewAs and update tests.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 6150ebf7b483197f4b8755df60e750b6410e95ca
Component: engine
2017-06-07 11:44:34 -04:00
5e2107c6ca Merge pull request #33496 from Microsoft/jjh/removedummy
Windows: Correct comment
Upstream-commit: 56da020e6b05c5cb15867049dccc79b51a6e0abb
Component: engine
2017-06-03 01:07:26 +02:00
3386def242 Windows: Correct comment
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 6e33c4158cc895d9b7fb274c13ecac0612c88aaa
Component: engine
2017-06-02 11:51:30 -07:00
6d3cd41f83 Limit max backoff delay to 2 seconds for GRPC connection
Docker use default GRPC backoff strategy to reconnect to containerd when
connection is lost. and the delay time grows exponentially, until reaches 120s.

So Change the max delay time to 2s to avoid docker and containerd
connection failure.

Signed-off-by: Wentao Zhang <zhangwentao234@huawei.com>
Upstream-commit: d3d8c77d195ce74f36ae6eee24578b9cac48f897
Component: engine
2017-06-02 18:19:09 +08:00
5f38794750 Merge pull request #32590 from moypray/containerd
Fix when containerd restarted, event handler may exit
Upstream-commit: d7c125791a3fa6cf233a8f9d017c28ae65d5b535
Component: engine
2017-06-01 08:16:24 -04:00
13833c9420 libcontainerd: fix reaper goroutine position
It has observed defunct containerd processes accumulating over
time while dockerd was permanently failing to restart containerd.
Due to a bug in the runContainerdDaemon() function, dockerd does not clean up
its child process if containerd already exits very soon after the (re)start.

The reproducer and analysis below comes from docker 1.12.x but bug
still applies on latest master.

- from libcontainerd/remote_linux.go:

  329 func (r *remote) runContainerdDaemon() error {
   :
   :      // start the containerd child process
   :
  403     if err := cmd.Start(); err != nil {
  404             return err
  405     }
   :
   :      // If containerd exits very soon after (re)start, it is
possible
   :      // that containerd is already in defunct state at the time
when
   :      // dockerd gets here. The setOOMScore() function tries to
write
   :      // to /proc/PID_OF_CONTAINERD/oom_score_adj. However, this
fails
   :      // with errno EINVAL because containerd is defunct. Please see
   :      // snippets of kernel source code and further explanation
below.
   :
  407     if err := setOOMScore(cmd.Process.Pid, r.oomScore); err != nil
{
  408             utils.KillProcess(cmd.Process.Pid)
   :
   :              // Due to the error from write() we return here. As
the
   :              // goroutine that would clean up the child has not
been
   :              // started yet, containerd remains in the defunct
state
   :              // and never gets reaped.
   :
  409             return err
  410     }
   :
  417     go func() {
  418             cmd.Wait()
  419             close(r.daemonWaitCh)
  420     }() // Reap our child when needed
   :
  423 }

This is the kernel function that gets invoked when dockerd tries to
write
to /proc/PID_OF_CONTAINERD/oom_score_adj.

- from fs/proc/base.c:

 1197 static ssize_t oom_score_adj_write(struct file *file, ...
 1198                                         size_t count, loff_t
*ppos)
 1199 {
   :
 1223         task = get_proc_task(file_inode(file));
   :
   :          // The defunct containerd process does not have a virtual
   :          // address space anymore, i.e. task->mm is NULL. Thus the
   :          // following code returns errno EINVAL to dockerd.
   :
 1230         if (!task->mm) {
 1231                 err = -EINVAL;
 1232                 goto err_task_lock;
 1233         }
   :
 1253 err_task_lock:
   :
 1257         return err < 0 ? err : count;
 1258 }

The purpose of the following program is to demonstrate the behavior of
the oom_score_adj_write() function in connection with a defunct process.

$ cat defunct_test.c

\#include <unistd.h>

main()
{
    pid_t pid = fork();

    if (pid == 0)
        // child
        _exit(0);

    // parent
    pause();
}

$ make defunct_test
cc     defunct_test.c   -o defunct_test

$ ./defunct_test &
[1] 3142

$ ps -f | grep defunct_test | grep -v grep
root      3142  2956  0 13:04 pts/0    00:00:00 ./defunct_test
root      3143  3142  0 13:04 pts/0    00:00:00 [defunct_test] <defunct>

$ echo "ps 3143" | crash -s
  PID    PPID  CPU       TASK        ST  %MEM     VSZ    RSS  COMM
  3143   3142   2  ffff880035def300  ZO   0.0       0      0
defunct_test

$ echo "px ((struct task_struct *)0xffff880035def300)->mm" | crash -s
$1 = (struct mm_struct *) 0x0
                          ^^^ task->mm is NULL

$ cat /proc/3143/oom_score_adj
0

$ echo 0 > /proc/3143/oom_score_adj
-bash: echo: write error: Invalid argument"

---

This patch fixes the above issue by making sure we start the reaper
goroutine as soon as possible.

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: 27087eacbf96e6ef9d48a6d3dc89c7c1cff155b4
Component: engine
2017-05-27 15:13:59 +02:00
292fba1b59 Fix when containerd restarted, event handler may exit
Description:
Kill docker-containerd continuously, and use kill -SIGUSR1 <dockerpid>
to check docker callstacks. And we will find that event
handler: startEventsMonitor or handleEventStream will exit.

This will only happen when system is busy, containerd need more time to
startup, and the monitor gorotine maybe exit.

Signed-off-by: Wentao Zhang <zhangwentao234@huawei.com>
Upstream-commit: 02ce73f62e73e78a4ec29b29fb2ba552221fe885
Component: engine
2017-05-25 17:32:05 +08:00
be30b971d7 Windows: Remove unused SandboxPath
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 2f038c25868727310992104b7b267fed6c7dad39
Component: engine
2017-05-24 13:44:35 -07:00
f1ce9152c0 Use CpuMaximum instead of CpuPercent for more precision
Signed-off-by: Darren Stahl <darst@microsoft.com>
Upstream-commit: 425973cbb87aef6a32b225a57f5ef2d78d5749d5
Component: engine
2017-05-19 12:33:14 -07:00
55f1c34adc Merge pull request #32986 from moypray/containerd_close
fix when rpc reports "transport is closing" error, health check go routine will exit
Upstream-commit: e103125883ec3c03a8523682ed62f33d04e0ade9
Component: engine
2017-05-17 17:04:05 -07:00
76789457c2 Use containerd Status variable when checking container state
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Upstream-commit: 0ea0b2becf119ca7950e8afcf5d440e800484b15
Component: engine
2017-05-15 10:53:51 -07:00
b04f3cd16c fix inconsistent state string with containerd
should be `stopped` according to containerd:
  https://github.com/containerd/containerd/blob/v0.2.x/runtime/runtime.go#L104

Signed-off-by: Deng Guangxing <dengguangxing@huawei.com>
Upstream-commit: 9771780a01e73200f96c84aa83689b7f34092772
Component: engine
2017-05-15 10:53:51 -07:00
ce61a3d4f2 Update moby to runc and oci 1.0 runtime final rc
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 005506d36c1c9308a05592d7596f3d484359c426
Component: engine
2017-05-05 13:45:45 -07:00
2849edb0ec fix when rpc reports "transport is closing" error, health check go routine will exit
Signed-off-by: Wentao Zhang <zhangwentao234@huawei.com>
Upstream-commit: 60742f9a95cb5eff549a873a53724863f1ab20e2
Component: engine
2017-05-04 00:52:10 +08:00
8cd4fe0243 Wait to delete container when restoring on Windows
Signed-off-by: Darren Stahl <darst@microsoft.com>
Upstream-commit: dbdc8bbee4a26093e6342f93bb63a09fbe850f58
Component: engine
2017-03-31 10:59:00 -07:00