Commit Graph

42207 Commits

Author SHA1 Message Date
f27fe9ca16 Merge component 'engine' from git@github.com:docker/engine 18.09 2018-09-13 13:03:35 +00:00
cd5bd70aa4 Merge component 'cli' from git@github.com:docker/cli 18.09 2018-09-13 12:37:02 +00:00
017b0f6ba8 Merge pull request #1368 from thaJeztah/carry-1360-store_prefix
[18.09] Prefix engine repo with store
Upstream-commit: 649e4916bb
Component: cli
2018-09-13 08:24:45 +02:00
ea3c2e02fc Merge pull request #46 from kolyshkin/18.09-backport-pr37771
[18.09] backport #37771 "vendor: update tar-split"
Upstream-commit: e9880018722a325a34290130255a820fff1779fa
Component: engine
2018-09-12 18:16:16 -07:00
b8bac33848 Merge pull request #48 from kolyshkin/18.09-backport-logs-follow
[18.09] backport "daemon.ContainerLogs(): fix resource leak on follow"
Upstream-commit: 6531bac59bfd453456231511bdc3efade1fc9481
Component: engine
2018-09-12 18:13:56 -07:00
f730722787 Merge component 'packaging' from git@github.com:docker/docker-ce-packaging 18.09 2018-09-12 17:06:55 +00:00
1cc5cccebc Merge pull request #207 from seemethere/do_not_include_arch_1809
[18.09] Remove the arch in the image tag
Upstream-commit: 4246e237d47800b5a13904acbc789fd4555885b0
Component: packaging
2018-09-12 16:28:07 +02:00
434a8b60cc Remove the arch in the image tag
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
(cherry picked from commit f7b0d0742e4b23e3442ce78cbc0d4c190929eb96)
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
Upstream-commit: 0fb14f8b914ada119d74818637e4a13176a51410
Component: packaging
2018-09-12 07:19:27 -07:00
75470dbe47 Merge pull request #206 from seemethere/remove_need_for_suffix_1809
[18.09] Remove need for SUFFIX in gen-deb-ver
Upstream-commit: 798d4cc8c5c1caf51632fa1da967725414e37b73
Component: packaging
2018-09-12 15:20:36 +02:00
21ad97749e Merge pull request #205 from seemethere/bump_containerd_proxy_1809
[18.09] Bump proxy to 35c543b
Upstream-commit: d3176d845cd14b033ab3b8d65e587b6af18ed6bf
Component: packaging
2018-09-12 15:13:52 +02:00
1b98ea2057 Remove need for SUFFIX in gen-deb-ver
Should generate correct bits whether or not the suffix is present.

Working example:

❯ ./gen-deb-ver . 18.09.0-beta1
18.09.0~1.1.beta1 18.09.0-beta1

❯ ./gen-deb-ver . 18.09.0-ce-beta1
18.09.0~ce~1.1.beta1 18.09.0-ce-beta1

Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
(cherry picked from commit 9de3f6fb573806abc2e546447c41552ff90731a4)
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
Upstream-commit: cc336d0804076b31d6d059b164e9b4e3b3cec886
Component: packaging
2018-09-12 06:03:56 -07:00
95d730b7e2 Merge component 'packaging' from git@github.com:docker/docker-ce-packaging 18.09 2018-09-12 13:03:33 +00:00
ffcd2e38d1 Merge pull request #203 from seemethere/fix_tar_1809
[18.09] Have the tar target make a docker compat one too
Upstream-commit: 098761f13254bf956a92ebca219aa10b69b8e7d9
Component: packaging
2018-09-12 15:02:49 +02:00
1ba2a2621f Bump proxy to 35c543b
Includes fixes related to upgrade cycles

Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
(cherry picked from commit 83a20d53f14adcd2bcc9e932435aa66b6e056afa)
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
Upstream-commit: befa3c61954d12f2413df56a384989d7ae2cb9b3
Component: packaging
2018-09-12 06:00:21 -07:00
f8a31233fe Merge pull request #199 from dhiltgen/platform
Wire up the platform string properly
Upstream-commit: 6ada8595287d6c25e9553b4aa36c961c5bc6f968
Component: packaging
2018-09-12 14:59:32 +02:00
b18755d509 Add *.tar and image-linux to our gitignore
A bit overdue

Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
(cherry picked from commit 11643a30e0bdde4016afe42ab5f1f85e0fc83ecf)
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
Upstream-commit: f38206fa477c59ec39b06b8ddde40be1f65c7cf0
Component: packaging
2018-09-12 05:42:28 -07:00
7589c6479b Have the tar target make a docker compat one too
docker load doesn't support OCI based tar files so we have to make 2
different ones.

Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
(cherry picked from commit 696cdc009ca73b070d8877ee5cdd13c4b0e4a39b)
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
Upstream-commit: ea811c67ee1e558ecec1b394fc591458b57f7ed1
Component: packaging
2018-09-12 05:42:28 -07:00
dccaa07396 Prefix engine repo with store
The official access point for the Q3 engine images will
be prefixed by store.

Signed-off-by: Daniel Hiltgen <daniel.hiltgen@docker.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 3597d75281
Component: cli
2018-09-12 13:43:04 +02:00
f9341039de Merge component 'cli' from git@github.com:docker/cli 18.09 2018-09-12 08:36:54 +00:00
1dd82b9047 Merge pull request #1364 from thaJeztah/18.09-backport_contains-containerized
[18.09] backport: remove containerizedengine package dependency from docker/cli/command…
Upstream-commit: 5673816fec
Component: cli
2018-09-12 08:55:12 +02:00
f36755c235 Wire up the platform string properly
This is set in a top-level makefile, but apparently
isn't getting passed all the way through as expected.

Signed-off-by: Daniel Hiltgen <daniel.hiltgen@docker.com>
Upstream-commit: a5ad5471419cb2a0935148f891c5ada8b13b4779
Component: packaging
2018-09-11 19:14:27 -07:00
c1d5de1803 Merge component 'packaging' from git@github.com:docker/docker-ce-packaging 18.09 2018-09-11 17:03:27 +00:00
ce825751d7 Merge pull request #198 from jose-bigio/18.09_move_tar_targets
Merged with https://github.com/seemethere/unir
Upstream-commit: 335dcd5851a58acc7415450fc28f9a47b94b4ac4
Component: packaging
2018-09-11 16:37:57 +00:00
76d1f5bead Merge component 'cli' from git@github.com:docker/cli 18.09 2018-09-11 16:36:58 +00:00
9eec3ee5ff Merge pull request #1365 from thaJeztah/18.09-backport_engine-only-linux
[18.09] backport add `docker engine` commands only on Linux…
Upstream-commit: a8c69c8287
Component: cli
2018-09-11 18:04:57 +02:00
00ef8b90e6 Call the engine-.tar target
Also cleans up the target in rpm and deb Makfiles because
the tar target already output a tar.

Signed-off-by: Jose Bigio <jose.bigio@docker.com>
(cherry picked from commit 8a4744f48aa13bea0b4e9174165be4add0a5a42f)
Signed-off-by: Jose Bigio <jose.bigio@docker.com>
Upstream-commit: 8e4a92dc667e2143b6d5707e19c5564b7da46ba1
Component: packaging
2018-09-11 08:42:18 -07:00
92c32cb418 Move the tar creation to the image directory
Signed-off-by: Jose Bigio <jose.bigio@docker.com>
(cherry picked from commit eba0ed1f3497ebf25666d96c73c71fde9de98b50)
Signed-off-by: Jose Bigio <jose.bigio@docker.com>
Upstream-commit: 9398be8a7b9ea3907de5c112c329fe3ef1832137
Component: packaging
2018-09-11 08:42:03 -07:00
4c421251cb Remove containerizedengine package dependency from docker/cli/command…
… this removes a whole lot of dependencies from people depending on docker/cli…

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit 2d344b2f61)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: fc3dc8f058
Component: cli
2018-09-11 17:01:02 +02:00
7c9cac74cd Add docker engine commands only on Linux…
… this is, for now, the only platform that is supported

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit a3a955f204)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 2a46a3d46c
Component: cli
2018-09-11 16:57:54 +02:00
f2500128b0 Merge pull request #557 from dhiltgen/fix_version
Bump to beta1.2
2018-09-10 16:48:31 -07:00
4a4191fafe Merge component 'packaging' from git@github.com:docker/docker-ce-packaging 18.09 2018-09-10 21:06:01 +00:00
6af5c2b6a9 Merge pull request #185 from corbin-coleman/add-build-image-arg
[18.09] Parameterize Dockerfiles base build images
Upstream-commit: 66979a05d0debb27007da2861d909db7c1a7fb2a
Component: packaging
2018-09-10 10:30:46 -07:00
5e8bd8d686 Merge component 'packaging' from git@github.com:docker/docker-ce-packaging 18.09 2018-09-10 17:03:06 +00:00
d10c52eaae Parameterize Dockerfiles base build images
This will make it easier for anybody to build with a specific version of a distro they want to build on.
They could lock into a specific sha of a docker image if they wanted, as an example.

