Commit 03eca6b8 authored by BAIRE Anthony's avatar BAIRE Anthony
Browse files

use --cpu-shares

parent bc1cbfc9
......@@ -1107,12 +1107,16 @@ class JobManager(Manager):
cap_add = ["dac_override"],
cpu_period = ctrl.cpu_period,
cpu_quota = ctrl.cpu_quota,
# cpu_shares = 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:
# TODO: upgrade docker-py (and use create_host_config)
hc["CpuShares"] = ctrl.cpu_shares
log.debug("host_config %r", hc)
info.ctr_id = info.client.create_container(image, name=info.ctr_name,
working_dir = "/tmp",
......@@ -1513,6 +1517,7 @@ class DockerController:
self.cpu_quota = None if cpus is None else int(cpus * 100000)
self.cpu_period = None if cpus is None else 100000
self.cpu_shares = None if cpus is None else int(cpus)
self.mem_soft_limit = None if mem_soft_limit is None else docker.utils.parse_bytes(mem_soft_limit)
self.mem_hard_limit = None if mem_hard_limit is None else docker.utils.parse_bytes(mem_hard_limit)
......
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