Commit Graph

30710 Commits

Author SHA1 Message Date
e930dafbb3 Vendoring libnetwork 2e99f06621c23a5f4038968f1af1e28c84e4104e
Fixes #33415
Fixes #33346
Implemented few additional IPVS APIs to be used by other projects

Signed-off-by: Madhu Venugopal <madhu@docker.com>
Upstream-commit: 0484bdb6ca0ddd0bebc490e335a7f788cdc30f13
Component: engine
2017-05-31 16:04:00 -07:00
61ed140656 Merge pull request #33443 from DeliangFan/fix_download_image_fails
Fix downloading image fails when build docker
Upstream-commit: 555bd548cacfbe02447ebb055d3efa5eeaabe972
Component: engine
2017-05-31 21:03:37 +02:00
733e94a59a Merge pull request #33363 from tonistiigi/fix-chunked-build
Fix cancelling builder on chunked requests
Upstream-commit: 7ea0d1ecc6436063bfc9c72d09a75f15b029ac88
Component: engine
2017-05-31 20:18:35 +02:00
6fa6566523 Merge pull request #33329 from wenjianhn/EINVAL
Don't log EINVAL when unmount IPC
Upstream-commit: 41c3c9cc866d0e310664e2c4cbd42f0df1b88efa
Component: engine
2017-05-31 11:17:19 -07:00
a5b7ff8786 Merge pull request #33305 from thaJeztah/suppress-logger-close-error
Don't log error if file is already closed
Upstream-commit: 316681cd2a644ef7f98fbaf4ca91a45a021b4b22
Component: engine
2017-05-31 17:09:09 +02:00
02dca610a4 Merge pull request #33249 from ripcurld0/env_validate
Add container environment variables correctly to the health check
Upstream-commit: 7c2f20107a0599008152179a18cc8d0323ccc589
Component: engine
2017-05-31 07:35:28 -07:00
8e156ee521 Don't warn if the shm or mquere is not mounted
Fix #33328

Signed-off-by: Jacob Wen <jian.w.wen@oracle.com>
Upstream-commit: cfa2591d3f2636221e5005b3609aeb572e0c6653
Component: engine
2017-05-31 16:19:59 +08:00
6ed8b96066 Fix downloading image fails when build docker
Generate a token for each download process to avoid token expired.

Closes: #33441

Signed-off-by: vanderliang <lansheng@meili-inc.com>
Upstream-commit: cb502cd4e894a78e723902a4d2f23174b69430ce
Component: engine
2017-05-31 14:21:32 +08:00
4c527a90e5 Merge pull request #33387 from cpuguy83/go1.8.3
Bump go to go1.8.3
Upstream-commit: 75e685d620d6a37ec2db87c3c44ca5d918db740c
Component: engine
2017-05-31 02:18:09 +02:00
1369e3364d Merge pull request #33419 from runcom/fix-reaper-containerd
libcontainerd: fix reaper goroutine position
Upstream-commit: 4f55e390c4e5230bad232c462d60f8564faea17f
Component: engine
2017-05-30 10:55:38 -07:00
9b30256194 Merge pull request #33360 from aaronlehmann/vendor-swarmkit-7e096ced
Vendor swarmkit 7e096ced
Upstream-commit: 6629f1d0e753edc960f30030299e0e5d48b845aa
Component: engine
2017-05-30 09:59:48 -07:00
9ac5a90734 Bump go to go1.8.3
Note that go1.8.2 contains a security fix (CVE-2017-8932).

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 0c7c900e9e66335a6bd486be008af43ae83a5a37
Component: engine
2017-05-30 10:15:59 -04:00
c13c5f5760 Merge pull request #33311 from msabansal/dnssearch
Adding support for DNS search on RS1
Upstream-commit: 4bf8714fac11e95e835cf78eb15ba5a518c67c4b
Component: engine
2017-05-30 13:09:18 +02:00
7502b7e1e9 Merge pull request #33411 from vdemeester/move-configdir-away
Move cli.Configdir away (in `flags`).
Upstream-commit: 599f207b45e74648a8a6a7ac87d77e40930504e9
Component: engine
2017-05-30 11:49:40 +02:00
04f354cc94 Merge pull request #33413 from flx42/fix-plugin-retry
Do not reuse a http.Request after a failure in callWithRetry
Upstream-commit: 6f46afd9786f2d09b797ba196f75317f1aab4d1a
Component: engine
2017-05-29 17:30:51 -07:00
58ecec6e8e Move cli.Configdir away (in flags).
This makes integration not depend anymore of `cli` and thus not
require `cobra` and other packages to compile.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 71d60ec0eb7eeddc73d2cf63748ab7debe3f06af
Component: engine
2017-05-29 16:22:33 -07:00
e9185f10cf Don't log error if file is already closed
When closing the log-file, and the file is already
closed, there's no need to log an error.

