reanahub / reana-workflow-engine-cwl

REANA Workflow Engine CWL
http://reana-workflow-engine-cwl.readthedocs.io/
MIT License
5 stars 37 forks source link

cwl: cannot overwrite parameters from CLI #118

Closed diegodelemos closed 5 years ago

diegodelemos commented 5 years ago

When overwriting parameters from the CLI, the reana-client validation passes, but then an error is thrown in the workflow engine side:

# Client side
$ rc run -p sleeptime=2
[INFO] Creating a workflow...                                                                                                                                                                                                          
[INFO] /Users/rodrigdi/.virtualenvs/reana/bin/reana-client 1.0.20190815141648                                                                                                                                                          
[INFO] Resolved 'workflow/cwl/helloworld-kerberos.cwl' to 'file:///Users/rodrigdi/code/reanahub/reana-demo-helloworld/workflow/cwl/helloworld-kerberos.cwl'                                                                            
workflow.41                                                                                                                                                                                                                            
[INFO] Uploading files...                                                                                          
File code/helloworld.py was successfully uploaded.                                                                                                                                                                                     
File data/names.txt was successfully uploaded.                                                                                                                                                                                         
[INFO] Starting workflow...                                                                                        
workflow.41 is running  

# Workflow engine side
$ kubectl logs batch-cwl-34d20aa7-908a-45b9-b56a-36df1638e6ae-7rkgz workflow-engine
...
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/cwltool/main.py", line 830, in main
    logger=_logger)
  File "/code/reana_workflow_engine_cwl/pipeline.py", line 101, in executor
    raise e
  File "/code/reana_workflow_engine_cwl/pipeline.py", line 85, in executor
    for runnable in jobs:
  File "/usr/local/lib/python3.6/site-packages/cwltool/workflow.py", line 580, in job
    builder = self._init_job(job_order, runtimeContext)
  File "/usr/local/lib/python3.6/site-packages/cwltool/process.py", line 657, in _init_job
    raise_from(WorkflowException("Invalid job input record:\n" + Text(err)), err)
  File "/usr/local/lib/python3.6/site-packages/future/utils/__init__.py", line 400, in raise_from
    exec(execstr, myglobals, mylocals)
  File "<string>", line 1, in <module>
cwltool.errors.WorkflowException: Invalid job input record:
inputs.json:1:131: the `sleeptime` field is not valid because
inputs.json:1:131:   `'2'` is not int
workflow done
...
dprelipcean commented 5 years ago

The workflow parameters are received as strings, and then stored as JSON, and this affects integers, e.g. 2 becomes '\'2\' instead of '2', and apparently the new CWL version makes the distinction. I will make a parser for the workflow parameters inside cwl engine.