-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CWL problem: input files listing using JavaScript with more than one step in workflow #156
Comments
Can anyone help us with this problem? |
Hi @novikovant! Sorry for the late response. I just tried out your workflow. However since I don't have I used the same $ cat workflow.cwl
#!/usr/bin/env cwl-runner
cwlVersion: v1.0
class: Workflow
requirements:
ScatterFeatureRequirement: {}
SubworkflowFeatureRequirement: {}
StepInputExpressionRequirement: {}
InlineJavascriptRequirement: {}
inputs:
input_dir: Directory
steps:
list_input:
run:
class: ExpressionTool
requirements: { InlineJavascriptRequirement: {} }
inputs:
dir: Directory
expression: '${return {"files": inputs.dir.listing};}'
outputs:
files: File[]
in:
dir: input_dir
out: [files]
wf:
scatter: inf
in:
inf: list_input/files
run:
class: Workflow
inputs:
inf: File
steps:
count_file:
run:
class: CommandLineTool
inputs:
input_file: File
baseCommand: /bin/sh
arguments:
- prefix: -c
valueFrom: |
echo $(inputs.input_file) > out_file
outputs:
out_file:
type: File
outputBinding:
glob: 'out_file'
in:
input_file: inf
out: [out_file]
outputs:
out_file:
type: File
outputSource: count_file/out_file
out: [out_file]
outputs:
out_files:
type: File[]
outputSource: wf/out_file I ran it using the following $ cat reana.yaml
version: 0.6.0
inputs:
parameters:
input: jobdata.yml
directories:
- data
workflow:
type: cwl
file: workflow.cwl I also had a $ ls data/
file1 file2 file3 Running locally on REANA
If you do not specify a docker image, REANA defaults to using
This worked! The job finished successfully
If you don't think the docker pulling is the issue, maybe I could help debug better if I had access to |
Thanks for the response and testing! Here it is. There is base Ubuntu image (may be this is too much for this example; possible, it is not the problem). We tried with Ubuntu image and with your image and with your way of using bash in external cwl_step (like lssh.yaml). Don`t work. #!/usr/bin/env cwl-runner
cwlVersion: v1.0
class: CommandLineTool
label: count lines in file
hints:
DockerRequirement:
dockerPull: ubuntu:18.04
requirements:
InitialWorkDirRequirement:
listing:
- entryname: run.sh
entry: >-
wc -l $(inputs.input_file.path) > $(inputs.out_file_name);
baseCommand: ["/bin/bash","run.sh"]
inputs:
input_file:
type: File
out_file_name:
type: string
default: lines.txt
outputs:
out_file:
type: File
outputBinding:
glob: $(inputs.out_file_name) |
Thank you for the information, I can now reproduce your error. I will have a closer look into it and let you know! |
Good and bad news! I was able to locate the issue, seems like REANA does not currently support some of the CWL construct in your workflow. However I was able to run the same computational steps by amending it as follows #!/usr/bin/env cwl-runner
cwlVersion: v1.0
class: Workflow
requirements:
ScatterFeatureRequirement: {}
SubworkflowFeatureRequirement: {}
StepInputExpressionRequirement: {}
InlineJavascriptRequirement: {}
inputs:
input_dir: Directory
steps:
list_input:
run:
class: ExpressionTool
requirements: { InlineJavascriptRequirement: {} }
inputs:
dir: Directory
expression: '${return {"files": inputs.dir.listing};}'
outputs:
files: File[]
in:
dir: input_dir
out: [files]
wf:
scatter: inf
in:
inf: list_input/files
run:
class: Workflow
inputs:
inf: File
steps:
count_file:
run:
class: CommandLineTool
label: count lines in file
hints:
DockerRequirement:
dockerPull: ubuntu:18.04
baseCommand: "/bin/bash"
arguments:
- prefix: -c
valueFrom: |
wc -l $(inputs.input_file.path) > $(inputs.out_file_name)
inputs:
input_file: File
out_file_name:
type: string
default: lines.txt
outputs:
out_file:
type: File
outputBinding:
glob: $(inputs.out_file_name)
in:
input_file: inf
out: [out_file]
outputs:
out_file:
type: File
outputSource: count_file/out_file
out: [out_file]
outputs:
out_files:
type: File[]
outputSource: wf/out_file As you suspected, the new way of using bash was not compatible. I also had issues moving the |
I understand you. Possible workaround for now - is to manually write all files to input. Or another - may be single inline step right after JavaScript (or before it) will correct the behaviour (of the CWLtool files staging subsystem) and other steps could be external. |
FYI, as an alternative to using that steps:
wf:
scatter: inf
in:
inf:
source: input_dir
valueFrom: $(self.listing)
run: #... |
We have a problem with such expression in workflows using REANA (dev version 0.7.0a1).
run-cwl-workflow 0.7.0a1 with cwltool 1.0.20191022103248
This works well when used alone (in one step workflow), but in multisteps workflow produces error.
cwltool | MainThread | INFO | [step list_input] start
ERROR [step list_input] Output is missing expected field file:///var/reana/users/00000000-0000-0000-0000-000000000000/workflows/761dfcbc-43ed-4b27-8bb7-5b72b9b7ba44/workflow.json#main/list_input/files
cwltool | MainThread | ERROR | [step list_input] ...
WARNING [step list_input] completed permanentFail
Example workflow below.
If only single step remains, it also transfers input files to output. But as is (multistep) - it produces ERROR immediatelly without any transfers.
jobdata.yml (upload any file or files of any size)
Workflow
And wf/lssh.yaml is is not really important (not executed).
The text was updated successfully, but these errors were encountered: