Allow to limit cgroup cpu shares
Related-bug: #1755605
Change-Id: I1f24866ea2ec01e3ef22571145efa25ab219bb3a
Signed-off-by: Bogdan Dobrelya <bdobreli@redhat.com>
(cherry picked from commit 4a4f43ac36
)
This commit is contained in:
parent
ccc7b278c1
commit
2ddf40d833
|
@ -188,6 +188,8 @@ class ComposeV1Builder(object):
|
|||
cmd.append('--volumes-from=%s' % v)
|
||||
if 'log_tag' in cconfig:
|
||||
cmd.append('--log-opt=tag=%s' % cconfig['log_tag'])
|
||||
if 'cpu_shares' in cconfig:
|
||||
cmd.append('--cpu-shares=%s' % cconfig['cpu_shares'])
|
||||
if 'security_opt' in cconfig:
|
||||
cmd.append('--security-opt=%s' % cconfig['security_opt'])
|
||||
if 'cpuset_cpus' in cconfig:
|
||||
|
|
|
@ -434,6 +434,7 @@ three-12345678 three''', '', 0),
|
|||
},
|
||||
'env_file': '/tmp/foo.env',
|
||||
'log_tag': '{{.ImageName}}/{{.Name}}/{{.ID}}',
|
||||
'cpu_shares': 600,
|
||||
'security_opt': 'label:disable',
|
||||
'mem_limit': '1G',
|
||||
'memswap_limit': '1G',
|
||||
|
@ -452,6 +453,7 @@ three-12345678 three''', '', 0),
|
|||
'--health-timeout=10s', '--health-retries=3',
|
||||
'--privileged=true', '--restart=always', '--user=bar',
|
||||
'--log-opt=tag={{.ImageName}}/{{.Name}}/{{.ID}}',
|
||||
'--cpu-shares=600',
|
||||
'--security-opt=label:disable', '--cpuset-cpus=0,1,2,3',
|
||||
'--memory=1G',
|
||||
'--memory-swap=1G',
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
features:
|
||||
- |
|
||||
Add `--cpu-shares=xxx` option for the action run a container. Allows to
|
||||
define upper `cpu.shares` limits in the cpu cgroup.
|
Loading…
Reference in New Issue