Add RunInSingleContainer dynamic resource request tests
authorPeter Amstutz <pamstutz@veritasgenetics.com>
Mon, 2 Apr 2018 18:30:54 +0000 (14:30 -0400)
committerPeter Amstutz <pamstutz@veritasgenetics.com>
Mon, 2 Apr 2018 18:30:54 +0000 (14:30 -0400)
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz@veritasgenetics.com>

sdk/cwl/tests/arvados-tests.yml
sdk/cwl/tests/wf/runin-reqs-wf.cwl
sdk/cwl/tests/wf/runin-reqs-wf2.cwl
sdk/cwl/tests/wf/runin-reqs-wf3.cwl
sdk/cwl/tests/wf/runin-reqs-wf4.cwl

index ea6477cfe8b2c58facd80602c01786da1f0a9677..87db44b094f9c234280c7c7e37bc5be5e9d5d313 100644 (file)
   }
   tool: wf/secret_wf.cwl
   doc: "Test secret input parameters"
+
+- job: null
+  output:
+    out: null
+  tool: wf/runin-reqs-wf.cwl
+  doc: "RunInSingleContainer handles dynamic resource requests on step"
+
+- job: null
+  output:
+    out: null
+  tool: wf/runin-reqs-wf2.cwl
+  doc: "RunInSingleContainer handles dynamic resource requests on embedded subworkflow"
+
+- job: null
+  output:
+    out: null
+  tool: wf/runin-reqs-wf3.cwl
+  should_fail: true
+  doc: "RunInSingleContainer disallows dynamic resource request on subworkflow steps"
+
+- job: null
+  output:
+    out: null
+  tool: wf/runin-reqs-wf4.cwl
+  doc: "RunInSingleContainer discovers static resource request in subworkflow steps"
index 8e3557e4ff36d28181fdf9f910b05deef1bd06a5..9032e26dd6787598370e1a57fa107038159e5c32 100644 (file)
@@ -7,9 +7,14 @@ cwlVersion: v1.0
 $namespaces:
   arv: "http://arvados.org/cwl#"
 inputs:
-  sleeptime:
+  count:
     type: int[]
     default: [1, 2, 3, 4]
+  script:
+    type: File
+    default:
+      class: File
+      location: check_mem.py
 outputs:
   out: []
 requirements:
@@ -20,29 +25,34 @@ requirements:
 steps:
   substep:
     in:
-      sleeptime: sleeptime
+      count: count
+      script: script
     out: []
     hints:
       - class: arv:RunInSingleContainer
       - class: ResourceRequirement
-        ramMin: $(inputs.sleeptime*4)
-    scatter: sleeptime
+        ramMin: $(inputs.count*4)
+      - class: arv:APIRequirement
+    scatter: count
     run:
       class: Workflow
       id: mysub
       inputs:
-        sleeptime: int
+        count: int
+        script: File
       outputs: []
       steps:
         sleep1:
           in:
-            sleeptime: sleeptime
+            count: count
+            script: script
           out: []
           run:
             class: CommandLineTool
             id: subtool
             inputs:
-              sleeptime:
+              count:
                 type: int
+              script: File
             outputs: []
-            baseCommand: [cat, /proc/meminfo]
+            arguments: [python, $(inputs.script), $(inputs.count * 4)]
index 50db901ee49622b7d3dace8eee8983bb3d8dd70a..cc1321aec1a68c274f8f6e6cdb0d5e530df6da36 100644 (file)
@@ -7,9 +7,14 @@ cwlVersion: v1.0
 $namespaces:
   arv: "http://arvados.org/cwl#"
 inputs:
-  sleeptime:
+  count:
     type: int[]
     default: [1, 2, 3, 4]
+  script:
+    type: File
+    default:
+      class: File
+      location: check_mem.py
 outputs:
   out: []
 requirements:
@@ -20,31 +25,35 @@ requirements:
 steps:
   substep:
     in:
-      sleeptime: sleeptime
+      count: count
+      script: script
     out: []
     hints:
       - class: arv:RunInSingleContainer
-    scatter: sleeptime
+      - class: arv:APIRequirement
+    scatter: count
     run:
       class: Workflow
       id: mysub
       inputs:
-        sleeptime: int
+        count: int
+        script: File
       outputs: []
       hints:
-      - class: ResourceRequirement
-        ramMin: $(inputs.sleeptime*4)
+        - class: ResourceRequirement
+          ramMin: $(inputs.count*4)
       steps:
         sleep1:
           in:
-            sleeptime: sleeptime
+            count: count
+            script: script
           out: []
           run:
             class: CommandLineTool
             id: subtool
             inputs:
-              sleeptime:
+              count:
                 type: int
-                inputBinding: {position: 1}
+              script: File
             outputs: []
-            baseCommand: sleep
+            arguments: [python, $(inputs.script), $(inputs.count * 4)]
index 352a919b3734cd1e881e33f99b2813b0ac36745e..92bf482a80a37e9d351a8db960697d582229b1cb 100644 (file)
@@ -7,9 +7,14 @@ cwlVersion: v1.0
 $namespaces:
   arv: "http://arvados.org/cwl#"
 inputs:
-  sleeptime:
+  count:
     type: int[]
     default: [1, 2, 3, 4]
+  script:
+    type: File
+    default:
+      class: File
+      location: check_mem.py
 outputs:
   out: []
 requirements:
@@ -20,31 +25,35 @@ requirements:
 steps:
   substep:
     in:
-      sleeptime: sleeptime
+      count: count
+      script: script
     out: []
     hints:
       - class: arv:RunInSingleContainer
-    scatter: sleeptime
+      - class: arv:APIRequirement
+    scatter: count
     run:
       class: Workflow
       id: mysub
       inputs:
-        sleeptime: int
+        count: int
+        script: File
       outputs: []
       steps:
         sleep1:
           in:
-            sleeptime: sleeptime
+            count: count
+            script: script
           out: []
           run:
             class: CommandLineTool
             id: subtool
             hints:
               - class: ResourceRequirement
-                ramMin: $(inputs.sleeptime*4)
+                ramMin: $(inputs.count*4)
             inputs:
-              sleeptime:
+              count:
                 type: int
-                inputBinding: {position: 1}
+              script: File
             outputs: []
-            baseCommand: sleep
+            arguments: [python, $(inputs.script), $(inputs.count * 4)]
index 75f50d2d49cc669ca9597acd2f816b4d4e148d43..b7a977998fe2f1a9ae66db2c470a843133c1648c 100644 (file)
@@ -7,9 +7,14 @@ cwlVersion: v1.0
 $namespaces:
   arv: "http://arvados.org/cwl#"
 inputs:
-  sleeptime:
+  count:
     type: int[]
     default: [1, 2, 3, 4]
+  script:
+    type: File
+    default:
+      class: File
+      location: check_mem.py
 outputs:
   out: []
 requirements:
@@ -20,21 +25,25 @@ requirements:
 steps:
   substep:
     in:
-      sleeptime: sleeptime
+      count: count
+      script: script
     out: []
     hints:
       - class: arv:RunInSingleContainer
-    scatter: sleeptime
+      - class: arv:APIRequirement
+    scatter: count
     run:
       class: Workflow
       id: mysub
       inputs:
-        sleeptime: int
+        count: int
+        script: File
       outputs: []
       steps:
         sleep1:
           in:
-            sleeptime: sleeptime
+            count: count
+            script: script
           out: []
           run:
             class: CommandLineTool
@@ -43,8 +52,8 @@ steps:
               - class: ResourceRequirement
                 ramMin: 8
             inputs:
-              sleeptime:
+              count:
                 type: int
-                inputBinding: {position: 1}
+              script: File
             outputs: []
-            baseCommand: sleep
+            arguments: [python, $(inputs.script), "8"]