Commit graph

33283 commits

Author SHA1 Message Date
Sebastiaan van Stijn
a2de2681a6
Extract Platform to a separate definition
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-08-16 11:10:58 +02:00
Sebastiaan van Stijn
3f1ad79faf
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>
2017-08-16 11:10:53 +02:00
Sebastiaan van Stijn
26b247e706
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>
2017-08-16 11:10:47 +02:00
Sebastiaan van Stijn
b2de157a41
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>
2017-08-16 11:10:42 +02:00
Sebastiaan van Stijn
93e324e2a7
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>
2017-08-16 11:10:32 +02:00
Sebastiaan van Stijn
934378bee3
Update / add extra description fields to Swagger
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-08-16 11:10:27 +02:00
Sebastiaan van Stijn
fa05a53426
Add extra example values to definitions
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-08-16 11:10:22 +02:00
Sebastiaan van Stijn
f720f9cc33
Reformat definitions - add some whitespace
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-08-16 11:10:14 +02:00
Sebastiaan van Stijn
1454015ce9 Merge pull request #34478 from thaJeztah/fix-swagger-todos
Update NetworkConfig definition in Swagger
2017-08-16 11:07:25 +02:00
Sebastiaan van Stijn
cd902848e9 Merge pull request #34508 from Microsoft/jjh/mergestorageopt
Merge global storage options on create
2017-08-15 18:13:13 +02:00
Madhu Venugopal
036314622d Merge pull request #34504 from fcrisciani/ln-vendoring
Libnetwork vendoring
2017-08-15 08:06:26 -07:00
Brian Goff
b6498340b2 Merge pull request #34109 from yummypeng/rm-link-when-rm-container
Bugfix: Remove links when remove container
2017-08-15 09:43:00 -04:00
Yong Tang
479cc38bb9 Merge pull request #33450 from naveed-jamil-tenpearls/pkg/signal/trap
Add test coverage to signal/trap.go
2017-08-15 00:53:37 -07:00
Sebastiaan van Stijn
b98ceb7121
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>
2017-08-15 09:39:41 +02:00
John Howard
932ae425e8 Merge global storage options on create
Signed-off-by: John Howard <jhoward@microsoft.com>
2017-08-14 15:47:54 -07:00
Victor Vieux
f148337da9 Merge pull request #34487 from tonistiigi/host-suffix-fix
Fix requests for docker host ending with slash
2017-08-14 13:29:02 -07:00
Flavio Crisciani
167564a798
Libnetwork vendoring
Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-08-14 09:31:23 -07:00
Daniel Nephin
07227a1227 Merge pull request #34492 from AkihiroSuda/fix-integration-cli-on-swarm
Fix `make build-integration-cli-on-swarm`
2017-08-14 12:20:18 -04:00
Yong Tang
e4c19aa529 Merge pull request #34419 from keloyang/config.v2.json
security: Chmod config.v2.json to 0600
2017-08-14 08:39:58 -07:00
Sebastiaan van Stijn
af3a9e3314 Merge pull request #34486 from kolyshkin/dm-misc
Misc fixes for devmapper
2017-08-14 17:20:40 +02:00
Brian Goff
31d8d2253e Merge pull request #34362 from kolyshkin/update-libdevmapper
Dockerfile*: bump devmapper library version
2017-08-14 09:56:43 -04:00
Sebastiaan van Stijn
bb6fc72cd2 Merge pull request #34087 from kolyshkin/ipcmode
Implement private and shareable ipc modes
2017-08-14 15:52:21 +02:00
Kir Kolyshkin
58a453f3f0 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>
2017-08-14 13:25:28 +03:00
Kir Kolyshkin
9a60e1cc87 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>
2017-08-14 11:00:26 +03:00
Kir Kolyshkin
7120976d74 Implement none, private, and shareable ipc modes
Since the commit d88fe447df ("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>
2017-08-14 10:50:39 +03:00
Kir Kolyshkin
8b7bd58869 devmapper: refer to dockerd man page
...not the docker one.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2017-08-14 10:09:58 +03:00
Kir Kolyshkin
6ca20ec771 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>
2017-08-14 10:09:34 +03:00
Akihiro Suda
2fddf9f6ef Fix make build-integration-cli-on-swarm
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2017-08-12 06:53:25 +00:00
Tonis Tiigi
823e88d4c4 Fix requests for docker host ending with slash
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-08-11 10:47:02 -07:00
Tibor Vass
f34e4d295d Merge pull request #34000 from dnephin/test-integration-api
Introduce `test-integration` target
2017-08-11 10:39:27 -07:00
Kir Kolyshkin
0fb1fb1ce0 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>
2017-08-11 03:29:27 -07:00
Victor Vieux
aaee3ca6c1 Merge pull request #34378 from fcrisciani/ln-vendoring
Vendoring libnetwork
2017-08-10 17:07:14 -07:00
Yong Tang
45248ae668 Merge pull request #34452 from Microsoft/jjh/gowiniov0.4.5
Revendor Microsoft/go-winio @ v0.4.5
2017-08-10 17:05:36 -07:00
Yong Tang
2638729c7a Merge pull request #34470 from thaJeztah/fix-solaris-config
Fix solaris reference to config
2017-08-10 09:41:50 -07:00
Flavio Crisciani
709a433ec8
Vendoring libnetwork
Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-08-10 08:51:30 -07:00
Yong Tang
7ccd8bda77 Merge pull request #33722 from TomSweeneyRedHat/tsweeney/privmessage
Add clarification to --privileged error message
2017-08-09 16:08:10 -07:00
Sebastiaan van Stijn
2e38c07814 Merge pull request #34430 from AkihiroSuda/promote-overlay2
graphdriver: promote overlay2 over aufs
2017-08-09 21:41:36 +02:00
Sebastiaan van Stijn
335033e25f
Fix solaris reference to config
Commit db63f9370e
extracted  daemon configuration to its own
package, but did not update the Solaris stubs.

This updates the Solaris daemon.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-08-09 20:58:31 +02:00
Yong Tang
bbb401de87 Merge pull request #34445 from pmoust/f-seccomp-quotacl
seccomp: whitelist quotactl with CAP_SYS_ADMIN
2017-08-09 11:53:13 -07:00
Panagiotis Moustafellos
cf6e1c5dfd
seccomp: whitelist quotactl with CAP_SYS_ADMIN
The quotactl syscall is being whitelisted in default seccomp profile,
gated by CAP_SYS_ADMIN.

Signed-off-by: Panagiotis Moustafellos <pmoust@elastic.co>
2017-08-09 18:52:15 +03:00
Sebastiaan van Stijn
ab29a85103 Merge pull request #34455 from vieux/hide_swarm_plugins_exp
hide swarm plugins behind experimental flag
2017-08-09 17:52:14 +02:00
John Howard
779469d9c9 Revendor Microsoft/go-winio @ v0.4.5
Signed-off-by: John Howard <jhoward@microsoft.com>
2017-08-09 08:31:43 -07:00
Daniel Nephin
e593b72cc9 Fix exclude list in make.ps1
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-09 11:03:20 -04:00
Daniel Nephin
c66c0447ef move api test client setup to a package.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-09 11:02:57 -04:00
Daniel Nephin
5fa134b906 Protect images in the integration/ suite
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-09 11:02:57 -04:00
Daniel Nephin
4308e881cc Cleanup test output, and binaries.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-09 11:02:57 -04:00
Daniel Nephin
de46fb736d Add integration suite
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-09 11:02:57 -04:00
Daniel Nephin
bc82b13995 Remove test-integration-cli and references to it.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-09 11:02:57 -04:00
Vincent Demeester
6b025a8b66 Introduce test-integration target (and deprecate/freeze test-integration-cli)
This adds a new package `integration` where `engine` integration tests
should live. Those integration tests should not depends on any `cli`
components (except from the `dockerd` daemon for now — to actually
start a daemon).

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-08-09 11:02:57 -04:00
Yong Tang
187cd25517 Merge pull request #34276 from keloyang/testcase-docker-cp-hardlink
Add unit  test  for RebaseArchiveEntries
2017-08-09 07:29:09 -07:00