common-workflow-lab / galaxy

Fork of Galaxy (http://galaxyproject.org/) attempting to implement the CWL spec.
https://www.commonwl.org
Other
10 stars 2 forks source link

UI for CWL workflow/tool execution #145

Open mr-c opened 2 years ago

mr-c commented 2 years ago

@mvdbeek proposed using a schema-salad representation of workflow/tool inputs to help build the web UI for executing CWL tools/workflows in Galaxy

I wrote https://github.com/common-workflow-language/cwltool/pull/1748 to add a --print-input-schema option to cwltool

Here are some outputs of cwltool --print-input-schema for CWL workflows and tools descriptions from the MGnify team:

https://gist.github.com/mr-c/3b87d8538817c023197b7ed4bb1f0210#file-raw-reads-wf-v-5-cond_inputs_schema-yml

(Currently, each file has the same boilerplate definitions at the top, but that is likely to be moved to an $import from a stable, public URL)

These schema salad documents can used by the schema-salad Python library, and/or loaded from a standalone parser like https://github.com/common-workflow-lab/schema-salad-ts-auto for TypeScript

(that parser was generated from the schema-salad codegen feature using the schema salad metaschema :sweat_smile: )

We can also generate that specialized parser for Python, Java, .Net (and any future languages supported by schema-salad-tool --codegen)

ALSO we can generate a parser for a particular workflow/tool input schema, here's the Python version of that for raw-reads-wf-v-5-cond.cwl inputs: https://gist.github.com/mr-c/3b87d8538817c023197b7ed4bb1f0210#file-raw-reads-wf-v-5-cond_inputs_schema-py

mr-c commented 2 years ago

I did some more thinking about this, and talked with @tetron ;

CWL input and output sections are schemas that are a super-set of schema-salad schemas. So lowering them to schema-salad schemas makes us lose features: secondaryFiles spec & validation; file format spec & validation as both narrow the File type; there are likely other aspects we would lose by lowering the schema from CWL to schema SALAD format.

So I think we need to gather use cases for what to do with the schema of a CWL workflow/tool input object.

For validating an input object, we can write code to use the TypeScript CWL loader to validate an input object against a CWL tool/workflow description. In this case I would volunteer to write the validator in Python using the cwl-utils autogenerated CWL objects, that should be straightforward to rewrite into TypeScript by someone with familiarity with that language.

mvdbeek commented 2 years ago

OK, let's see how far we're getting with the input sections we have now, and we can start with validation via the typescript cwl loader.