common-workflow-language / common-workflow-language/cwltool
limit CPUs available to $(runtime.cores) when using Singularity/Apptainer engines
- Dominant language
- Python
- Stars
- 376
- Forks
- 255
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 12
Description
- [x] in docker >= v1.13 pass `--cpus` runtime.cores
- [x] in docker < v1.13, use `--cpu-period="100000"` and `--cpu-quota` with 100000 * runtime.cores
https://docs.docker.com/config/containers/resource_constraints/#cpu
Should be similar to https://github.com/common-workflow-language/cwltool/pull/835/files except that `self.builder.resources["cores"]` and invert the command line option so that we limit CPUs by default, turning off with `--no-strict-cpu-limit`
FYI, Singularity 3.0 has a similar option to the Docker pre-v1.13 method above: https://www.sylabs.io/guides/3.0/user-guide/cgroups.html#quota-period
Contributor guide
Assessment
This issue has not been assessed yet.