yuch7 / cwlexec

A new open source tool to run CWL workflows on LSF
Other
36 stars 8 forks source link

ExpressionTool cannot return multiple arrays #46

Closed adamdingliang closed 5 years ago

adamdingliang commented 5 years ago

Here is a simple CWL script "int_to_array.cwl" to convert an int to an int array and a string array:

!/usr/bin/env cwl-runner

cwlVersion: v1.0 class: ExpressionTool

requirements:

inputs: number: type: int label: a positive integer

outputs: int_array: type: int[] str_array: type: string[]

expression: | ${ var s_arr = [], i_arr = []; for (var i = 0; i < inputs.number; i++) { s_arr.push('hello' + i + '.txt'); i_arr.push(i); } return { "int_array": i_arr, "str_array": s_arr }; }

This works with cwltool. But does not work with cwlexec-0.2.2: $ cwltool int_to_array.cwl int_to_array.yml /research/rgs01/project_space/yu3grp/software_JY/yu3grp/conda_env/yulab_env/bin/cwltool 1.0.20190228155703 Resolved 'int_to_array.cwl' to 'file:///research/rgs01/home/clusterHome/lding/develop/cwl/practices/expression/int_to_array.cwl' { "int_array": [ 0, 1, 2, 3 ], "str_array": [ "hello0.txt", "hello1.txt", "hello2.txt", "hello3.txt" ] } Final process status is success

$ cwlexec int_to_array.cwl int_to_array.yml [17:24:24.592] INFO - Workflow ID: 20fed44a-9f27-4797-b886-28846559711f [17:24:24.593] INFO - Name: int_to_array [17:24:24.593] INFO - Description file path: /research/rgs01/home/clusterHome/lding/develop/cwl/practices/expression/int_to_array.cwl [17:24:24.594] INFO - Input settings file path: /research/rgs01/home/clusterHome/lding/develop/cwl/practices/expression/int_to_array.yml [17:24:24.594] INFO - Output directory: /home/lding/cwl-workdir/20fed44a-9f27-4797-b886-28846559711f [17:24:24.594] INFO - Work directory: /home/lding/cwl-workdir/20fed44a-9f27-4797-b886-28846559711f [17:24:24.594] INFO - Workflow "int_to_array" started to execute. [17:24:24.871] INFO - Job (int_to_array) was submitted. Job <78813896> is submitted to queue . [17:24:29.446] ERROR - Failed to wait for job int_to_array <78813896>, java.lang.String cannot be cast to java.lang.Long [17:24:29.446] ERROR - The job (int_to_array) exited.

skeeey commented 5 years ago

@adamdingliang I think I fixed this problem, for this problem, the root cause is we did not handle it very well when an expression returns a JS object, if the problem still persists, you can reopen this issue freely

drkennetz commented 5 years ago

You guys are doing great, thanks for all your help @skeeey!