Commit 3c129690 authored by Daniele Venzano's avatar Daniele Venzano
Browse files

Reset memory limiting

parent 5d03ec78
......@@ -208,13 +208,20 @@ class SwarmClient:
log_config = docker.utils.LogConfig(type="json-file")
try:
host_config = self.cli.create_host_config(network_mode=options.network_name,
binds=options.get_volume_binds(),
mem_limit=options.get_memory_limit(),
memswap_limit=options.get_memory_limit(),
restart_policy=options.restart_policy,
port_bindings=port_bindings,
log_config=log_config)
if options.get_memory_limit() == -1:
host_config = self.cli.create_host_config(network_mode=options.network_name,
binds=options.get_volume_binds(),
restart_policy=options.restart_policy,
port_bindings=port_bindings,
log_config=log_config)
else:
host_config = self.cli.create_host_config(network_mode=options.network_name,
binds=options.get_volume_binds(),
mem_limit=options.get_memory_limit(),
memswap_limit=options.get_memory_limit(),
restart_policy=options.restart_policy,
port_bindings=port_bindings,
log_config=log_config)
cont = self.cli.create_container(image=image,
environment=options.environment,
network_disabled=False,
......
......@@ -73,8 +73,7 @@ def _spawn_service(execution: Execution, service: Service, env_subst_dict: dict)
copts = DockerContainerOptions()
copts.gelf_log_address = get_conf().gelf_address
copts.name = service.dns_name
if service.description['required_resources']['memory'] != -1:
copts.set_memory_limit(service.description['required_resources']['memory'])
copts.set_memory_limit(service.description['required_resources']['memory'])
copts.network_name = get_conf().overlay_network_name
copts.labels = {
'zoe.execution.name': execution.name,
......
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