Commit graph

36339 commits

Author SHA1 Message Date
Maximiliano Maccanti
687cbfa739 Split StreamConfig from New, Utest table driven
Signed-off-by: Maximiliano Maccanti <maccanti@amazon.com>
2018-12-21 20:45:11 +00:00
Maximiliano Maccanti
512ac778bf Add two configurable options to awslogs driver
Add awslogs-force-flush-interval-seconds and awslogs-max-buffered-events configurable options to aswlogs driver to replace hardcoded values of repsectively 5 seconds and 4K.

Signed-off-by: Maximiliano Maccanti <maccanti@amazon.com>
2018-12-21 20:45:11 +00:00
Akihiro Suda
2cb26cfe9c
Merge pull request #38301 from cyphar/waitgroup-limits
daemon: switch to semaphore-gated WaitGroup for startup tasks
2018-12-22 00:07:55 +09:00
Akihiro Suda
a07fbfbd15
Merge pull request #38411 from kolyshkin/dont-panic
integration-cli/build: don't panic ;)
2018-12-22 00:06:01 +09:00
Aleksa Sarai
5a52917e4d
daemon: switch to semaphore-gated WaitGroup for startup tasks
Many startup tasks have to run for each container, and thus using a
WaitGroup (which doesn't have a limit to the number of parallel tasks)
can result in Docker exceeding the NOFILE limit quite trivially. A more
optimal solution is to have a parallelism limit by using a semaphore.

In addition, several startup tasks were not parallelised previously
which resulted in very long startup times. According to my testing, 20K
dead containers resulted in ~6 minute startup times (during which time
Docker is completely unusable).

This patch fixes both issues, and the parallelStartupTimes factor chosen
(128 * NumCPU) is based on my own significant testing of the 20K
container case. This patch (on my machines) reduces the startup time
from 6 minutes to less than a minute (ideally this could be further
reduced by removing the need to scan all dead containers on startup --
but that's beyond the scope of this patchset).

In order to avoid the NOFILE limit problem, we also detect this
on-startup and if NOFILE < 2*128*NumCPU we will reduce the parallelism
factor to avoid hitting NOFILE limits (but also emit a warning since
this is almost certainly a mis-configuration).

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2018-12-21 21:51:02 +11:00
Tibor Vass
ab318fa6ca
Merge pull request #38403 from thaJeztah/switch_to_alpine_3.8
Switch Dockerfile.e2e to alpine 3.8
2018-12-21 11:22:44 +01:00
Sergio Lopez
5846db10af layer/layer_store: ensure NewInputTarStream resources are released
In applyTar, if the driver's ApplyDiff returns an error, the function
returns early without calling io.Copy.

As a consequence, the resources (a goroutine and some buffers holding
the uncompressed image, the digest, etc...) allocated or referenced by
NewInputTarStream above aren't released, as the worker goroutine only
finishes when it finds EOF or a closed pipe.

Signed-off-by: Sergio Lopez <slp@redhat.com>
2018-12-21 09:30:09 +01:00
Kir Kolyshkin
7e7ff2a033 integration-cli/build: don't panic
A lack of check in the test code can lead to a panic due to
`len(ids)` being `0`.

Avoid the panic by adding appropriate checks. Note `Assert()` should be
used rather than `Check()` as if it fails we should not proceed with the
test.

Originally found in https://github.com/moby/moby/pull/38404.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-12-20 18:51:57 -08:00
Yong Tang
c77afb700d
Merge pull request #38402 from thaJeztah/bump_golang_1.11.4
Bump Golang 1.11.4
2018-12-20 16:54:35 -08:00
Sebastiaan van Stijn
92b34ec9c6
Merge pull request #38408 from josegonzalez/patch-1
Correct spelling error in roadmap
2018-12-20 21:35:41 +01:00
Jose Diaz-Gonzalez
a2d0de6559 Correct spelling error in roadmap
Signed-off-by: Jose Diaz-Gonzalez <email@josediazgonzalez.com>
2018-12-20 14:17:50 -05:00
Sebastiaan van Stijn
7c8dcebd30
Switch Dockerfile.e2e to alpine 3.8
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-12-20 15:43:06 +01:00
Sebastiaan van Stijn
3770f38647
Bump Golang 1.11.4
go1.11.4 (released 2018/12/14) includes fixes to cgo, the compiler, linker,
runtime, documentation, go command, and the net/http and go/types packages. It
includes a fix to a bug introduced in Go 1.11.3 that broke go get for import
path patterns containing "...".

See the Go 1.11.4 milestone for details:
https://github.com/golang/go/issues?q=milestone%3AGo1.11.4+label%3ACherryPickApproved

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-12-20 15:39:34 +01:00
Vincent Demeester
bcd817ee6b
Merge pull request #38393 from thaJeztah/refactor_container_validation
Refactor container validation
2018-12-20 14:20:01 +01:00
Vincent Demeester
170ed8d7e7
Merge pull request #38399 from thaJeztah/fix_govet_issues
Fix some go_vet issues
2018-12-20 08:32:56 +01:00
Vincent Demeester
7e220b3f83
Merge pull request #38266 from thaJeztah/logrus_formatting
Configure log-format earlier, and small refactor
2018-12-20 08:32:15 +01:00
Vincent Demeester
b33dc72523
Merge pull request #38335 from yongtang/38258-syslog-rfc5424
Add zero padding for RFC5424 syslog format
2018-12-20 08:30:22 +01:00
Akihiro Suda
f81cafd12b
Merge pull request #38381 from thaJeztah/unify_api_version_checks
Unify API-version checks
2018-12-20 13:07:00 +09:00
Sebastiaan van Stijn
9c83124302
Fix some go_vet issues
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-12-19 23:57:06 +01:00
Sebastiaan van Stijn
40f245b7c8
Merge pull request #38097 from cpuguy83/roadmap.md
Update roadmap to reflect reality.
2018-12-19 23:20:41 +01:00
Sebastiaan van Stijn
1edf943dc7
Configure log-format earlier, and small refactor
Some messages are logged before the logrus format was set,
therefore resulting in inconsistent log-message formatting
during startup;

Before this patch;

```
dockerd --experimental
WARN[0000] Running experimental build
INFO[2018-11-24T11:24:05.615249610Z] libcontainerd: started new containerd process  pid=132
INFO[2018-11-24T11:24:05.615348322Z] parsed scheme: "unix"                         module=grpc
...
```

With this patch applied;

```
dockerd --experimental
WARN[2018-11-24T13:41:51.199057259Z] Running experimental build
INFO[2018-11-24T13:41:51.200412645Z] libcontainerd: started new containerd process  pid=293
INFO[2018-11-24T13:41:51.200523051Z] parsed scheme: "unix"                         module=grpc
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-12-19 18:53:18 +01:00
Sebastiaan van Stijn
d1117e8e10
Merge pull request #38372 from FabianKramm/fix-darwin-compile
Fix unmount redeclaration on darwin in github.com/docker/docker/pkg/m…
2018-12-19 13:26:43 +01:00
Sebastiaan van Stijn
f6002117a4
Extract container-config and container-hostconfig validation
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-12-19 13:09:12 +01:00
Sebastiaan van Stijn
44b360f884
Merge pull request #38391 from olljanat/derek
Add curators rights for olljanat
2018-12-19 12:03:18 +01:00
Sebastiaan van Stijn
5fc0f03426
Extract workingdir validation/conversion to a function
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-12-19 10:24:39 +01:00
Sebastiaan van Stijn
c0697c27aa
Extract port-mapping validation to a function
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-12-19 10:24:33 +01:00
Sebastiaan van Stijn
e1809510ca
Extract restart-policy-validation to a function
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-12-19 10:24:28 +01:00
Sebastiaan van Stijn
6a7da0b31b
Extract healthcheck-validation to a function
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-12-19 10:24:23 +01:00
Sebastiaan van Stijn
b6e373c525
Rename verifyContainerResources to verifyPlatformContainerResources
This validation function is platform-specific; rename it to be
more explicit.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-12-19 10:24:09 +01:00
Sebastiaan van Stijn
c07d79bcc2
Merge pull request #38369 from thaJeztah/bump_golang_1.11.3
Bump Golang 1.11.3 (CVE-2018-16875)
2018-12-19 09:41:31 +01:00
Sebastiaan van Stijn
e278678705
Remove unused argument from verifyPlatformContainerSettings
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-12-19 09:23:09 +01:00
Sebastiaan van Stijn
10c97b9357
Unify logging container validation warnings
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-12-19 09:15:21 +01:00
Sebastiaan van Stijn
2e23ef5350
Move port-publishing check to linux platform-check
Windows does not have host-mode networking, so on Windows, this
check was a no-op

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-12-18 22:46:05 +01:00
Olli Janatuinen
46c713ab5a Add curators rights for olljanat
Signed-off-by: Olli Janatuinen <olli.janatuinen@gmail.com>
2018-12-18 23:37:25 +02:00
Sebastiaan van Stijn
57f1305e74
Move "OOM Kill disable" warning to the daemon
Disabling the oom-killer for a container without setting a memory limit
is dangerous, as it can result in the container consuming unlimited memory,
without the kernel being able to kill it. A check for this situation is curently
done in the CLI, but other consumers of the API won't receive this warning.

This patch adds a check for this situation to the daemon, so that all consumers
of the API will receive this warning.

This patch will have one side-effect; docker cli's that also perform this check
client-side will print the warning twice; this can be addressed by disabling
the cli-side check for newer API versions, but will generate a bit of extra
noise when using an older CLI.

With this patch applied (and a cli that does not take the new warning into account);

```
docker create --oom-kill-disable busybox
WARNING: OOM killer is disabled for the container, but no memory limit is set, this can result in the system running out of resources.
669933b9b237fa27da699483b5cf15355a9027050825146587a0e5be0d848adf

docker run --rm --oom-kill-disable busybox
WARNING: Disabling the OOM killer on containers without setting a '-m/--memory' limit may be dangerous.
WARNING: OOM killer is disabled for the container, but no memory limit is set, this can result in the system running out of resources.
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-12-18 22:30:56 +01:00
Sebastiaan van Stijn
419972a714
Merge pull request #38376 from crosbymichael/bump-containerd
Update containerd to aa5e000c963756778ab3ebd1a12c6
2018-12-18 22:25:33 +01:00
Sebastiaan van Stijn
8422e6f6fa
Merge pull request #38383 from tonistiigi/exec-ctx
libcontainerd: prevent exec delete locking
2018-12-17 17:28:48 +01:00
Sebastiaan van Stijn
c4c4963228
Unify API-version checks
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-12-17 11:30:29 +01:00
Tonis Tiigi
332f134890 libcontainerd: prevent exec delete locking
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-12-17 12:22:37 +02:00
Yong Tang
efba5f8565
Merge pull request #38371 from farnasirim/doc-test-fix-regex
Update test.md doc to fix sample test regex
2018-12-14 16:29:12 -08:00
Michael Crosby
e5d9d72162 Update containerd to aa5e000c963756778ab3ebd1a12c6
This includes a patch on top of containerd 1.2.1 to handle fifo
timeouts.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-12-14 15:41:41 -05:00
Fabian Kramm
eea4977d02 Fix unmount redeclaration on darwin in github.com/docker/docker/pkg/mount
Signed-off-by: Fabian Kramm <kramm@covexo.com>
2018-12-14 11:10:52 +01:00
Mohammad Nasirifar
c46c3c1689 Update test.md doc to fix sample test regex
Remove the extra dollar sign from the test regex so the command
would find the desired test.

Signed-off-by: Mohammad Nasirifar <farnasirim@gmail.com>
2018-12-13 20:35:49 -05:00
Sebastiaan van Stijn
6b7c093b0d
Bump Golang 1.11.3 (CVE-2018-16875)
go1.11.13 (released 2018/12/14)

- crypto/x509: CPU denial of service in chain validation golang/go#29233
- cmd/go: directory traversal in "go get" via curly braces in import paths golang/go#29231
- cmd/go: remote command execution during "go get -u" golang/go#29230

See the Go 1.11.3 milestone on the issue tracker for details:
https://github.com/golang/go/issues?q=milestone%3AGo1.11.3

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-12-14 00:46:21 +01:00
Brian Goff
f711f2bdc3
Merge pull request #38360 from thaJeztah/fix_missing_import
Fix missing import
2018-12-12 11:49:29 -08:00
Sebastiaan van Stijn
d69968d6d3
Fix missing import
This import got lost after commit 56cc56b0fa
was merged, likely because the PR was built against an outdated
master.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-12-12 17:48:48 +01:00
Vincent Demeester
56cc56b0fa
Merge pull request #38126 from mjameswh/fix-1715
Use idtools.LookupGroup instead of parsing /etc/group file for docker.sock ownership
2018-12-12 17:29:28 +01:00
Sebastiaan van Stijn
759ad5a981
Merge pull request #38338 from Bevisy/master
image/spec/v1.1.md formatting error
2018-12-12 13:57:19 +01:00
Vincent Demeester
f810141387
Merge pull request #38348 from Quasilyte/patch-1
registry: use len(via)!=0 instead of via!=nil
2018-12-12 09:05:45 +01:00
Vincent Demeester
f34727f704
Merge pull request #38316 from dmandalidis/xattr-fix
Ignore xattr errors on copy (fixes #38155)
2018-12-12 09:04:35 +01:00