-
Notifications
You must be signed in to change notification settings - Fork 0
/
testrunbackend.py
executable file
·37 lines (34 loc) · 1.21 KB
/
testrunbackend.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env python
import click
import wflowbackend.backendtasks
import yadage.utils as utils
@click.command()
@click.argument('workflow')
@click.argument('url')
@click.argument('results')
@click.option('-t','--toplevel', default = 'from-github/pseudocap')
@click.option('-p', '--parameter', multiple=True, help = '<parameter name>=<yaml string> input parameter specifcations ')
@click.option('--cleanup/--no-cleanup',default = True)
def main(workflow,url,results,toplevel,parameter,cleanup):
initdata = utils.getinit_data([], parameter)
ctx = {
'jobguid': 'dummyjobid',
'shipout_base':'shipout_dummy',
'inputURL':url,
'inputAuth': True,
'backend':'testbackend',
'entry_point':'wflowyadageworker.backendtasks:run_workflow',
'resultlist':results.split(','),
'preset_pars': initdata,
'workflow':workflow,
'toplevel':toplevel,
}
wflowbackend.backendtasks.run_analysis_standalone(
wflowbackend.backendtasks.setupFromURL,
wflowbackend.backendtasks.dummy_onsuccess,
wflowbackend.backendtasks.cleanup if cleanup else lambda ctx: None,
ctx,
redislogging = False
)
if __name__ == '__main__':
main()