This patch adds a `closed` boolean to check if the
file was closed, and if so, skip closing the file.
This prevents errors like this being logged:

    level=error msg="Error closing logger: invalid argument"

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 07b51ed300429e88871e40b4d67dc031e2e8901c
Component: engine
2017-05-29 17:42:37 +02:00
bad34014ad Merge pull request #33423 from gesellix/swagger-docs-typo
Fix typo in swagger doc
Upstream-commit: d192db0d9350222d2b8bb6eba8525b04c3be7d61
Component: engine
2017-05-29 15:58:50 +02:00
7acd97d8f9 Merge pull request #33257 from mtesselH/master
Add CreatedAt filed to volume. Display when volume is inspected.
Upstream-commit: 79b19c2e16c43f22187538953f49b2c048b063f8
Component: engine
2017-05-29 10:48:07 +01:00
8329f806d3 Merge pull request #33422 from cpuguy83/dont_unmount_all_the_things
Don't unmount entire plugin manager tree on remove
Upstream-commit: c12becaca72e705b7a52c8a8aeb498db880d0203
Component: engine
2017-05-28 19:25:12 -07:00
1a6d5b7b4c Fix typo in swagger doc
Signed-off-by: Tobias Gesellchen <tobias@gesellix.de>
Upstream-commit: 56da4f2fb2509f9b2c2bc1c1c609c1dabeaec07d
Component: engine
2017-05-27 22:37:36 +02:00
dd2f64591e Don't unmount entire plugin manager tree on remove
This was mistakenly unmounting everything under `plugins/*` instead of
just `plugins/<id>/*` anytime a plugin is removed.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: db5f31732a9868c1e9e4f9a49be70b794ff82d4f
Component: engine
2017-05-27 12:30:37 -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
81bb7bdddf Do not reuse a http.Request after a failure in callWithRetry
Closes: #33412

Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
Upstream-commit: 62871ef2fa52b0a2e426c30f36d35a9ba1e92fac
Component: engine
2017-05-26 18:02:31 -07:00
f35cfc66e5 prevent image prune panic
Signed-off-by: Alfred Landrum <alfred.landrum@docker.com>
Upstream-commit: 32da2a4234c5c68ff466dc1afc91ba98dbbe199a
Component: engine
2017-05-26 12:54:39 -07:00
3d97792442 Add CreatedAt filed to volume. Display when volume is inspected.
Closes #32663 by adding CreatedAt field when volume is created.
Displaying CreatedAt value when volume is inspected
Adding tests to verfiy the new field is correctly populated

Signed-off-by: Marianna <mtesselh@gmail.com>

Moving CreatedAt tests from the CLI

Moving the tests added for the newly added CreatedAt field for Volume, from CLI to API tests

Signed-off-by: Marianna <mtesselh@gmail.com>
Upstream-commit: a46f757c4043031379362c5d6b3bad7562ab9fed
Component: engine
2017-05-26 11:47:02 -07:00
933e100f5e Merge pull request #33384 from Microsoft/jjh/sandboxpath
Windows: Remove unused SandboxPath
Upstream-commit: e925820bfd5af066497800a02c597d6846988398
Component: engine
2017-05-25 11:21:15 -07:00
1fc413c063 Merge pull request #33320 from sbko/33138-generic-api-error-messages
Stop referring CLI flags in error messages if API client is unknown
Upstream-commit: a2f3f6660d08dfb667f091e0fd8454c815dd1c81
Component: engine
2017-05-25 10:48:29 -07:00
4b25f2f51d Merge pull request #33061 from dnephin/refactor-builder-probe-cache
[Builder] Refactor builder probe cache and container backend
Upstream-commit: 8d20641d43a05ee04dad0818ac51d5319a8e5e30
Component: engine
2017-05-25 10:10:49 -07:00
6a7791114d Merge pull request #33292 from keloyang/attach-restart-check
Add a restarting check to ContainerAttach
Upstream-commit: da3c3ec1458588d5d263dc3babd3dca95fdc7d8d
Component: engine
2017-05-24 18:30:05 -07:00
cfc2b7a626 Merge pull request #33365 from darrenstahlmsft/revendorGowinio
Update go-winio to v0.4.2
Upstream-commit: c22ad736aa2eb2b796cd9a662017e66b1cf970e0
Component: engine
2017-05-24 22:08:59 +01: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
553a2e157c Merge pull request #33376 from nhorman/keepalive
Ensure that a device mapper task is referenced until task is complete
Upstream-commit: e4abe7c2ce9bb496f12adbd6e00713e776fd1807
Component: engine
2017-05-24 15:57:04 -04:00
65da2e84f0 Merge pull request #33358 from vdemeester/fix-integration-request-package
Fix `request.SockRequestRaw` error check
Upstream-commit: ffd3d6ccd92312fe15e080c0267d0f9bdfe90bd4
Component: engine
2017-05-24 11:49:34 -07:00
af8a181696 Merge pull request #33095 from chrisdias/chrisdias/multistagebuild
syntax highlighting: support FROM...AS for multi stage build
Upstream-commit: 08894a7f237945c70ffc1790f5c297a416f85e87
Component: engine
2017-05-24 11:35:17 -07:00
c4ff71019e Merge pull request #33167 from utzb/rpmbuilds
adding rpm builds for ppc64le and s390x
Upstream-commit: 4050e3061ceaeeb6644e1a6fa33a69e81afba4c6
Component: engine
2017-05-24 17:24:23 +01:00
75a4055d7c Ensure that a device mapper task is referenced until task is complete
DeviceMapper tasks in go use SetFinalizer to clean up C construct
counterparts in the C LVM library.  While thats well and good, it relies
heavily on the exact interpretation of when the golang garbage collector
determines that an object is unreachable is subject to reclaimation.
While common sense would assert that for stack variables (which these DM
tasks always are), are unreachable when the stack frame in which they
are declared returns, thats not the case.  According to this:

https://golang.org/pkg/runtime/#SetFinalizer

The garbage collector decides that, if a function calls into a
systemcall (which task.run() always will in LVM), and there are no
subsequent references to the task variable within that stack frame, then
it can be reclaimed.  Those conditions are met in several devmapper.go
routines, and if the garbage collector runs in the middle of a
deviceMapper operation, then the task can be destroyed while the
operation is in progress, leading to crashes, failed operations and
other unpredictable behavior.

The fix is to use the KeepAlive interface:

https://golang.org/pkg/runtime/#KeepAlive

The KeepAlive method is effectively an empy reference that fools the
garbage collector into thinking that a variable is still reachable.  By
adding a call to KeepAlive in the task.run() method, we can ensure that
the garbage collector won't reclaim a task object until its execution
within the deviceMapper C library is complete.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Upstream-commit: d764d8b16624e4924b3949273089f851efa0f717
Component: engine
2017-05-24 11:11:23 -04:00
05027a4b96 Update go-winio to v0.4.2
Signed-off-by: Darren Stahl <darst@microsoft.com>
Upstream-commit: 3f13107223a9753d709c196c46f1c846041fc0c3
Component: engine
2017-05-23 18:27:50 -07:00
e549564e77 Fix cancelling builder on chunked requests
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 23628bd7efb0aae565cea5ee040e373b0c93fd8d
Component: engine
2017-05-23 16:29:13 -07:00
5556f64d13 Vendor swarmkit 7e096ced
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 10df99f9ae48acc9888494223256637a8ca06f50
Component: engine
2017-05-23 15:01:35 -07:00
bdc8240507 Fix request.SockRequestRaw error check
We should check for error before reading the response (response can be
nil, and thus this would panic)

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 45e0376ea361811b2f5d0653a6b103dd39653371
Component: engine
2017-05-23 12:48:22 -07:00
850d525b5f Extract imageProber and ContainerBackend from Builder
Extract a common function for builder.createContainer
Extract imageCache for doing cache probes
Removes the cacheBuested field from Builder
Create a new containerManager class which reduces the interface between the
builder and managing containers to 3 functions (from 6)

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 19f3b0715cf89f336efa286ea1d3f8b57d8c4973
Component: engine
2017-05-23 15:12:58 -04:00
c70c1ec6df Merge pull request #33341 from cyli/do-not-clear-state-on-swarm-init-join
Do not clear swarm directory on `swarm init` and `swarm join`
Upstream-commit: a9fcaee3514c60d997044b246e4c06e9ba80f4f5
Component: engine
2017-05-23 12:09:53 -07:00
93de81213c Support FROM...AS syntax for multi stage build dockerfiles
Signed-off-by: chrisdias <cdias@microsoft.com>
Upstream-commit: 8523e9d108a0e98865673701a7bd0a7929c5260b
Component: engine
2017-05-22 18:12:10 -07:00
90e101ed15 Do not clear swarm directory at the begining of swarm init and swarm join now.
However, do clear the directory if init or join fails, because we don't
want to leave it in a half-finished state.

Signed-off-by: Ying Li <ying.li@docker.com>
Upstream-commit: bf3e9293a66c77a2fddf4e691222898846b4af9f
Component: engine
2017-05-22 17:45:20 -07:00
cc72dd2445 Stop referring CLI flags in error messages if API client is unknown
Signed-off-by: Stanislav Bondarenko <stanislav.bondarenko@gmail.com>
Upstream-commit: 92291a7355dff35be70b5d0ebf634f0232ca6a94
Component: engine
2017-05-22 18:50:49 -04:00
949950950a vendor: Remove docker-credential-helpers
This appears to be a remnant from the CLI that is no longer imported
anywhere. Remove it from vendor.conf and the vendor directory.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: aa6fc939baf0bae00391a0ba703187018055b8bf
Component: engine
2017-05-22 13:58:28 -07:00
d64468f256 Merge pull request #33279 from nishanttotla/fix-service-image-issues
Ensure service images get default tag and print familiar strings
Upstream-commit: 5648a1ada223d692615072af26d0ce6e23415006
Component: engine
2017-05-22 21:45:11 +01:00
7813ee64ef Merge pull request #33310 from darrenstahlmsft/RevendorGowinio
Revendor go-winio to v0.4.1
Upstream-commit: 65f360fc415a5ef648250a76ca261c2ae529467a
Component: engine
2017-05-22 10:31:57 -07:00
3dea3b7a46 Merge pull request #32774 from darrenstahlmsft/ProcessorMaximum
Use CpuMaximum instead of CpuPercent for more precision
Upstream-commit: bb64d45be1dce3fe1a526b2362a7d8451bfdcbe3
Component: engine
2017-05-22 08:55:17 -07:00