Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

api: accept workflow specifications instead of toplevel+workflow name #32

Merged
merged 2 commits into from
Sep 29, 2017

Conversation

diegodelemos
Copy link
Member

Signed-off-by: Diego Rodriguez diego.rodriguez@cern.ch

@diegodelemos
Copy link
Member Author

diegodelemos commented Aug 31, 2017

From external repo or even from CAP (see yadage support)

$ curl -i -H 'Content-Type: application/json' -XPOST \
       --data '{"toplevel": "github:reanahub/reana-demo-helloworld", "workflow": "helloworld.yaml", "nparallel": "100", "preset_pars": {"name": "John Doe", "delay": "2"}}' \
       "http://192.168.99.100:32615/api/yadage/remote?organization=default&user=00000000-0000-0000-0000-000000000000"

From specification (built in reana-client using yadage-scehmas loader see PR)

$ curl -i -H 'Content-Type: application/json' -XPOST --data @helloworld.json \
       "http://192.168.99.100:32615/api/yadage/spec?organization=default&user=00000000-0000-0000-0000-000000000000"
helloworld.json
{
    "parameters": {
        "name": "World",
        "delay": 2
    },
    "workflow_spec": {
        "stages":[
            {
                "dependencies":{
                    "dependency_type":"jsonpath_ready",
                    "expressions":[
                        "init"
                    ]
                },
                "name":"helloworld",
                "scheduler":{
                    "parameters":[
                        {
                            "key":"delay",
                            "value":{
                                "expression_type":"stage-output-selector",
                                "output":"delay",
                                "stages":"init",
                                "unwrap":"true"
                            }
                        },
                        {
                            "key":"outputfile",
                            "value":"{workdir}/greetings.txt"
                        },
                        {
                            "key":"name",
                            "value":{
                                "expression_type":"stage-output-selector",
                                "output":"name",
                                "stages":"init",
                                "unwrap":"true"
                            }
                        }
                    ],
                    "scheduler_type": "singlestep-stage",
                    "step":{
                        "environment":{
                            "env":{

                            },
                            "environment_type":"docker-encapsulated",
                            "envscript":"",
                            "image":"reanahub/reana-demo-helloworld",
                            "imagetag":"latest",
                            "resources":[

                            ]
                        },
                        "process":{
                            "cmd":"python helloworld.py --name {name} --sleeptime {delay} --outputfile {outputfile}",
                            "process_type":"string-interpolated-cmd"
                        },
                        "publisher":{
                            "outputmap":{
                                "outputfile":"outputfile"
                            },
                            "publisher_type":"frompar-pub"
                        }
                    }
                }
            }
        ]
    }
}
ping @tiborsimko

Diego Rodriguez added 2 commits September 28, 2017 15:30
Signed-off-by: Diego Rodriguez <diego.rodriguez@cern.ch>
Signed-off-by: Diego Rodriguez <diego.rodriguez@cern.ch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants