1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/cli/command/service
Yong Tang 846baf1fd3 Add --cpus flag to control cpu resources
This fix tries to address the proposal raised in 27921 and add
`--cpus` flag for `docker run/create`.

Basically, `--cpus` will allow user to specify a number (possibly partial)
about how many CPUs the container will use. For example, on a 2-CPU system
`--cpus 1.5` means the container will take 75% (1.5/2) of the CPU share.

This fix adds a `NanoCPUs` field to `HostConfig` since swarmkit alreay
have a concept of NanoCPUs for tasks. The `--cpus` flag will translate
the number into reused `NanoCPUs` to be consistent.

This fix adds integration tests to cover the changes.

Related docs (`docker run` and Remote APIs) have been updated.

This fix fixes 27921.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-11-04 09:43:10 -07:00
..
cmd.go Only hide commands if the env variable is set. 2016-09-19 13:28:15 -04:00
create.go Merge pull request #27857 from vasil-yordanov/docker-service-hostname-2 2016-11-04 15:22:55 +01:00
inspect.go Fix typs from go to Go 2016-10-18 19:40:16 +08:00
inspect_test.go Fix broken JSON support in cli/command/formatter 2016-10-17 08:07:17 +00:00
list.go Replace all "Filter" field with "Filters" for consistency 2016-11-01 23:09:30 +08:00
opts.go Add --cpus flag to control cpu resources 2016-11-04 09:43:10 -07:00
opts_test.go Add --cpus flag to control cpu resources 2016-11-04 09:43:10 -07:00
ps.go Replace all "Filter" field with "Filters" for consistency 2016-11-01 23:09:30 +08:00
remove.go Move api/client -> cli/command 2016-09-08 15:46:29 -04:00
scale.go add replicated in service scale command description 2016-11-02 16:15:57 +08:00
update.go cli: add --mount to docker run 2016-11-03 07:08:59 +00:00
update_test.go Add --health-* commands to service create and update 2016-10-28 15:19:08 -02:00