reanahub / reana-client

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

client: error running workflows with spec file path using Python API #494

Closed mvidalgarcia closed 3 years ago

mvidalgarcia commented 3 years ago

The Pythonic API allows creating workflows programmatically https://blog.reana.io/posts/2021/reana-client-python-api. However, it only works by creating workflows from JSON specs. This is not compatible with all workflow engines, for example Yadage uses workflow specification file paths only as opposed to e.g. Serial where only JSON specs are accepted.

This can be achieved by allowing running from workflow file; manually upload workflow file with file_upload; use the rest of the existing API, create_workflow (to be tested, documented etc...)

Originally written by @diegodelemos

lukasheinrich commented 3 years ago

if it requirers a workflow JSON that's fine too, but should be documented

yadageschemas.load(....) should work

diegodelemos commented 3 years ago

Closed by https://github.com/reanahub/reana-client/pull/495.

mvidalgarcia commented 3 years ago

Hi @lukasheinrich, if you install reana-client from GitHub, branch maint-0.7, you should be able to run Yadage workflows using the file spec path. I leave this example for reference: https://gist.github.com/mvidalgarcia/a1e61628dd67ed1a8b80d868684e1352

The main difference compared to the example in the blog post is that one needs to upload the workflow/yadage dir as it contains the spec file and create_workflow_from_json() call is a bit different (workflow_json vs workflow_file).