Commit graph

160 commits

Author SHA1 Message Date
Sebastiaan van Stijn
a258ef58d8 Merge pull request #32284 from aaronlehmann/fix-service-defaults
Improve default handling for "service create"
2017-04-11 13:06:53 +02:00
Aaron Lehmann
1d274e9acf Change "service inspect" to show defaults in place of empty fields
This adds a new parameter insertDefaults to /services/{id}. When this is
set, an empty field (such as UpdateConfig) will be populated with
default values in the API response. Make "service inspect" use this, so
that empty fields do not result in missing information when inspecting a
service.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-04-10 13:41:16 -07:00
Drew Erny
306cfecc8c Remove experimental from service logs
Service logs API is now stable. Service logs now support all features,
except retrieving details provided to the log driver.

Signed-off-by: Drew Erny <drew.erny@docker.com>
2017-04-10 13:40:45 -07:00
allencloud
412099baa9 add hosts example for serviceSpec in swagger.yml
Signed-off-by: allencloud <allen.sun@daocloud.io>
2017-04-07 17:06:52 +08:00
Aaron Lehmann
9b54994a8a Add support for update order
This parameter controls the order of operations when rolling out an
update task. Either the old task is stopped before starting the new one,
or the new task is started first, and the running tasks will briefly
overlap.

This commit adds Rollout to the API, and --update-order / --rollback-order
flags to the CLI.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-04-06 17:23:36 -07:00
Elias Faxö
e401f63735 Added start period option to health check.
Signed-off-by: Elias Faxö <elias.faxo@gmail.com>
2017-04-06 12:35:34 +02:00
Victor Vieux
170be9c267 Merge pull request #32015 from dperny/service-logs-support-task-logs
Add Support for Service Task Logs
2017-04-04 00:15:13 -07:00
Drew Erny
d330dc3223 Add support for task and arbitrary combo logs
Refactored the API to more easily accept new endpoints. Added REST,
client, and CLI endpoints for getting logs from a specific task. All
that is needed after this commit to enable arbitrary service log
selectors is a REST endpoint and handler.

Task logs can be retrieved by putting in a task ID at the CLI instead of
a service ID.

Signed-off-by: Drew Erny <drew.erny@docker.com>
2017-04-03 18:40:54 -07:00
Vincent Demeester
9f9cc221bd Merge pull request #31634 from AkihiroSuda/clarify-env-without-value
api: clarify that Env var without `=` is removed from the environment
2017-03-31 17:34:32 +02:00
Sebastiaan van Stijn
4df350b8c7 Merge pull request #30810 from allencloud/make-secret-ls-support-filter
make secret ls support filters in CLI
2017-03-28 13:43:19 +02:00
Sebastiaan van Stijn
abecc530ee Merge pull request #32107 from mkumatag/fix_api_doc
Fix Healthcheck API doc
2017-03-27 18:45:48 +02:00
allencloud
3935074016 make secret ls support filters in CLI
Signed-off-by: allencloud <allen.sun@daocloud.io>
2017-03-27 10:16:45 +08:00
Alessandro Boch
d59d19c328 Allow user to modify ingress network
Signed-off-by: Alessandro Boch <aboch@docker.com>
2017-03-26 15:46:18 -07:00
Manjunath A Kumatagi
4df54695ef Fix Healthcheck API doc
Signed-off-by: Manjunath A Kumatagi <mkumatag@in.ibm.com>
2017-03-26 08:45:11 -04:00
Yong Tang
704ea8f6b4 Add --filter scope=swarm|local for docker network ls
This fix tries to address the request in 31324 by adding
`--filter scope=swarm|local` for `docker network ls`.

As `docker network ls` has a `SCOPE` column by default,
it is natural to add the support of `--filter scope=swarm|local`.

This fix adds the `scope=swarm|local` support for
`docker network ls --filter`.

Related docs has been updated.

Additional unit test cases have been added.

This fix fixes 31324.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-03-23 18:48:11 -07:00
Tibor Vass
0caced4644 Merge pull request #31715 from anusha-ragunathan/ipc-host
Add support in plugin config for accessing host ipc and pid namespace.
2017-03-22 14:17:21 -07:00
Anusha Ragunathan
342ed107bc Embed DockerVersion in plugin config.
Embedding DockerVersion in plugin config when the plugin is created,
enables users to do a docker plugin inspect and know which version
the plugin was built on. This is helpful in cases where users are
running a new plugin on older docker releases and confused at
unexpected behavior.

By embedding DockerVersion in the config, we claim that there's no
guarantee that if the plugin config's DockerVersion is greater that
the version of the docker engine the plugin is executed against, the
plugin will work as expected.

For example, lets say:
- in 17.03, a plugin was released as johndoe/foo:v1
- in 17.05, the plugin uses the new ipchost config setting and author
publishes johndoe/foo:v2

In this case, johndoe/foo:v2 was built on 17.05 using ipchost, but is
running on docker-engine version 17.03. Since 17.05 > 17.03, there's
no guarantee that the plugin will work as expected. Ofcourse, if the
plugin did not use newly added config settings (ipchost in this case)
in 17.05, it would work fine in 17.03.

Signed-off-by: Anusha Ragunathan <anusha.ragunathan@docker.com>
2017-03-22 10:26:20 -07:00
Anusha Ragunathan
4d1edcb2cc Add pid host support
Tested using global-net-plugin-ipc which sets PidHost in config.json.

Plugins might need access to host pid namespace. Add support for that.
Tested using aragunathan/global-net-plugin-ipc which sets "pidhost" in
config.json. Observed using `readlink /proc/self/ns/pid` that plugin and
host have the same ns.

Signed-off-by: Anusha Ragunathan <anusha.ragunathan@docker.com>
2017-03-21 13:39:01 -07:00
Anusha Ragunathan
6d6185c257 Add support in plugin config for accessing host ipc namespace.
Plugins might need access to host ipc namespace. A good usecase is
a volume plugin running iscsi multipath commands that need access to
host kernel locks.
Tested with a custom plugin (aragunathan/global-net-plugin-full) that's
built with `"ipchost" : true` in config.json. Observed using
`readlink /proc/self/ns/ipc` that plugin and host have the same ns.

Signed-off-by: Anusha Ragunathan <anusha.ragunathan@docker.com>
2017-03-21 13:39:01 -07:00
Jeremy Yallop
1a710c1660 Documentation for bind mount consistency flags.
Signed-off-by: Jeremy Yallop <yallop@docker.com>
2017-03-21 11:55:33 +00:00
Sebastiaan van Stijn
b36ce6f2f6 Merge pull request #31538 from yongtang/31325-service-ls-filter-mode
Support `--filter mode=global|replicated` for `docker service ls`
2017-03-16 01:42:55 +01:00
Yong Tang
43a1bd564b Support --filter mode=global|replicated for docker service ls
This fix tries to address the request in 31325 by adding
`--filter mode=global|replicated` to `docker service ls`.

As `docker service ls` has a `MODE` column by default, it is natural
to support `--filter mode=global|replicated` for `docker service ls`.

There are multiple ways to address the issue. One way is to pass
the filter of mode to SwarmKit, another way is to process the filter
of mode in the daemon.

This fix process the filter in the daemon.

Related docs has been updated.

An integration test has been added.

This fix fixes 31325.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-03-15 11:06:57 -07:00
Victor Vieux
817106aaa1 prepare master for the next release
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2017-03-14 20:43:33 -07:00
Victor Vieux
cec9594947 Merge pull request #31790 from mlaventure/devicecgrouprules-api-swagger
Update swagger.yaml and api/version-history.md for DeviceCgrouprules
2017-03-14 16:51:09 -07:00
Victor Vieux
cd173a6030 bump API to 1.28
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2017-03-14 09:32:50 -07:00
Kenfe-Mickael Laventure
6e97f11df9 Update swagger.yaml and api/version-history.md for DeviceCgrouprules
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2017-03-14 07:24:29 -07:00
Madhu Venugopal
cdf66ba715 Merge pull request #31710 from sanimej/drillerrr
Add verbose flag to network inspect to show all services & tasks in swarm mode
2017-03-13 21:12:32 -07:00
Santhosh Manohar
14f76a21db Enhance network inspect to show all tasks, local & non-local, in swarm mode
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2017-03-13 17:52:08 -07:00
Justin Cormack
2c6a1e1878 Merge pull request #31579 from ijc25/cpuacct
Correct CPU usage calculation in presence of offline CPUs and newer Linux
2017-03-13 16:32:18 +00:00
Brian Goff
c29c2a9a70 Merge pull request #31679 from allencloud/put-secret-in-swarm-thing
move secret into swarm thing in swagger
2017-03-10 13:50:25 -05:00
Ian Campbell
115f91d757 Correct CPU usage calculation in presence of offline CPUs and newer Linux
In https://github.com/torvalds/linux/commit/5ca3726 (released in v4.7-rc1) the
content of the `cpuacct.usage_percpu` file in sysfs was changed to include both
online and offline cpus. This broke the arithmetic in the stats helpers used by
`docker stats`, since it was using the length of the PerCPUUsage array as a
proxy for the number of online CPUs.

Add current number of online CPUs to types.StatsJSON and use it in the
calculation.

Keep a fallback to `len(v.CPUStats.CPUUsage.PercpuUsage)` so this code
continues to work when talking to an older daemon. An old client talking to a
new daemon will ignore the new field and behave as before.

Fixes #28941.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2017-03-10 10:24:33 +00:00
allencloud
6918624985 move secret into swarm thing in swagger
Signed-off-by: allencloud <allen.sun@daocloud.io>
2017-03-10 10:20:55 +08:00
Boaz Shuster
0ec8f56a3d Fix the rm error message when a container is restarting/paused
Running the rm command on a paused/restarting container
will give an error message saying the container is running
which is incorrect.

To fix that, the error message will have the correct
container state and a procedure to remove it accordingly.

Notice: docker-py was bumped to:
        4a08d04aef0595322e1b5ac7c52f28a931da85a5

Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
2017-03-10 00:39:16 +02:00
Akihiro Suda
1921fad6f5 api: clarify that Env var without = is removed from the environment
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2017-03-08 04:27:25 +00:00
allencloud
9d30525a04 make secret update support name and id prefix
Signed-off-by: allencloud <allen.sun@daocloud.io>
2017-03-07 16:01:21 +08:00
Aaron Lehmann
f9bd8ec8b2 Implement server-side rollback, for daemon versions that support this
Server-side rollback can take advantage of the rollback-specific update
parameters, instead of being treated as a normal update that happens to
go back to a previous version of the spec.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-03-03 16:33:34 -08:00
Aaron Lehmann
3a88a24d23 Add support for rollback flags
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-03-03 16:33:34 -08:00
Aaron Lehmann
cc9d04647a Add support for the "rollback" failure action
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-03-03 16:33:34 -08:00
Sebastiaan van Stijn
3a5a1c3f3d Merge pull request #30725 from aaronlehmann/topology
Topology-aware scheduling
2017-03-03 15:01:12 +01:00
Sebastiaan van Stijn
e1da516598 Merge pull request #30265 from allencloud/add-CheckDuplicate-details-and-logic
add CheckDuplicate docs and logics in network
2017-03-03 14:18:52 +01:00
Sebastiaan van Stijn
bb9f19503c Merge pull request #30754 from yongtang/25696-stop-signal
Add `--stop-signal` for `service create` and `service update`
2017-03-01 18:10:57 +01:00
Aaron Lehmann
17288c611a Topology-aware scheduling
This adds support for placement preferences in Swarm services.

- Convert PlacementPreferences between GRPC API and HTTP API
- Add --placement-pref, --placement-pref-add and --placement-pref-rm to CLI
- Add support for placement preferences in service inspect --pretty
- Add integration test

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-02-27 13:29:54 -08:00
Sebastiaan van Stijn
a64ea37753 Merge pull request #30383 from TDAbboud/30096-add-host-docker-build
Add --add-host for docker build
2017-02-27 12:42:18 +01:00
Sebastiaan van Stijn
8d28fc8fc4 Merge pull request #30731 from shin-/plugin_privileges_param_fix
Parameter name in GetPluginPrivileges is "remote"
2017-02-23 19:39:28 +01:00
Victor Vieux
19cd2aa389 Merge pull request #31203 from yongtang/02202017-Swagger-ContainerSpec
Add missing fields in Swagger docs
2017-02-22 15:54:23 -08:00
Sebastiaan van Stijn
cf8408106d Merge pull request #31204 from yongtang/31179-Swagger-Secrets
Add missing Secrets in Swagger docs
2017-02-23 00:45:32 +01:00
Yong Tang
61e3e80b63 Improve documentation of Version usage for Swarm API
This fix is an attempt to improve the documentation of
`Version` usage for Swarm API in Swagger docs.

As is shown in the docs updates, `Version` field in Swarm
API is a way to ensure safe concurrency and determinism
so that multiple updates to the same swarm related objects
(Node, Service, etc) will not unintentially overwrite each other.

This fix fixes 29448.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-02-21 15:42:25 -08:00
Yong Tang
c2d49ec214 Add --stop-signal for service create and service update
This fix tries to address the issue raised in 25696 where
it was not possible to specify `--stop-signal` for `docker service create`
and `docker service update`, in order to use special signal to stop
the container.

This fix adds `--stop-signal` and update the `StopSignal` in `Config`
through `service create` and `service update`.

Related docs has been updated.

Integration test has been added.

This fix fixes 25696.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-02-21 15:19:45 -08:00
Yong Tang
7e6ce7c176 Add missing Secrets in Swagger docs
This fix tries to address the issue in 31179 where
secrets fields is missing for `docker service create`
or `docker service update`.

This fix adds Secrets for `ContainerSpec` in Swagger docs.

This fix fixes 31179.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-02-20 19:29:25 -08:00
Yong Tang
897e69143a Add missing fields in Swagger docs
This fix adds the missing fields of `Hostname`, `OpenStdin`,
`Hosts`, `Groups`, and `Healthcheck` to `ContainerSpec`.
This fix also moves the `Label` in `ContainerSpec` to align with
the definition order.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-02-20 16:06:20 -08:00