|
35 | 35 | def execute(ctx, config, runnable, job_path, **kwds): |
36 | 36 | """Execute a Galaxy activity.""" |
37 | 37 | try: |
38 | | - return _execute(ctx, config, runnable, job_path, **kwds) |
| 38 | + rval = _execute(ctx, config, runnable, job_path, **kwds) |
| 39 | + ctx.vlog("execute complete...") |
| 40 | + return rval |
39 | 41 | except Exception as e: |
| 42 | + ctx.vlog("execute failed...") |
| 43 | + import sys |
| 44 | + import traceback |
| 45 | + exc_type, exc_value, exc_traceback = sys.exc_info() |
| 46 | + traceback.print_tb(exc_traceback, limit=1, file=sys.stdout) |
| 47 | + traceback.print_exc() |
40 | 48 | return ErrorRunResponse(str(e)) |
41 | 49 |
|
42 | 50 |
|
@@ -87,6 +95,8 @@ def _execute(ctx, config, runnable, job_path, **kwds): |
87 | 95 | elif runnable.type in [RunnableType.galaxy_workflow, RunnableType.cwl_workflow]: |
88 | 96 | response_class = GalaxyWorkflowRunResponse |
89 | 97 | workflow_id = config.workflow_id(runnable.path) |
| 98 | + with open("imported_workflow.json", "w") as f: |
| 99 | + json.dump(user_gi.workflows.export_workflow_dict(workflow_id), f) |
90 | 100 | ctx.vlog("Found Galaxy workflow ID [%s] for path [%s]" % (workflow_id, runnable.path)) |
91 | 101 | # TODO: update bioblend to allow inputs_by. |
92 | 102 | # invocation = user_gi.worklfows.invoke_workflow( |
@@ -382,6 +392,7 @@ def outputs_dict(self): |
382 | 392 | def download_output_to(self, dataset_details, output_directory): |
383 | 393 | file_name = dataset_details.get("cwl_file_name") or dataset_details.get("name") |
384 | 394 | destination = os.path.join(output_directory, file_name) |
| 395 | + self._ctx.vlog("download for [%s]" % dataset_details) |
385 | 396 | self._user_gi.histories.download_dataset( |
386 | 397 | self._history_id, |
387 | 398 | dataset_details["id"], |
|
0 commit comments