reanahub / reana-client

REANA command-line client
http://reana-client.readthedocs.io/
MIT License
10 stars 46 forks source link

cli: permitted and forbidden operational options #249

Open tiborsimko opened 5 years ago

tiborsimko commented 5 years ago

When one uses some workflow engine (such as CWL) and specifies operational options that are not compatible (such as CACHE=off), one gets this scenario:

$ reana-client start -o CACHE=off  -w workflow       
/home/simko/.virtualenvs/reana/bin/cwltool 1.0.20181118133959
workflow has been queued
$ reana-client status   -w workflow      
NAME       RUN_NUMBER   CREATED               STATUS   PROGRESS
workflow   1            2019-02-11T08:25:58   failed   0/2     

because the option is not supported:

$ kl batch-cwl-02a9acf2-2421-4a46-8b85-0539be8b8341-wwzm5 
Dumping workflow specification and input parameter files...
parsing arguments ...
ERROR:reana-workflow-engine-cwl:parsing arguments ...
starting the run..
ERROR:reana-workflow-engine-cwl:starting the run..
/usr/local/bin/run-cwl-workflow 0.4.0 with cwltool 1.0.20181118133959
INFO:cwltool:/usr/local/bin/run-cwl-workflow 0.4.0 with cwltool 1.0.20181118133959
ERROR:reana_workflow_engine_cwl.tasks:workflow failed: Not found: 'CACHE=off'

It would be nice to have a matrix of which operational option is supported for which engine -- similarly to "To pick a workflow engine" documentation section in User guide -- and reana-client would not about this and would not even allow to submit workflows with incompatible operational options.

This would make the user experience smoother.

roksys commented 5 years ago

Just to want to point out that some validations of CWL operational options are already done.

https://github.com/reanahub/reana-client/blob/f0947268c4d72ddd801a7e2a0da3d19886257abb/reana_client/utils.py#L221

We could reuse cwltool parser - https://github.com/common-workflow-language/cwltool/blob/master/cwltool/main.py#L507