Skip to content
Draft
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
1 change: 1 addition & 0 deletions streamflow/cwl/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ async def main(
context=context,
name=args.name,
output_directory=args.outdir,
hierarchical_output=args.hierarchical,
cwl_definition=cwl_definition,
cwl_inputs=cwl_inputs,
cwl_inputs_path=cwl_args[1] if len(cwl_args) == 2 else None,
Expand Down
1 change: 1 addition & 0 deletions streamflow/cwl/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ async def _async_main(args: argparse.Namespace) -> None:
streamflow_config["path"] = (
args.streamflow_file if args.streamflow_file is not None else os.getcwd()
)
args.hierarchical = False
workflow_config = WorkflowConfig(workflow_name, streamflow_config)
context = build_context(streamflow_config)
try:
Expand Down
11 changes: 10 additions & 1 deletion streamflow/cwl/translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1589,6 +1589,7 @@ def __init__(
context: StreamFlowContext,
name: str,
output_directory: str,
hierarchical_output: bool,
cwl_definition: (
cwl_utils.parser.CommandLineTool
| cwl_utils.parser.ExpressionTool
Expand All @@ -1601,6 +1602,7 @@ def __init__(
self.context: StreamFlowContext = context
self.name: str = name
self.output_directory: str = output_directory
self.hierarchical_output: bool = hierarchical_output
self.cwl_definition: (
cwl_utils.parser.CommandLineTool
| cwl_utils.parser.ExpressionTool
Expand Down Expand Up @@ -3143,7 +3145,14 @@ def translate(self) -> Workflow:
connector_ports={
target.deployment.name: deploy_step.get_output_port()
},
input_directory=self.output_directory,
input_directory=(
os.path.join(
self.output_directory,
output_name.lstrip(posixpath.sep),
)
if self.hierarchical_output
else self.output_directory
),
binding_config=BindingConfig(targets=[target]),
)
# Add the port as an input of the schedule step
Expand Down
5 changes: 5 additions & 0 deletions streamflow/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,11 @@ def __call__(
type=str,
help="Output directory in which to store final results of the workflow (default: current directory)",
)
run_parser.add_argument(
"--hierarchical",
action="store_true",
help="Preserve the output port structure (default: collapse all files into outdir)",
)
run_parser.add_argument(
"--quiet", action="store_true", help="Only prints results, warnings and errors"
)
Expand Down
1 change: 1 addition & 0 deletions tests/test_translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ async def test_inject_remote_input(
context=context,
name=utils.random_name(),
output_directory=tempfile.gettempdir(),
hierarchical_output=True,
cwl_definition=None, # CWL object
cwl_inputs=cwl_inputs,
cwl_inputs_path=None,
Expand Down
Loading