yuch7 / cwlexec

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

Failed to evaluate the expression in the [std] field, string is required #37

Closed drjrm3 closed 5 years ago

drjrm3 commented 5 years ago

The fix for #36 resolved that issue but now I am running into an issue when I try to redirect stdout to a file within the CommandLineTool being scattered over. I have modified that example to show that the first step seems to succeed, but the second step fails with

Failed to evaluate the expression "$(inputs.output_file)" in the [std] field, string is required.

UndefinedVariableError2.tar.gz

skeeey commented 5 years ago

@drjrm3 Can you upload your tar file again?

skeeey commented 5 years ago

And follow the CWL specification, the std field should be a string or expression, so we require the expression return a string value, can you try to make the $(inputs.output_file) returns a string? e.g. $(inputs.output_file.rootname) or something.

drjrm3 commented 5 years ago

@skeeey - I have edited my original post so that the uploaded tarfile should now be easily downloadable. In terms of the string requirement, my code is actually passing a string to stdout which I think is what you are saying is needed (see below). I think the real issue here is that the output_file is being build correctly by the javascript inside the workflow but then being processed as null inside the CLT, though I'm not sure why. This is why it is saying it requires a string.

#!/usr/bin/env cwl-runner

cwlVersion: v1.0
class: CommandLineTool

baseCommand: process_reads.sh

inputs:
  R1_file:
    type: File
    inputBinding:
      prefix: --R1_file

  R2_file:
    type: File
    inputBinding:
      prefix: --R2_file

  output_file:
    type: string
    inputBinding:
      prefix: --OUTPUT_FILE

stdout: $(inputs.output_file)

outputs:
  upper_file:
    type: File
    outputBinding:
      glob: $(inputs.output_file)
skeeey commented 5 years ago

This problem related to #36, currently, we put off the output_file evaluation on its upper level, so we also need to put off this evaluation, it means we need evaluate this expression after output_file evaluation is done. I will try to fix this issue

skeeey commented 5 years ago

@drjrm3 I fixed this problem, but you may forget to handle the OUTPUT_FILE in process_reads.sh in your uploaded package.