SORMAS-Docker
SORMAS-Docker copied to clipboard
ValueError: invalid literal for int() with base 10: '1-4'
When running Docker inside a LXC with 4 from 6 cores selected, you cant run the docker, because cat /sys/fs/cgroup/cpuset/cpuset.cpus returns 1-4 or 1,3-5. So cpu = int(cpus.replace("0-","")) + 1
in https://github.com/hzi-braunschweig/SORMAS-Docker/blob/b11ed03c1925750dc3e6334d505a9e54cdec97cc/postgres/alter_system.py#L81 cant be executed and following error will be thrown: ValueError: invalid literal for int() with base 10: '1-4'
. Is there an workaround without increasing the core count to 6? What would happen if you only have a single core cpu?
When the core count is set to 6 the container starts up without problems.
I think multiprocessing.cpu_count()
can solve this problem.