[ARVADOS] created: e6d8eb6d2415f15439ab6b7ab715ca962e7e7763

Git user git at public.curoverse.com
Fri Mar 4 08:09:49 EST 2016


        at  e6d8eb6d2415f15439ab6b7ab715ca962e7e7763 (commit)


commit e6d8eb6d2415f15439ab6b7ab715ca962e7e7763
Author: radhika <radhika at curoverse.com>
Date:   Fri Mar 4 08:08:38 2016 -0500

    8558: add min_cores_per_node and min_ram_mb_per_node to runtime_constraints from builder resources

diff --git a/sdk/cwl/arvados_cwl/__init__.py b/sdk/cwl/arvados_cwl/__init__.py
index 8854971..ca80795 100644
--- a/sdk/cwl/arvados_cwl/__init__.py
+++ b/sdk/cwl/arvados_cwl/__init__.py
@@ -152,6 +152,19 @@ class ArvadosJob(object):
         if docker_req and kwargs.get("use_container") is not False:
             runtime_constraints["docker_image"] = arv_docker_get_image(self.arvrunner.api, docker_req, pull_image)
 
+        resources = self.builder.resources
+        if resources is not None:
+            if "coresMin" in resources.keys():
+                try:
+                    runtime_constraints["min_cores_per_node"] = int(resources["coresMin"])
+                except:
+                    runtime_constraints["min_cores_per_node"] = None
+            if "ramMin" in resources.keys():
+                try:
+                    runtime_constraints["min_ram_mb_per_node"] = int(resources["ramMin"])
+                except:
+                    runtime_constraints["min_ram_mb_per_node"] = None
+
         try:
             response = self.arvrunner.api.jobs().create(body={
                 "script": "crunchrunner",

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list