moby--moby/daemon
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
..
caps Replace execdrivers with containerd implementation 2016-03-18 13:38:32 -07:00
cluster Merge pull request #27857 from vasil-yordanov/docker-service-hostname-2 2016-11-04 15:22:55 +01:00
events Merge pull request #25800 from vdemeester/25798-fix-event-actions 2016-10-28 05:20:49 +02:00
exec Small log formatting fixes 2016-10-27 15:29:24 -07:00
graphdriver Merge pull request #28006 from dmcgowan/clean-overlay2-layerstore 2016-11-02 23:16:38 -07:00
links
logger Merge pull request #28035 from thaJeztah/add-test-for-long-loglines 2016-11-04 07:59:20 +01:00
network Fix autostart for swarm scope connected containers 2016-09-13 14:21:58 -07:00
apparmor_default.go Replace execdrivers with containerd implementation 2016-03-18 13:38:32 -07:00
apparmor_default_unsupported.go Replace execdrivers with containerd implementation 2016-03-18 13:38:32 -07:00
archive.go Add engine-api types to docker 2016-09-07 11:05:58 -07:00
archive_unix.go Windows: docker cp consistent paths 2016-05-06 16:08:53 -07:00
archive_windows.go Windows: Remove TP4 support from main code 2016-04-06 12:12:20 -07:00
attach.go Move errors/ to api/errors 2016-09-16 12:27:13 -04:00
auth.go Add engine-api types to docker 2016-09-07 11:05:58 -07:00
cache.go Implement build cache based on history array 2016-09-23 11:30:06 -07:00
changes.go Windows: support docker diff 2016-10-28 11:06:54 -07:00
checkpoint.go Allow providing a custom storage directory for docker checkpoints 2016-10-28 07:56:05 -04:00
cluster.go add `docker network prune` 2016-10-25 06:43:54 +00:00
commit.go Add basic prometheus support 2016-10-27 10:34:38 -07:00
config.go Add basic prometheus support 2016-10-27 10:34:38 -07:00
config_experimental.go Make experimental a runtime flag 2016-10-24 15:20:01 -07:00
config_solaris.go Convert dockerd to use cobra and pflag 2016-08-25 13:09:03 -04:00
config_test.go fix config load error with ulimits 2016-10-17 18:48:40 +08:00
config_unix.go daemon: add a flag to override the default seccomp profile 2016-11-02 21:41:29 +01:00
config_unix_test.go fix config load error with ulimits 2016-10-17 18:48:40 +08:00
config_windows.go Windows: Calculate PID file after root 2016-10-17 11:48:51 -07:00
config_windows_test.go fix config load error with ulimits 2016-10-17 18:48:40 +08:00
container.go Move errors/ to api/errors 2016-09-16 12:27:13 -04:00
container_operations.go Handle NetworkDettach for the case of network-id 2016-11-03 15:56:35 -07:00
container_operations_solaris.go Fixed support for docker compose by allowing connect/disconnect on stopped containers 2016-09-21 13:29:17 -07:00
container_operations_unix.go Merge pull request #27367 from Microsoft/jjh/fieldsincontainer 2016-10-17 16:50:39 +02:00
container_operations_windows.go Windows: Factor out unused fields in container 2016-10-13 14:51:10 -07:00
create.go Generate container create response from swagger spec. 2016-10-31 11:16:02 -04:00
create_unix.go Add new `HostConfig` field, `Mounts`. 2016-09-13 09:55:35 -04:00
create_windows.go Windows: Fix COPY file . after WORKDIR 2016-10-30 13:12:27 -07:00
daemon.go Merge pull request #26276 from runcom/seccomp-conf 2016-11-04 15:45:30 +00:00
daemon_experimental.go Make experimental a runtime flag 2016-10-24 15:20:01 -07:00
daemon_linux.go Fix container mount cleanup issues 2016-03-30 17:25:49 -07:00
daemon_linux_test.go Fix container mount cleanup issues 2016-03-30 17:25:49 -07:00
daemon_solaris.go daemon: add a flag to override the default seccomp profile 2016-11-02 21:41:29 +01:00
daemon_test.go support insecure registry in configuration reload 2016-10-20 07:54:31 +08:00
daemon_unix.go Add `--cpus` flag to control cpu resources 2016-11-04 09:43:10 -07:00
daemon_unix_test.go Initialize libnetwork and IPAMDriver with pluginstore. 2016-10-03 10:40:05 -07:00
daemon_unsupported.go Get the Docker Engine to build clean on Solaris 2016-05-23 16:37:12 -07:00
daemon_windows.go Add `--cpus` flag to control cpu resources 2016-11-04 09:43:10 -07:00
debugtrap.go Spew debugging 2016-11-03 10:05:11 -07:00
debugtrap_unix.go Spew debugging 2016-11-03 10:05:11 -07:00
debugtrap_unsupported.go Spew debugging 2016-11-03 10:05:11 -07:00
debugtrap_windows.go Spew debugging 2016-11-03 10:05:11 -07:00
delete.go Add basic prometheus support 2016-10-27 10:34:38 -07:00
delete_test.go make client side know container removal in progress 2016-09-27 18:06:54 +08:00
discovery.go validate heartbeat in discovery cluster opts 2016-09-01 01:07:05 +08:00
discovery_test.go validate heartbeat in discovery cluster opts 2016-09-01 01:07:05 +08:00
disk_usage.go Add swagger.yaml 2016-10-20 13:24:23 -07:00
errors.go Move errors/ to api/errors 2016-09-16 12:27:13 -04:00
events.go Add engine-api types to docker 2016-09-07 11:05:58 -07:00
events_test.go Add engine-api types to docker 2016-09-07 11:05:58 -07:00
exec.go Move stdio attach from libcontainerd backend to callback 2016-10-24 00:20:36 -07:00
exec_linux.go Remove hacked Windows OCI spec, compile fixups 2016-09-27 12:07:35 -07:00
exec_solaris.go Get the Docker Engine to build clean on Solaris 2016-05-23 16:37:12 -07:00
exec_windows.go Windows: escape entrypoint before passing to libcontainerd 2016-03-30 12:59:50 -07:00
export.go pkg/archive: remove unnecessary Archive and Reader type 2016-10-20 19:31:24 -07:00
health.go Add basic prometheus support 2016-10-27 10:34:38 -07:00
health_test.go Add engine-api types to docker 2016-09-07 11:05:58 -07:00
image.go Deprecate repo:shortid syntax 2016-10-06 17:12:17 -07:00
image_delete.go Add basic prometheus support 2016-10-27 10:34:38 -07:00
image_exporter.go Move some image related methods & struct to smaller files 2016-05-21 22:36:11 +02:00
image_history.go Add basic prometheus support 2016-10-27 10:34:38 -07:00
image_inspect.go Inspect populate image OSVersion 2016-10-06 11:46:24 -07:00
image_pull.go Add engine-api types to docker 2016-09-07 11:05:58 -07:00
image_push.go Add engine-api types to docker 2016-09-07 11:05:58 -07:00
image_tag.go Generalize content addressable and reference storage 2016-09-15 18:08:19 -07:00
images.go Adds ability to squash image after build 2016-11-01 13:41:59 -04:00
import.go Add engine-api types to docker 2016-09-07 11:05:58 -07:00
info.go daemon: add a flag to override the default seccomp profile 2016-11-02 21:41:29 +01:00
inspect.go record pid of exec'd process 2016-10-20 17:06:11 +02:00
inspect_solaris.go Add engine-api types to docker 2016-09-07 11:05:58 -07:00
inspect_unix.go Add new `HostConfig` field, `Mounts`. 2016-09-13 09:55:35 -04:00
inspect_windows.go Add new `HostConfig` field, `Mounts`. 2016-09-13 09:55:35 -04:00
keys.go Change root_maxkeys 2016-06-27 10:23:37 -07:00
keys_unsupported.go Change root_maxkeys 2016-06-27 10:23:37 -07:00
kill.go Taking stop-signal into account when docker kill 2016-10-24 11:10:14 -07:00
links.go Add migration from sqlite links back to hostConfig 2016-01-11 11:31:29 -05:00
links_test.go Add engine-api types to docker 2016-09-07 11:05:58 -07:00
list.go Replace all "Filter" field with "Filters" for consistency 2016-11-01 23:09:30 +08:00
list_unix.go Get the Docker Engine to build clean on Solaris 2016-05-23 16:37:12 -07:00
list_windows.go
logdrivers_linux.go added logentries driver 2016-10-06 22:48:53 -03:00
logdrivers_windows.go added logentries driver 2016-10-06 22:48:53 -03:00
logs.go Move stdio attach from libcontainerd backend to callback 2016-10-24 00:20:36 -07:00
logs_test.go Add engine-api types to docker 2016-09-07 11:05:58 -07:00
metrics.go Add basic prometheus support 2016-10-27 10:34:38 -07:00
monitor.go Fix bunch of typos 2016-10-29 15:03:26 +08:00
monitor_linux.go Adding postRunProcessing infrastructure for hanlding Windows Update. 2016-04-06 14:03:05 -07:00
monitor_solaris.go Get the Docker Engine to build clean on Solaris 2016-05-23 16:37:12 -07:00
monitor_windows.go Move stdio attach from libcontainerd backend to callback 2016-10-24 00:20:36 -07:00
mounts.go Add new `HostConfig` field, `Mounts`. 2016-09-13 09:55:35 -04:00
names.go Added the word "container" to clarify the error message. 2016-08-22 13:41:17 -07:00
network.go Add basic prometheus support 2016-10-27 10:34:38 -07:00
oci_linux.go api: add TypeTmpfs to api/types/mount 2016-10-28 08:38:32 +00:00
oci_solaris.go Remove hacked Windows OCI spec, compile fixups 2016-09-27 12:07:35 -07:00
oci_windows.go Add `--cpus` flag to control cpu resources 2016-11-04 09:43:10 -07:00
pause.go Replace execdrivers with containerd implementation 2016-03-18 13:38:32 -07:00
prune.go add `docker network prune` 2016-10-25 06:43:54 +00:00
rename.go Fix docker rename with linked containers 2016-06-27 19:58:05 -07:00
resize.go Replace execdrivers with containerd implementation 2016-03-18 13:38:32 -07:00
restart.go Allow providing a custom storage directory for docker checkpoints 2016-10-28 07:56:05 -04:00
search.go Add engine-api types to docker 2016-09-07 11:05:58 -07:00
search_test.go Add engine-api types to docker 2016-09-07 11:05:58 -07:00
seccomp_disabled.go Replace old oci specs import with runtime-specs 2016-08-17 09:38:34 -07:00
seccomp_linux.go daemon: add a flag to override the default seccomp profile 2016-11-02 21:41:29 +01:00
seccomp_unsupported.go Fix seccomp output in `docker info` 2016-07-08 17:26:42 -07:00
selinux_linux.go
selinux_unsupported.go
start.go Ensure that SELinux Options are set when seccomp is already set 2016-11-03 13:23:53 -07:00
start_linux.go Remove restartmanager from libcontainerd 2016-10-07 12:09:54 -07:00
start_windows.go Remove restartmanager from libcontainerd 2016-10-07 12:09:54 -07:00
stats.go Windows: stats support 2016-09-16 11:56:15 -07:00
stats_collector.go Windows: stats support 2016-09-16 11:56:15 -07:00
stats_collector_solaris.go Get the Docker Engine to build clean on Solaris 2016-05-23 16:37:12 -07:00
stats_collector_unix.go Windows: stats support 2016-09-16 11:56:15 -07:00
stats_collector_windows.go Windows: stats support 2016-09-16 11:56:15 -07:00
stats_unix.go Removed engine-api leftovers 2016-09-21 12:36:52 +02:00
stats_windows.go Windows: stats support 2016-09-16 11:56:15 -07:00
stop.go Update `docker stop` and `docker restart` to allow not specifying timeout and use the one specified at container creation time. 2016-10-17 12:53:35 -07:00
top_unix.go Add engine-api types to docker 2016-09-07 11:05:58 -07:00
top_unix_test.go Validate arguments for `ps` in `docker top` 2016-07-08 05:58:11 +00:00
top_windows.go Windows: docker top implementation 2016-09-07 16:29:02 -07:00
unpause.go remove running judgement when unpause container 2016-08-29 10:16:18 +08:00
update.go Generate container update response from swagger spec. 2016-10-31 11:16:02 -04:00
update_linux.go Add engine-api types to docker 2016-09-07 11:05:58 -07:00
update_solaris.go Add engine-api types to docker 2016-09-07 11:05:58 -07:00
update_windows.go Add engine-api types to docker 2016-09-07 11:05:58 -07:00
volumes.go Fix bunch of typos 2016-10-29 15:03:26 +08:00
volumes_unit_test.go
volumes_unix.go api: add TypeTmpfs to api/types/mount 2016-10-28 08:38:32 +00:00
volumes_windows.go Remove hacked Windows OCI spec, compile fixups 2016-09-27 12:07:35 -07:00
wait.go Fix race on force deleting container created by task 2016-06-14 16:49:04 -07:00