1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/runconfig
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
..
fixtures Move the runconfig.Parse() function into the runconfig/opts package. 2016-01-04 12:06:29 -05:00
opts Add --cpus flag to control cpu resources 2016-11-04 09:43:10 -07:00
compare.go Add engine-api types to docker 2016-09-07 11:05:58 -07:00
compare_test.go Add engine-api types to docker 2016-09-07 11:05:58 -07:00
config.go api: add TypeTmpfs to api/types/mount 2016-10-28 08:38:32 +00:00
config_test.go Add engine-api types to docker 2016-09-07 11:05:58 -07:00
config_unix.go Add engine-api types to docker 2016-09-07 11:05:58 -07:00
config_windows.go Add engine-api types to docker 2016-09-07 11:05:58 -07:00
errors.go Move errors/ to api/errors 2016-09-16 12:27:13 -04:00
hostconfig.go Add engine-api types to docker 2016-09-07 11:05:58 -07:00
hostconfig_solaris.go Implementing support for --cpu-rt-period and --cpu-rt-runtime so that 2016-10-26 11:33:06 -04:00
hostconfig_test.go Implementing support for --cpu-rt-period and --cpu-rt-runtime so that 2016-10-26 11:33:06 -04:00
hostconfig_unix.go Implementing support for --cpu-rt-period and --cpu-rt-runtime so that 2016-10-26 11:33:06 -04:00
hostconfig_windows.go Implementing support for --cpu-rt-period and --cpu-rt-runtime so that 2016-10-26 11:33:06 -04:00
streams.go Small log formatting fixes 2016-10-27 15:29:24 -07:00