Commit Graph

31406 Commits

Author SHA1 Message Date
8cb69b8ef5 Merge pull request #34405 from Microsoft/jjh/lcowworkdir
LCOW: WORKDIR correct handling
Upstream-commit: 30eb4d8cdc422b023d5f11f29a82ecb73554183b
Component: engine
2017-08-17 21:16:36 -05:00
8de8152c0b Merge pull request #34548 from dnephin/remove-some-cli-tests
Remove a couple cli-only tests from integration-cli
Upstream-commit: 098a7b3d53ae8267ec95e2935316b0e62b483b02
Component: engine
2017-08-18 10:03:45 +09:00
0acc3ead17 LCOW: WORKDIR correct handling
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 9fa449064cc499871d49f02b96a7e69c071ce50c
Component: engine
2017-08-17 15:29:17 -07:00
dd8d1a11c6 Merge pull request #34407 from dnephin/add-TESTING-doc
[Proposal] Document testing guidelines
Upstream-commit: 867a5999cefccefb3e0fb79ffa22f01dd7c1a5e1
Component: engine
2017-08-17 12:33:43 -07:00
c1824669c3 Add myself to CODEOWNERS for integration suite.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 9b094fc4a3845c1f1c8aed9730421aab096dadc1
Component: engine
2017-08-17 13:03:47 -04:00
dc46befdc9 Remove cli-only tests from integration-cli
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 98d8c96885593f8f085bf9607b7d817e23d7164c
Component: engine
2017-08-17 12:32:49 -04:00
5478a26336 Merge pull request #34528 from adshmh/client-should-return-image-not-found-for-404-status
client to return imageNotFound error if API returns 404 status code
Upstream-commit: db73f3daee21a28edbf6991d24a4653adc85f1a2
Component: engine
2017-08-16 13:18:00 -07:00
1c8e4b07c7 Merge pull request #34536 from thaJeztah/fix-makefile-warning
Fix make test-unit printing deprecation warning
Upstream-commit: 8bee1e9a3ba0884cf1bb0d7fa069fb3c5722af51
Component: engine
2017-08-16 11:16:04 -07:00
9156c95e0a Merge pull request #34188 from cpuguy83/32144_api_error_handling
Remove string checking in API error handling
Upstream-commit: 2afb3efaa63537cc152437af3cd7a6743fcb3d8d
Component: engine
2017-08-16 08:53:15 -07:00
3d5737e04c Fix make test-unit printing deprecation warning
Commit 1fb615599a83f41b449529df24f7e833c727e0ed moved the unit tests out
of `hack/make.sh`, however the Makefile still used the old path, resulting
in a warning being printed when the unit tests were run:

    ---> Making bundle: test-unit (in bundles/17.06.0-dev/test-unit)
    DEPRECATED: use hack/test/unit instead of hack/make.sh test-unit

This patch updates the Makefile to use the new command.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: c500bb562f6dfd1ae4a77f3a66175089ff8f74e8
Component: engine
2017-08-16 16:02:04 +02:00
ee29bacf1d Create definition for SystemInfo response
The `/info` endpoint was badly documented, missing various
fields and incorrectly describing others.

This patch defines a type for the endpoint, based on the
API types in the source.

Also removing the response example in favor of
per-field examples, as this prevents an incorrectly
formatted response from masking omissions in the
actual type.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 18b23067be82054a6384fc5934ecbb0276d1862b
Component: engine
2017-08-16 11:11:29 +02:00
81aceb39fb Remove redundant example for Node
All example values are now documented per field,
so are automatically used to generate responses.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 2720cefbb2eaac9f440cd7c1807b4222b18ee0c4
Component: engine
2017-08-16 11:11:19 +02:00
031f55b2f7 Add definition for Swarm inspect response
Also remove inline response examples

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 5b017ef45d68748b8f4065db137aa55e1ff0e8ab
Component: engine
2017-08-16 11:11:14 +02:00
3a37403bb9 Extract NodeDescription to a separate definition
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 33e2c994015cbc8f7e86bc1b764e17a7470a17ac
Component: engine
2017-08-16 11:11:09 +02:00
54e785932e Extract EngineDescription to a separate definition
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 7cb4a97ae195bce55b0a2e54e08b3cd1b4b190af
Component: engine
2017-08-16 11:11:04 +02:00
4645cfda21 Extract Platform to a separate definition
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: a2de2681a65d034ffb231b15b630b5a053608331
Component: engine
2017-08-16 11:10:58 +02:00
d0c8aa84bd Add missing definition for Node.ManagerStatus
The `Node.ManagerStatus`  property was only present in
the example, but not in the definition.

This patch adds definitions for `ManagerStatus`
and `Reachability`, similar to what is used in the
code;
f02a5b50c4/api/types/swarm/node.go (L84-L101)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 3f1ad79faf3bfecc19722eb6541bb415024dafe4
Component: engine
2017-08-16 11:10:53 +02:00
9fee66bce7 Add missing definition for Node.Status
The `Node.Status`  property was only present in
the example, but not in the definition.

This patch adds definitions for `NodeStatus`
and `NodeState`, similar to what is used in the
code;

- f02a5b50c4/api/types/swarm/node.go (L77-L82)
- f02a5b50c4/api/types/swarm/node.go (L103-L115)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 26b247e706e613af5214e4a89de375128f3368dd
Component: engine
2017-08-16 11:10:47 +02:00
6526a15536 Fix TLSInfo in Node specification
- `TLSInfo` is part of `Node.Description`, but was documented as a
  direct child of `Node`
- `Node.TLSInfo` incorrectly was using the `SwarmSpec` type,
  instead of `TLSInfo`

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: b2de157a41bbd18ca4317792614e8630d73a7102
Component: engine
2017-08-16 11:10:42 +02:00
d3b3ce345c Update incorrect types in Swagger
- `ObjectVersion.Index` is an `uint64` 0fd90c4d5d/api/types/swarm/common.go (L5-L15)
- `ClusterInfo` is nullable in the `/info` output (see ff4f700f74/api/types/swarm/swarm.go (L203))
- `CAConfig.ForceRotate` was missing a type, therefore treated as an `object` in Swagger: ff4f700f74/api/types/swarm/swarm.go (L121)
- `Raft.SnapshotInterval`, `Raft.KeepOldSnapshots`, and `Raft.LogEntriesForSlowFollowers` are an `uint64` not an `int64`
- Various fields in `swarm.Info` are nullable; added `x-nullable`

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 93e324e2a7b8131414382b6fb38b69f0d09bc30c
Component: engine
2017-08-16 11:10:32 +02:00
da62e48708 Update / add extra description fields to Swagger
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 934378bee3846b1f0b790d3ee185d161900cb953
Component: engine
2017-08-16 11:10:27 +02:00
d01174e4e5 Add extra example values to definitions
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: fa05a53426da6183199a97071e3d60a6d41a39be
Component: engine
2017-08-16 11:10:22 +02:00
8a9c9ec9a9 Reformat definitions - add some whitespace
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: f720f9cc33e1be12b767f5066511266d87a7673b
Component: engine
2017-08-16 11:10:14 +02:00
12bfda3c10 Merge pull request #34478 from thaJeztah/fix-swagger-todos
Update NetworkConfig definition in Swagger
Upstream-commit: 1454015ce96510fb677ab85bf26610f559a0c613
Component: engine
2017-08-16 11:07:25 +02:00
e89e83b8bc client should return imageNotFound error when API returns 404 status code
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
Upstream-commit: 33d82b78d03f7db4ef743951c6a004ba4fe64637
Component: engine
2017-08-15 17:16:02 -04:00
30f1b651e2 Remove string checking in API error handling
Use strongly typed errors to set HTTP status codes.
Error interfaces are defined in the api/errors package and errors
returned from controllers are checked against these interfaces.

Errors can be wraeped in a pkg/errors.Causer, as long as somewhere in the
line of causes one of the interfaces is implemented. The special error
interfaces take precedence over Causer, meaning if both Causer and one
of the new error interfaces are implemented, the Causer is not
traversed.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: ebcb7d6b406fe50ea9a237c73004d75884184c33
Component: engine
2017-08-15 16:01:11 -04:00
13f12ea9ac Merge pull request #34508 from Microsoft/jjh/mergestorageopt
Merge global storage options on create
Upstream-commit: cd902848e913aead3e8242eca8a6ed6c67e589e1
Component: engine
2017-08-15 18:13:13 +02:00
e80c7b1a0c Merge pull request #34504 from fcrisciani/ln-vendoring
Libnetwork vendoring
Upstream-commit: 036314622de7cfc62b5f9a88c849faf17c9bc1d3
Component: engine
2017-08-15 08:06:26 -07:00
7eea9c9616 Merge pull request #34109 from yummypeng/rm-link-when-rm-container
Bugfix: Remove links when remove container
Upstream-commit: b6498340b2baa6596553b2b56b43990a365a7b6a
Component: engine
2017-08-15 09:43:00 -04:00
9522e0432e Merge pull request #33450 from naveed-jamil-tenpearls/pkg/signal/trap
Add test coverage to signal/trap.go
Upstream-commit: 479cc38bb94178d48609def34dfb0eae87a9a815
Component: engine
2017-08-15 00:53:37 -07:00
f6b9be5da8 Update NetworkConfig definition in Swagger
This patch updates the definition of `NetworkConfig` to match the code, and
renames to the definition to `NetworkSettings` (also to match the type in
the code).

Add definitions for:

- `Address`
- `PortMap`
- `PortBinding`
- `EndpointIPAMConfig`

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: b98ceb7121c5513c73d69081737ad824384c5391
Component: engine
2017-08-15 09:39:41 +02:00
fe13f30f0f Merge global storage options on create
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 932ae425e8a8aac86f70c249f3a0304101e83614
Component: engine
2017-08-14 15:47:54 -07:00
a71e5a5cde Merge pull request #34487 from tonistiigi/host-suffix-fix
Fix requests for docker host ending with slash
Upstream-commit: f148337da9afef5ecc06d1719d19a770079929ef
Component: engine
2017-08-14 13:29:02 -07:00
4233bbe278 Libnetwork vendoring
Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
Upstream-commit: 167564a798365d9924260e721954b7ca43322726
Component: engine
2017-08-14 09:31:23 -07:00
9685380dbb Merge pull request #34492 from AkihiroSuda/fix-integration-cli-on-swarm
Fix `make build-integration-cli-on-swarm`
Upstream-commit: 07227a1227e1cdecdd89060d98bf67d0f49503e6
Component: engine
2017-08-14 12:20:18 -04:00
13c5fe42cf Merge pull request #34419 from keloyang/config.v2.json
security: Chmod config.v2.json to 0600
Upstream-commit: e4c19aa529342e0c8947288cbf9a8cbbf025100a
Component: engine
2017-08-14 08:39:58 -07:00
fbf74e8b6c Merge pull request #34486 from kolyshkin/dm-misc
Misc fixes for devmapper
Upstream-commit: af3a9e33145add7994b3e8ea246fa5e5118a45bd
Component: engine
2017-08-14 17:20:40 +02:00
2b769b8b71 Merge pull request #34362 from kolyshkin/update-libdevmapper
Dockerfile*: bump devmapper library version
Upstream-commit: 31d8d2253ebb77ef7b341606cbdf0e76835e64db
Component: engine
2017-08-14 09:56:43 -04:00
99367ff683 Merge pull request #34087 from kolyshkin/ipcmode
Implement private and shareable ipc modes
Upstream-commit: bb6fc72cd2bd0f194940c7710d8ed8cf3fb99d21
Component: engine
2017-08-14 15:52:21 +02:00
ded67f686e devmapper autosetup: add check for thin_check
I was able to successfully use device mapper autoconfig feature
(commit 5ef07d79c) but it stopped working after a reboot.

