Skip to content

Commit 38e42a8

Browse files
authored
fix the hardcoded dir flags and streamline explicit copying for cwltool (PolusAI#344)
1 parent ddfdd0d commit 38e42a8

4 files changed

Lines changed: 4 additions & 17 deletions

File tree

src/sophios/api/pythonapi.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -821,9 +821,4 @@ def run(self, compile_args_dict: Dict[str, str] = {}, run_args_dict: Dict[str, s
821821
else:
822822
run_local_module.run_local(args, rose_tree, args.cachedir, args.cwl_runner, True)
823823

824-
# Finally, since there is an output file copying bug in cwltool,
825-
# we need to copy the output files manually. See comment above.
826-
if args.cwl_runner == 'cwltool' and args.copy_output_files:
827-
run_local_module.copy_output_files(self.process_name)
828-
829824
# Process = Union[Step, Workflow]

src/sophios/main.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,6 @@ def main() -> None:
199199
else:
200200
run_local.run_local(args, rose_tree, args.cachedir, args.cwl_runner, False)
201201

202-
# Finally, since there is an output file copying bug in cwltool,
203-
# we need to copy the output files manually. See comment above.
204-
if args.cwl_runner == 'cwltool' and args.copy_output_files:
205-
run_local.copy_output_files(yaml_stem)
206202
elif args.generate_cwl_workflow:
207203
io.write_to_disk(rose_tree, Path('autogenerated/'), True, args.inputs_file)
208204
else:

src/sophios/run_local.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def build_cmd(workflow_name: str, basepath: str, cwl_runner: str,
165165
cmd = [script] + container_pull + quiet + provenance + \
166166
container_cmd_ + write_summary + skip_schemas + path_check
167167
if cwl_runner == 'cwltool':
168-
cmd += ['--leave-outputs', '--enable-ext',
168+
cmd += ['--move-outputs', '--enable-ext',
169169
f'{basepath}/{workflow_name}.cwl', f'{basepath}/{workflow_name}_inputs.yml']
170170
elif cwl_runner == 'toil-cwl-runner':
171171
container_pull = []
@@ -176,8 +176,7 @@ def build_cmd(workflow_name: str, basepath: str, cwl_runner: str,
176176
'--jobStore', f'file:{basepath}/jobStore_{workflow_name}', # NOTE: This is the equivalent of --cachedir
177177
'--clean', 'always', # This effectively disables caching, but is reproducible
178178
'--disableProgress', # disable the progress bar in the terminal, saves UI cycle
179-
'--workDir', '/data1',
180-
'--coordinationDir', '/data1',
179+
'--enable-ext',
181180
'--logLevel', 'INFO',
182181
f'{basepath}/{workflow_name}.cwl', f'{basepath}/{workflow_name}_inputs.yml']
183182
cmd += passthrough_args
@@ -232,6 +231,8 @@ def run_local(args: argparse.Namespace, rose_tree: RoseTree, cachedir: Optional[
232231
print('via cwltool.main.main python API')
233232
retval = cwltool.main.main(cmd[1:])
234233
print(f'Final output json metadata blob is in output_{yaml_stem}.json')
234+
if args.copy_output_files:
235+
copy_output_files(yaml_stem)
235236
elif cwl_runner == 'toil-cwl-runner':
236237
print('via toil.cwl.cwltoil.main python API')
237238
retval = toil.cwl.cwltoil.main(cmd[1:])

tests/test_examples.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -228,11 +228,6 @@ def run_workflows(yml_path_str: str, yml_path: Path, cwl_runner: str, args: argp
228228
retval = sophios.run_local.run_local(args, rose_tree, None, cwl_runner, True)
229229
assert retval == 0
230230

231-
# Finally, since there is an output file copying bug in cwltool,
232-
# we need to copy the output files manually. See comment above.
233-
if args.cwl_runner == 'cwltool' and args.copy_output_files:
234-
sophios.run_local.copy_output_files(yaml_stem)
235-
236231

237232
@pytest.mark.fast
238233
@pytest.mark.serial

0 commit comments

Comments
 (0)