Skip to content

Commit 33a29aa

Browse files
authored
fix(cli): don't fail on workflows without inputs/outputs and print approriate warnings (#3694)
1 parent 50e20e1 commit 33a29aa

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

renku/core/workflow/model/concrete_execution_graph.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
from networkx.algorithms.cycles import simple_cycles
2424

2525
from renku.core.errors import ParameterError
26+
from renku.core.util import communication
2627
from renku.core.util.os import are_paths_related
2728
from renku.domain_model.workflow import composite_plan, parameter, plan
2829

@@ -65,6 +66,9 @@ def calculate_concrete_execution_graph(self, virtual_links: bool = False):
6566
else:
6667
if not virtual_links:
6768
continue
69+
if not workflow.inputs and not workflow.outputs:
70+
communication.warn(f"Workflow {workflow.name} has no inputs and outputs.")
71+
self.graph.add_node(workflow)
6872

6973
for input in workflow.inputs:
7074
inputs[input.actual_value].append(input)

renku/domain_model/workflow/plan.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
from werkzeug.utils import secure_filename
2828

2929
from renku.core import errors
30+
from renku.core.util import communication
3031
from renku.core.util.datetime8601 import local_now
3132
from renku.domain_model.provenance.agent import Person
3233
from renku.domain_model.provenance.annotation import Annotation
@@ -195,6 +196,11 @@ def __init__(
195196
):
196197
self.annotations: List[Annotation] = annotations or []
197198
self.command: str = command
199+
cmd = self.command.split(" ", 1)[0]
200+
if cmd == "renku" or cmd.endswith("/renku"):
201+
communication.error(
202+
f"Calling the 'renku' executable in workflows is not supported. Occurred in workflow {name}."
203+
)
198204
self.hidden_inputs: List[HiddenInput] = hidden_inputs or []
199205
self.inputs: List[CommandInput] = inputs or []
200206
self.outputs: List[CommandOutput] = outputs or []

0 commit comments

Comments
 (0)