Investigation shown that the dm device was not activated because of
a missing binary, that is not used during initial setup, but every
following time. Here's an error shown when trying to manually activate
the device:

> kir@kd:~/go/src/github.com/docker/docker$ sudo lvchange -a y /dev/docker/thinpool
> /usr/sbin/thin_check: execvp failed: No such file or directory
> Check of pool docker/thinpool failed (status:2). Manual repair required!

Surely, there is no solution to this other than to have a package that
provides the thin_check binary installed beforehand. Due to the fact
the issue revealed itself way later than DM setup was performed, it was
somewhat harder to investigate.

With this in mind, let's check for binary presense before setting up DM,
refusing to proceed if the binary is not there, saving a user from later
frustration.

While at it, eliminate repeated binary checking code. The downside is
that the binary lookup is happening more than once now -- I think the
clarity of code overweights this minor de-optimization.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 58a453f3f06c1daf34544da8aa16bb95e8e18010
Component: engine
2017-08-14 13:25:28 +03:00
1a431d82d1 Test cases for new ipc modes
These test cases cover various arguments for docker create/run --ipc
option, as well as daemon's --default-ipc-mode cli option and
configuration file parameter.

For the description of container IPC modes, see previous commit.

To run these:

	TESTFLAGS='-check.f IpcMode' make test-integration-cli

[v2: simplify TestDaemonEvents(), add default-ipc-mode presense check]
[v3: add TestDaemonIpcModeVSRestart]
[v4: ipcmode test now uses client lib instead of CLI (except for exec)]
[v5: nitpicks in comments]
[v6: add test case for "none"; fix a typo; simplify TestDaemonEvents() more]

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 9a60e1cc874402d10eb7e45f62cce25bf5c41d30
Component: engine
2017-08-14 11:00:26 +03:00
eca24fb7b0 Implement none, private, and shareable ipc modes
Since the commit d88fe447df0e8 ("Add support for sharing /dev/shm/ and
/dev/mqueue between containers") container's /dev/shm is mounted on the
host first, then bind-mounted inside the container. This is done that
way in order to be able to share this container's IPC namespace
(and the /dev/shm mount point) with another container.

Unfortunately, this functionality breaks container checkpoint/restore
(even if IPC is not shared). Since /dev/shm is an external mount, its
contents is not saved by `criu checkpoint`, and so upon restore any
application that tries to access data under /dev/shm is severily
disappointed (which usually results in a fatal crash).

This commit solves the issue by introducing new IPC modes for containers
(in addition to 'host' and 'container:ID'). The new modes are:

 - 'shareable':	enables sharing this container's IPC with others
		(this used to be the implicit default);

 - 'private':	disables sharing this container's IPC.

In 'private' mode, container's /dev/shm is truly mounted inside the
container, without any bind-mounting from the host, which solves the
issue.

While at it, let's also implement 'none' mode. The motivation, as
eloquently put by Justin Cormack, is:

> I wondered a while back about having a none shm mode, as currently it is
> not possible to have a totally unwriteable container as there is always
> a /dev/shm writeable mount. It is a bit of a niche case (and clearly
> should never be allowed to be daemon default) but it would be trivial to
> add now so maybe we should...

...so here's yet yet another mode:

 - 'none':	no /dev/shm mount inside the container (though it still
		has its own private IPC namespace).

Now, to ultimately solve the abovementioned checkpoint/restore issue, we'd
need to make 'private' the default mode, but unfortunately it breaks the
backward compatibility. So, let's make the default container IPC mode
per-daemon configurable (with the built-in default set to 'shareable'
for now). The default can be changed either via a daemon CLI option
(--default-shm-mode) or a daemon.json configuration file parameter
of the same name.

Note one can only set either 'shareable' or 'private' IPC modes as a
daemon default (i.e. in this context 'host', 'container', or 'none'
do not make much sense).

Some other changes this patch introduces are:

1. A mount for /dev/shm is added to default OCI Linux spec.

2. IpcMode.Valid() is simplified to remove duplicated code that parsed
   'container:ID' form. Note the old version used to check that ID does
   not contain a semicolon -- this is no longer the case (tests are
   modified accordingly). The motivation is we should either do a
   proper check for container ID validity, or don't check it at all
   (since it is checked in other places anyway). I chose the latter.

3. IpcMode.Container() is modified to not return container ID if the
   mode value does not start with "container:", unifying the check to
   be the same as in IpcMode.IsContainer().

3. IPC mode unit tests (runconfig/hostconfig_test.go) are modified
   to add checks for newly added values.

[v2: addressed review at https://github.com/moby/moby/pull/34087#pullrequestreview-51345997]
[v3: addressed review at https://github.com/moby/moby/pull/34087#pullrequestreview-53902833]
[v4: addressed the case of upgrading from older daemon, in this case
     container.HostConfig.IpcMode is unset and this is valid]
[v5: document old and new IpcMode values in api/swagger.yaml]
[v6: add the 'none' mode, changelog entry to docs/api/version-history.md]

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 7120976d74195a60334c688a061270a4d95f9aeb
Component: engine
2017-08-14 10:50:39 +03:00
94157b8e90 devmapper: refer to dockerd man page
...not the docker one.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 8b7bd58869725dce2f0fcfd582d23dc5e0cfcf8e
Component: engine
2017-08-14 10:09:58 +03:00
d92c40217f devmapper autoconfig: add mkdir
I tried using dm.directlvm_device but it ended up with the following
error:

> Error starting daemon: error initializing graphdriver: error
> writing docker thinp autoextend profile: open
> /etc/lvm/profile/docker-thinpool.profile: no such file or directory

The reason is /etc/lvm/profile directory does not exist. I think it is
better to try creating it beforehand.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 6ca20ec771ab7c0ebf64c20021ca795746cf3ccb
Component: engine
2017-08-14 10:09:34 +03:00
bb626a427e Fix make build-integration-cli-on-swarm
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
Upstream-commit: 2fddf9f6efc155c880dfa689bd7df3a5a31ba459
Component: engine
2017-08-12 06:53:25 +00:00
417e5624cd Fix requests for docker host ending with slash
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 823e88d4c4298c38130b9a387a45c47cf957a931
Component: engine
2017-08-11 10:47:02 -07:00
0f9d35cd6f Merge pull request #34000 from dnephin/test-integration-api
Introduce `test-integration` target
Upstream-commit: f34e4d295d5c17a78c33beb14b65e5d001c16968
Component: engine
2017-08-11 10:39:27 -07:00
2e5f24be1e Use container.HostConfig.ShmSize directly
It was noted[1] that container's HostConfig.ShmSize, if not set, should be
initialized to daemon default value during container creation.

In fact, it is already done in daemon.adaptContainerSettings, so we can use
value from container.HostConfig directly.

[1] https://github.com/moby/moby/pull/34087#discussion_r128656429

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 0fb1fb1ce0177cf31dd96e9fdb4a5f55155a5966
Component: engine
2017-08-11 03:29:27 -07:00
5963ab8f5e Merge pull request #34378 from fcrisciani/ln-vendoring
Vendoring libnetwork
Upstream-commit: aaee3ca6c1129f62eaa64a76a3f770ae09d04d09
Component: engine
2017-08-10 17:07:14 -07:00
c020b02684 Merge pull request #34452 from Microsoft/jjh/gowiniov0.4.5
Revendor Microsoft/go-winio @ v0.4.5
Upstream-commit: 45248ae668cd8ab02cf597ab9e9f72564a262f6c
Component: engine
2017-08-10 17:05:36 -07:00