Skip to content

Limit memory and number of cores for docker runners

I would like to write in my config.toml something like

concurrent = 4
[[runners]]
      executor = "docker"
      [runners.docker]
            core_limit = 1
            memory_limit = 2GB

Assuming the machine has at least 4 cores and 8GB RAM, I get the guarantee that jobs should not affect each other. At least not by starving others of cpu time or running out of memory.

The example above would be to docker run --memory 2g .... The core limit is slightly more difficult, because the runner has to allocate the cores and set the --cpuset-cpus parameter correctly.

This might be a duplicate of #83 (closed)? However, I believe that one is about a runner with all its concurrent jobs together. I want a limit per container/job, which is not hard with docker.