[ARVADOS] created: 1.1.2-169-g2bae361
Git user
git at public.curoverse.com
Mon Feb 5 17:06:04 EST 2018
at 2bae361432ff8f975803495b4fd0acfae02cd3ef (commit)
commit 2bae361432ff8f975803495b4fd0acfae02cd3ef
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date: Mon Feb 5 17:00:27 2018 -0500
12991: Propagate memory and CPU limits to docker container.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>
diff --git a/services/crunch-run/crunchrun.go b/services/crunch-run/crunchrun.go
index a9f1c25..0facb31 100644
--- a/services/crunch-run/crunchrun.go
+++ b/services/crunch-run/crunchrun.go
@@ -952,6 +952,7 @@ func (runner *ContainerRunner) CreateContainer() error {
runner.ContainerConfig.Volumes = runner.Volumes
+ maxRAM := int64(runner.Container.RuntimeConstraints.RAM)
runner.HostConfig = dockercontainer.HostConfig{
Binds: runner.Binds,
LogConfig: dockercontainer.LogConfig{
@@ -959,6 +960,10 @@ func (runner *ContainerRunner) CreateContainer() error {
},
Resources: dockercontainer.Resources{
CgroupParent: runner.setCgroupParent,
+ NanoCPUs: int64(runner.Container.RuntimeConstraints.VCPUs) * 1000000000,
+ Memory: maxRAM, // RAM
+ MemorySwap: maxRAM, // RAM+swap
+ KernelMemory: maxRAM, // kernel portion
},
}
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list