common-workflow-language / common-workflow-language/cwltool

limit CPUs available to $(runtime.cores) when using Singularity/Apptainer engines

Open
#984 1 comment 0 reactions 0 assignees View on GitHub
enhancement good first issue help wanted
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.