Skip to content

Commit

Permalink
replace --user-space-docker-cmd with --singularity (#278)
Browse files Browse the repository at this point in the history
* replace --user-space-docker-cmd with --singularity

* fix cwl-docker-extract
  • Loading branch information
ndonyapour authored Oct 1, 2024
1 parent c69e897 commit 2a427d8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/sophios/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def main() -> None:
# `docker run` will NOT query the remote repository for the latest image!
# cwltool has a --force-docker-pull option, but this may cause multiple pulls in parallel.
if args.container_engine == 'singularity':
cmd = ['cwl-docker-extract', f'-s --dir {args.homedir}', f'autogenerated/{yaml_stem}.cwl']
cmd = ['cwl-docker-extract', '-s', '--dir', f'{args.homedir}', f'autogenerated/{yaml_stem}.cwl']
else:
cmd = ['cwl-docker-extract', '--force-download', f'autogenerated/{yaml_stem}.cwl']
sub.run(cmd, check=True)
Expand Down
16 changes: 14 additions & 2 deletions src/sophios/run_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,13 @@ def run_local(args: argparse.Namespace, rose_tree: RoseTree, cachedir: Optional[
cachedir_ = ['--cachedir', cachedir] if cachedir else []
net = ['--custom-net', args.custom_net] if args.custom_net else []
provenance = ['--provenance', f'provenance/{yaml_stem}'] if not args.no_provenance else []
docker_cmd_ = [] if docker_cmd == 'docker' else ['--user-space-docker-cmd', docker_cmd]
docker_cmd_: List[str] = []
if docker_cmd == 'docker':
docker_cmd_ = []
elif docker_cmd == 'singularity':
docker_cmd_ = ['--singularity']
else:
docker_cmd_ = ['--user-space-docker-cmd', docker_cmd]
write_summary = ['--write-summary', f'output_{yaml_stem}.json']
path_check = ['--relax-path-checks']
# See https://github.com/common-workflow-language/cwltool/blob/5a645dfd4b00e0a704b928cc0bae135b0591cc1a/cwltool/command_line_tool.py#L94
Expand Down Expand Up @@ -205,7 +211,13 @@ def run_local(args: argparse.Namespace, rose_tree: RoseTree, cachedir: Optional[
# NOTE: toil-cwl-runner always runs in parallel
net = ['--custom-net', args.custom_net] if args.custom_net else []
provenance = ['--provenance', f'provenance/{yaml_stem}'] if not args.no_provenance else []
docker_cmd_ = [] if docker_cmd == 'docker' else ['--user-space-docker-cmd', docker_cmd]
docker_cmd_ = []
if docker_cmd == 'docker':
docker_cmd_ = []
elif docker_cmd == 'singularity':
docker_cmd_ = ['--singularity']
else:
docker_cmd_ = ['--user-space-docker-cmd', docker_cmd]
path_check = ['--relax-path-checks']
# See https://github.com/common-workflow-language/cwltool/blob/5a645dfd4b00e0a704b928cc0bae135b0591cc1a/cwltool/command_line_tool.py#L94
# https://github.com/DataBiosphere/toil/blob/6558c7f97fb37c6ef6f469c7ae614109050322f4/src/toil/options/cwl.py#L152
Expand Down

0 comments on commit 2a427d8

Please sign in to comment.