chanzuckerberg / miniwdl

Workflow Description Language developer tools & local runner
MIT License
173 stars 54 forks source link

Cannot supply inputs to task only workflows #693

Open stxue1 opened 3 months ago

stxue1 commented 3 months ago

If a WDL doesn't specify a workflow and only has a task, trying to supply input JSON always errors:

check JSON input; unknown input/output: glob.num_files

Some of the WDL SPEC unit tests depend on this behavior. For example, in this unit test: https://github.com/openwdl/wdl/blob/9c0b9cf4586508a9e6260cc5c5e562e21f625aac/SPEC.md?plain=1#L3776-L3806

version 1.1

task glob {
  input {
    Int num_files
  }

  command <<<
  for i in 1..~{num_files}; do
    printf ${i} > file_${i}.txt
  done
  >>>

  output {
    Array[File] outfiles = glob("*.txt")
    Int last_file_contents = read_int(outfiles[num_files-1])
  }
}

The input to be supplied to the execution engine is "glob.num_files": 3.

Trying to run that unit test with miniwdl run glob_task.wdl -i '{"glob.num_files": 3}' returns the same error as above.

mlin commented 3 months ago

@stxue1 It should work of you omit the glob. prefix from the input keys. I agree it should tolerate that prefix though.