Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: invalid literal for int() with base 10: '1-4' #189

Open
niclasboy opened this issue Mar 12, 2021 · 1 comment
Open

ValueError: invalid literal for int() with base 10: '1-4' #189

niclasboy opened this issue Mar 12, 2021 · 1 comment

Comments

@niclasboy
Copy link

niclasboy commented Mar 12, 2021

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.

@niclasboy niclasboy reopened this Mar 12, 2021
@niclasboy
Copy link
Author

I think multiprocessing.cpu_count() can solve this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant