1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/api
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
..
errors Move errors/ to api/errors 2016-09-16 12:27:13 -04:00
fixtures Add more unit tests (thus coverage) to pkg api 2015-08-04 19:51:02 +02:00
server daemon: add a flag to override the default seccomp profile 2016-11-02 21:41:29 +01:00
templates/server Update to inline comments. 2016-10-31 11:13:41 -04:00
types Add --cpus flag to control cpu resources 2016-11-04 09:43:10 -07:00
common.go Windows: Require REST 1.25 or later 2016-10-31 14:33:59 -07:00
common_test.go Add engine-api types to docker 2016-09-07 11:05:58 -07:00
common_unix.go Windows: Require REST 1.25 or later 2016-10-31 14:33:59 -07:00
common_windows.go Windows: Require REST 1.25 or later 2016-10-31 14:33:59 -07:00
README.md Update README.md 2014-07-04 18:21:13 +09:00
swagger-gen.yaml Use a config to generate swagger api types 2016-10-31 11:13:41 -04:00
swagger.yaml node rm can be applied on not only active node 2016-11-02 17:22:04 +08:00

This directory contains code pertaining to the Docker API:

  • Used by the docker client when communicating with the docker daemon

  • Used by third party tools wishing to interface with the docker daemon