Commit f1db998f authored by BAIRE Anthony's avatar BAIRE Anthony
Browse files

disable cpu_shares in the sandbox

parent faac140e
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment