Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
allgo
allgo
Commits
f1db998f
Commit
f1db998f
authored
Apr 25, 2017
by
BAIRE Anthony
Browse files
disable cpu_shares in the sandbox
parent
faac140e
Changes
1
Hide whitespace changes
Inline
Side-by-side
controller/controller.py
View file @
f1db998f
...
...
@@ -1107,14 +1107,22 @@ class JobManager(Manager):
cap_add
=
[
"dac_override"
],
cpu_period
=
ctrl
.
cpu_period
,
cpu_quota
=
ctrl
.
cpu_quota
,
# cpu_shares = ctrl.cpu_shares,
# NOTE: cpu_shares has a different meaining in docker swarm and docker engine
# - swarm: nb of cpus
# - engine: 1/1024 share of the total cpu resouces of the machine
# engine requires cpu_share>1
# cpu_shares = None if info.ver_id is None else ctrl.cpu_shares,
# mem_reservation = ctrl.mem_soft_limit,
mem_limit
=
ctrl
.
mem_hard_limit
,
)
if
ctrl
.
mem_soft_limit
:
# TODO: upgrade docker-py (and use create_host_config)
hc
[
"MemoryReservation"
]
=
ctrl
.
mem_soft_limit
if
ctrl
.
cpu_shares
:
# NOTE: cpu_shares has a different meaining in docker swarm and docker engine
# - swarm: nb of cpus
# - engine: 1/1024 share of the total cpu resouces of the machine
# engine requires cpu_share>1
if
ctrl
.
cpu_shares
and
info
.
ver_id
is
not
None
:
# TODO: upgrade docker-py (and use create_host_config)
hc
[
"CpuShares"
]
=
ctrl
.
cpu_shares
log
.
debug
(
"host_config %r"
,
hc
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment