Skip to content

Commit 4987036

Browse files
author
Vasu Jaganath
committed
fix the blocking calls in the async flow of run_local_async
1 parent b5b9010 commit 4987036

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/sophios/run_local.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def generate_run_script(cmdline: str) -> None:
5050

5151
def verify_container_engine_config(container_engine: str, ignore_container_install: bool) -> None:
5252
"""Verify that the container_engine is correctly installed and has
53-
correct permissions for the user.
53+
correct permissions for the user.
5454
Args:
5555
workflow_name (str): Name of the .cwl workflow file to be executed
5656
basepath (str): The path at which the workflow to be executed
@@ -227,12 +227,13 @@ def run_local(args: argparse.Namespace, rose_tree: RoseTree, cachedir: Optional[
227227
retval = proc.returncode
228228
return retval # Skip copying files to outdir/ for CI
229229
else:
230-
print('via toil.cwl.cwltoil.main python API')
231230
try:
232231
if cwl_runner == 'cwltool':
232+
print('via cwltool.main.main python API')
233233
retval = cwltool.main.main(cmd[1:])
234234
print(f'Final output json metadata blob is in output_{yaml_stem}.json')
235235
elif cwl_runner == 'toil-cwl-runner':
236+
print('via toil.cwl.cwltoil.main python API')
236237
retval = toil.cwl.cwltoil.main(cmd[1:])
237238
else:
238239
raise ValueError('unsupported cwl_runner')

src/sophios/run_local_async.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ async def run_cwl_serialized(workflow: Json, basepath: str,
103103
"""
104104
workflow_name = workflow['name']
105105
basepath = basepath.rstrip("/") if basepath != "/" else basepath
106-
output_dirs = pc.find_output_dirs(workflow)
107-
pc.create_output_dirs(output_dirs, basepath)
106+
output_dirs = await run_in_threadpool(pc.find_output_dirs, workflow)
107+
await run_in_threadpool(pc.create_output_dirs, output_dirs, basepath)
108108
compiled_cwl = workflow_name + '.cwl'
109109
inputs_yml = workflow_name + '_inputs.yml'
110110
# write _input.yml file

0 commit comments

Comments
 (0)