Signed-off-by: corbin-coleman <corbin.coleman@docker.com>
Upstream-commit: 7afc35b95ac46bfef383788341ddb0b157af14eb
Component: packaging
2018-09-10 16:54:32 +00:00
8644fd23bd Merge pull request #193 from dhiltgen/bump_epoch
[18.09] Bump packaging epoch
Upstream-commit: 346f22eb45a72e6087d0996b4cd5699346c10e74
Component: packaging
2018-09-10 18:41:49 +02:00
7e81969c88 Merge pull request #192 from seemethere/no_offline_installer_1809
[18.09] Remove offline installer to install shim-process
Upstream-commit: a44c95733f9474359e96c7187d9e31e0db22ab50
Component: packaging
2018-09-10 18:41:30 +02:00
3082638047 Bump packaging epoch
This should accomodate the new versioning fix

Signed-off-by: Daniel Hiltgen <daniel.hiltgen@docker.com>
Upstream-commit: be00095e1d0d5674665a63b6e5932178632feb0e
Component: packaging
2018-09-10 08:26:11 -07:00
251e48a733 Bump to beta1.2
Signed-off-by: Daniel Hiltgen <daniel.hiltgen@docker.com>
2018-09-10 08:18:45 -07:00
6069864507 Remove offline installer to install shim-process
Removes the need for the offline installer to install the shim process
and instead installs the shim process as part of the packaging.

May be easier in the future to just package the shim process on it's own
but that'll come after this 18.09 release

Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
(cherry picked from commit f8bd366d58f8bdf8a82b9a033353ca5bf4eda948)
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
Upstream-commit: 31d0cb047b98ab43f661bd026bdd63deef62543d
Component: packaging
2018-09-10 14:06:32 +00:00
a5616edf44 Merge pull request #551 from dhiltgen/fix_version
[18.09] Fix version string
2018-09-07 14:30:23 -07:00
1eb0dfc18f Merge component 'packaging' from git@github.com:docker/docker-ce-packaging 18.09 2018-09-07 17:03:46 +00:00
14bef21142 Switch to plain version strings
This removes the "ce" and "ee" portion of the version string

Signed-off-by: Daniel Hiltgen <daniel.hiltgen@docker.com>
2018-09-07 09:58:56 -07:00
ca6cbf3a46 Merge pull request #190 from seemethere/1809_deb
Merged with https://github.com/seemethere/unir
Upstream-commit: 8887f3388e8a91ca6b45854f4f354286102682ad
Component: packaging
2018-09-07 15:55:26 +00:00
07875f74c1 Fix docker-ce-cli replacing files
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
(cherry picked from commit 193a6be5de72509679c8729c8d4e3a81de4f1e8e)
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
Upstream-commit: 1293fb54734e6d4391cf6957eae7a1659306e4eb
Component: packaging
2018-09-07 14:16:46 +00:00
a620951919 TestFollowLogsProducerGone: add
This should test that
 - all the messages produced are delivered (i.e. not lost)
 - followLogs() exits

Loosely based on the test having the same name by Brian Goff, see
https://gist.github.com/cpuguy83/e538793de18c762608358ee0eaddc197

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit f845d76d047760c91dc0c7076aea840291fbdbc5)
Upstream-commit: 2a82480df9ad91593d59be4b5283917dbea2da39
Component: engine
2018-09-06 18:39:22 -07:00
1a333bfe59 daemon.ContainerLogs(): fix resource leak on follow
When daemon.ContainerLogs() is called with options.follow=true
(as in "docker logs --follow"), the "loggerutils.followLogs()"
function never returns (even then the logs consumer is gone).
As a result, all the resources associated with it (including
an opened file descriptor for the log file being read, two FDs
for a pipe, and two FDs for inotify watch) are never released.

If this is repeated (such as by running "docker logs --follow"
and pressing Ctrl-C a few times), this results in DoS caused by
either hitting the limit of inotify watches, or the limit of
opened files. The only cure is daemon restart.

Apparently, what happens is:

1. logs producer (a container) is gone, calling (*LogWatcher).Close()
for all its readers (daemon/logger/jsonfilelog/jsonfilelog.go:175).

2. WatchClose() is properly handled by a dedicated goroutine in
followLogs(), cancelling the context.

