common-workflow-library / legacy

Deprecated
https://github.com/common-workflow-library/bio-cwl-tools
Apache License 2.0
100 stars 62 forks source link

cannot run hello-param.cwl unless --non-strict #66

Closed zyxue closed 7 years ago

zyxue commented 8 years ago

What's going on with --strict mode, please? Please find my example below

When --restrict is on by default

$ cwl-runner  hello-param.cwl#main params.json
/home/zxue/trial_learning/trial_cwl/venv/bin/cwl-runner 1.0.20160316204054
Tool definition failed validation:
Validation error in object file:///home/zxue/trial_learning/trial_cwl/workflows/workflows/hello/hello-param.cwl#main
  Could not validate as `CommandLineTool` because
    could not validate field `outputs` because
      At position 0
        could not validate field `source` because it is not recognized and strict is True, valid fields are: secondaryFiles, format, streamable, type, label, description, id, outputBinding

    missing required field `baseCommand`
    could not validate field `steps` because it is not recognized and strict is True, valid fields are: id, inputs, outputs, requirements, hints, label, description, cwlVersion, class, baseCommand, arguments, stdin, stdout, successCodes, temporaryFailCodes, permanentFailCodes
  Could not validate as `Workflow` because
    could not validate field `steps` because
      the value `[{'id': 'file:///home/zxue/trial_learning/trial_cwl/workflows/workflows/hello/hello-param.cwl#step0',
        'inputs': [{'id': 'file:///home/zxue/trial_learning/tria[...]`
       is not a valid type in the union, expected one of:
      - array of <WorkflowStep>, but
         At position 0
          could not validate field `outputs` because
            At position 0
              could not validate field `defaul` because it is not recognized and strict is True, valid fields are: id
  Could not validate as `SaladEnumSchema` because
    missing required field `type`
    missing required field `symbols`
    could not validate field `inputs` because it is not recognized and strict is True, valid fields are: type, symbols, doc, docParent, docChild, docAfter, jsonldPredicate, documentRoot, extends
    could not validate field `steps` because it is not recognized and strict is True, valid fields are: type, symbols, doc, docParent, docChild, docAfter, jsonldPredicate, documentRoot, extends
    could not validate field `description` because it is not recognized and strict is True, valid fields are: type, symbols, doc, docParent, docChild, docAfter, jsonldPredicate, documentRoot, extends
    could not validate field `outputs` because it is not recognized and strict is True, valid fields are: type, symbols, doc, docParent, docChild, docAfter, jsonldPredicate, documentRoot, extends
    could not validate field `requirements` because it is not recognized and strict is True, valid fields are: type, symbols, doc, docParent, docChild, docAfter, jsonldPredicate, documentRoot, extends
    could not validate field `class` because it is not recognized and strict is True, valid fields are: type, symbols, doc, docParent, docChild, docAfter, jsonldPredicate, documentRoot, extends
    could not validate field `label` because it is not recognized and strict is True, valid fields are: type, symbols, doc, docParent, docChild, docAfter, jsonldPredicate, documentRoot, extends
  Could not validate as `Documentation` because
    missing required field `name`
    missing required field `type`
    could not validate field `inputs` because it is not recognized and strict is True, valid fields are: name, doc, docParent, docChild, docAfter, type
    could not validate field `steps` because it is not recognized and strict is True, valid fields are: name, doc, docParent, docChild, docAfter, type
    could not validate field `description` because it is not recognized and strict is True, valid fields are: name, doc, docParent, docChild, docAfter, type
    could not validate field `outputs` because it is not recognized and strict is True, valid fields are: name, doc, docParent, docChild, docAfter, type
    could not validate field `requirements` because it is not recognized and strict is True, valid fields are: name, doc, docParent, docChild, docAfter, type
    could not validate field `class` because it is not recognized and strict is True, valid fields are: name, doc, docParent, docChild, docAfter, type
    could not validate field `label` because it is not recognized and strict is True, valid fields are: name, doc, docParent, docChild, docAfter, type
  Could not validate as `ExpressionTool` because
    could not validate field `outputs` because
      At position 0
        could not validate field `source` because it is not recognized and strict is True, valid fields are: secondaryFiles, format, streamable, type, label, description, id, outputBinding

    missing required field `expression`
    could not validate field `steps` because it is not recognized and strict is True, valid fields are: id, inputs, outputs, requirements, hints, label, description, cwlVersion, class, expression
  Could not validate as `SaladRecordSchema` because
    missing required field `name`
    missing required field `type`
    could not validate field `inputs` because it is not recognized and strict is True, valid fields are: name, type, fields, doc, docParent, docChild, docAfter, jsonldPredicate, documentRoot, abstract, extends, specialize
    could not validate field `steps` because it is not recognized and strict is True, valid fields are: name, type, fields, doc, docParent, docChild, docAfter, jsonldPredicate, documentRoot, abstract, extends, specialize
    could not validate field `description` because it is not recognized and strict is True, valid fields are: name, type, fields, doc, docParent, docChild, docAfter, jsonldPredicate, documentRoot, abstract, extends, specialize
    could not validate field `outputs` because it is not recognized and strict is True, valid fields are: name, type, fields, doc, docParent, docChild, docAfter, jsonldPredicate, documentRoot, abstract, extends, specialize
    could not validate field `requirements` because it is not recognized and strict is True, valid fields are: name, type, fields, doc, docParent, docChild, docAfter, jsonldPredicate, documentRoot, abstract, extends, specialize
    could not validate field `class` because it is not recognized and strict is True, valid fields are: name, type, fields, doc, docParent, docChild, docAfter, jsonldPredicate, documentRoot, abstract, extends, specialize
    could not validate field `label` because it is not recognized and strict is True, valid fields are: name, type, fields, doc, docParent, docChild, docAfter, jsonldPredicate, documentRoot, abstract, extends, specialize

Turn off --strict with --non-strict

$ cwl-runner --non-strict  hello-param.cwl#main params.json
/home/zxue/trial_learning/trial_cwl/venv/bin/cwl-runner 1.0.20160316204054
[job step0] /tmp/tmpotbWy_$ echo -n -e 'Hello, CWL !
Hello World !' > /tmp/tmpotbWy_/useroutput.txt
[step step0] completion status is success
[workflow main] outdir is /home/zxue/trial_learning/trial_cwl/workflows/workflows/hello
Final process status is success
{
    "output": {
        "path": "/home/zxue/trial_learning/trial_cwl/workflows/workflows/hello/useroutput.txt", 
        "checksum": "sha1$e8bb28df025c10299db8e73281fbf96d402a1bc0", 
        "class": "File", 
        "size": 26
    }
}
mr-c commented 8 years ago

Hello @zyxue ,

Thank you for your report. This will be fixed in https://github.com/common-workflow-language/workflows/pull/70