Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add --container-engine option to cwl-docker-extract #260

Merged
merged 1 commit into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/sophios/api/pythonapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,10 @@ def run(self) -> None:
# workflows, and if there is a local image available,
# `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.
cmd = ['cwl-docker-extract', '--force-download', f'autogenerated/{self.process_name}.cwl']
if args.container_engine == 'singularity':
cmd = ['cwl-docker-extract', f'-s --dir {args.homedir}', f'autogenerated/{self.process_name}.cwl']
else:
cmd = ['cwl-docker-extract', '--force-download', f'autogenerated/{self.process_name}.cwl']
sub.run(cmd, check=True)

# If you don't like it, you can programmatically overwrite anything in args
Expand Down
5 changes: 4 additions & 1 deletion src/sophios/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,10 @@ def main() -> None:
# workflows, and if there is a local image available,
# `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.
cmd = ['cwl-docker-extract', '--force-download', f'autogenerated/{yaml_stem}.cwl']
if args.container_engine == 'singularity':
cmd = ['cwl-docker-extract', f'-s --dir {args.homedir}', f'autogenerated/{yaml_stem}.cwl']
else:
cmd = ['cwl-docker-extract', '--force-download', f'autogenerated/{yaml_stem}.cwl']
sub.run(cmd, check=True)

if args.docker_remove_entrypoints:
Expand Down
5 changes: 4 additions & 1 deletion tests/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,10 @@ def run_workflows(yml_path_str: str, yml_path: Path, cwl_runner: str, args: argp
# workflows, and if there is a local image available,
# `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.
cmd = ['cwl-docker-extract', '--force-download', f'autogenerated/{Path(yml_path).stem}.cwl']
if args.container_engine == 'singularity':
cmd = ['cwl-docker-extract', f'-s --dir {args.homedir}', f'autogenerated/{Path(yml_path).stem}.cwl']
else:
cmd = ['cwl-docker-extract', '--force-download', f'autogenerated/{Path(yml_path).stem}.cwl']
sub.run(cmd, check=True)

return
Expand Down
Loading