3. Upon receiving the ctx.Done(), the code in followLogs()
(daemon/logger/loggerutils/logfile.go#L626-L638) keeps to
send messages _synchronously_ (which is OK for now).

4. Logs consumer is gone (Ctrl-C is pressed on a terminal running
"docker logs --follow"). Method (*LogWatcher).Close() is properly
called (see daemon/logs.go:114). Since it was called before and
due to to once.Do(), nothing happens (which is kinda good, as
otherwise it will panic on closing a closed channel).

5. A goroutine (see item 3 above) keeps sending log messages
synchronously to the logWatcher.Msg channel. Since the
channel reader is gone, the channel send operation blocks forever,
and resource cleanup set up in defer statements at the beginning
of followLogs() never happens.

Alas, the fix is somewhat complicated:

1. Distinguish between close from logs producer and logs consumer.
To that effect,
 - yet another channel is added to LogWatcher();
 - {Watch,}Close() are renamed to {Watch,}ProducerGone();
 - {Watch,}ConsumerGone() are added;

*NOTE* that ProducerGone()/WatchProducerGone() pair is ONLY needed
in order to stop ConsumerLogs(follow=true) when a container is stopped;
otherwise we're not interested in it. In other words, we're only
using it in followLogs().

2. Code that was doing (logWatcher*).Close() is modified to either call
ProducerGone() or ConsumerGone(), depending on the context.

3. Code that was waiting for WatchClose() is modified to wait for
either ConsumerGone() or ProducerGone(), or both, depending on the
context.

4. followLogs() are modified accordingly:
 - context cancellation is happening on WatchProducerGone(),
and once it's received the FileWatcher is closed and waitRead()
returns errDone on EOF (i.e. log rotation handling logic is disabled);
 - due to this, code that was writing synchronously to logWatcher.Msg
can be and is removed as the code above it handles this case;
 - function returns once ConsumerGone is received, freeing all the
resources -- this is the bugfix itself.

While at it,

1. Let's also remove the ctx usage to simplify the code a bit.
It was introduced by commit a69a59ffc7e3d ("Decouple removing the
fileWatcher from reading") in order to fix a bug. The bug was actually
a deadlock in fsnotify, and the fix was just a workaround. Since then
the fsnofify bug has been fixed, and a new fsnotify was vendored in.
For more details, please see
https://github.com/moby/moby/pull/27782#issuecomment-416794490

2. Since `(*filePoller).Close()` is fixed to remove all the files
being watched, there is no need to explicitly call
fileWatcher.Remove(name) anymore, so get rid of the extra code.

Should fix https://github.com/moby/moby/issues/37391

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 916eabd459fe707b5c4a86377d12e2ad1871b353)
Upstream-commit: 84a5b528aede5579861201e869870d10fc98c07c
Component: engine
2018-09-06 18:39:22 -07:00
a76b67642d daemon/logger/loggerutils: add TestFollowLogsClose
This test case checks that followLogs() exits once the reader is gone.
Currently it does not (i.e. this test is supposed to fail) due to #37391.

[kolyshkin@: test case Brian Goff, changelog and all bugs are by me]
Source: https://gist.github.com/cpuguy83/e538793de18c762608358ee0eaddc197

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit d37a11bfbab83ab42b1160f116e863daac046192)
Upstream-commit: 511741735e0aa2fe68a66d99384c00d187d1a157
Component: engine
2018-09-06 18:39:22 -07:00
e5cc6e7dc4 daemon.ContainerLogs: minor debug logging cleanup
This code has many return statements, for some of them the
"end logs" or "end stream" message was not printed, giving
the impression that this "for" loop never ended.

Make sure that "begin logs" is to be followed by "end logs".

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 2e4c2a6bf9cb47fd07e42f9c043024ed3dbcd04d)
Upstream-commit: 2b8bc86679b7153bb4ace063a858637df0f16a2e
Component: engine
2018-09-06 18:39:22 -07:00
21c28e4566 pkg/filenotify/poller: fix Close()
The code in Close() that removes the watches was not working,
because it first sets `w.closed = true` and then calls w.close(),
which starts with
```
        if w.closed {
                return errPollerClosed
	}
```

Fix by setting w.closed only after calling w.remove() for all the
files being watched.

While at it, remove the duplicated `delete(w.watches, name)` code.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit fffa8958d00860b4e3563327a2cc6836a12d4ba9)
Upstream-commit: 4e2dbfa1af48191126b0910b9463bf94d8371886
Component: engine
2018-09-06 18:39:21 -07:00
abbd665e30 pkg/filenotify/poller: close file asap
There is no need to wait for up to 200ms in order to close
the file descriptor once the chClose is received.

This commit might reduce the chances for occasional "The process
cannot access the file because it is being used by another process"
error on Windows, where an opened file can't be removed.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit dfbb64ea7d042d5b2bb0c1c2b88e3682b7069b10)
Upstream-commit: 3a3bfcbf47e98212abfc9cfed860d9e99fc41cdc
Component: engine
2018-09-06 18:39:21 -07:00