Skip to content
Snippets Groups Projects
Commit 83d14250 authored by Matthias Schnepf's avatar Matthias Schnepf
Browse files

Fix memory setting in docker_wrapper.py

parent be574385
Branches
No related tags found
No related merge requests found
......@@ -83,10 +83,12 @@ def main():
continue
for val in vals or []:
if arg=='memory':
docker_opts += ['--memory', int(val)*2]
docker_opts += ['--memory-swap', int(val)*2]
docker_opts += ['--memory-reservation', val]
docker_opts += ['--memory-swappiness', 0]
# split memory argument in numbers (amount of memory) and characters (unit), first element is an empty string
_, request_memory, unit = re.split('(\d+)', val)
docker_opts += ['--memory', "{}{}".format(int(request_memory)*2, unit)]
docker_opts += ['--memory-swap', "{}{}".format(int(request_memory)*2, unit)]
docker_opts += ['--memory-reservation',"{}{}".format(int(request_memory), unit)]
docker_opts += ['--memory-swappiness', "0"]
else:
docker_opts += ['--' + arg, val]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment