Hera makes Python code easy to orchestrate on Argo Workflows through native Python integrations. It lets you construct and submit your Workflows entirely in Python. ⭐️ Remember to star!
If yes, it is more likely to be an Argo bug unrelated to Hera. Please double check before submitting an issue to Hera.
2. This bug occurs in Hera when...
[x] exporting to YAML
[ ] submitting to Argo
[ ] running on Argo with the Hera runner
[ ] other:
Bug report
Describe the bug
Cannot generate YAML when building recursive steps, this works in hera <= 5.14.*
Error log if applicable:
File "/.../hera/workflows/_meta_mixins.py", line 376, in __call__
return Step(template=self, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/.../pydantic/v1/main.py", line 349, in __init__
__pydantic_self__._init_private_attributes()
File "/.../hera/shared/_global_config.py", line 181, in _init_private_attributes
self.__hera_init__()
File "/.../hera/workflows/_context.py", line 30, in __hera_init__
_context.add_sub_node(self)
File "/.../hera/workflows/_context.py", line 105, in add_sub_node
if t != node.template:
.
.
.
.
Maximum depth exceeded...
To Reproduce
Full Hera code to reproduce the bug:
from hera.expr import g
from hera.workflows import Parameter, Steps, WorkflowTemplate, Step
@script(constructor="inline")
def do(input_num: Annotated[int, Parameter(description="a number")]) -> Annotated[int, Parameter(name="output-num")]:
return input_num - 1
def get_workflow_template() -> WorkflowTemplate:
with WorkflowTemplate(
name="<name>",
entrypoint="steps",
) as wt:
with Steps(name="sub-steps", inputs=[Parameter(name="input-num", value=5)]) as st:
do_output = do(arguments={"input-num": f"{g.inputs.parameters.get('input-num'):$}"})
Step(
name="recurse",
arguments={
"input-num": do_output.get_parameter('output-num').value,
},
template=st,
when=f"{do_output.get_parameter('output-num')} <= 0",
)
with Steps(name="steps"):
st(
arguments={
"input-num": 10
}
)
return wt
Expected behavior
For the YAML to be properly generated, for this minimal example it shoudl be something like
Pre-bug-report checklist
1. This bug can be reproduced using pure Argo YAML
If yes, it is more likely to be an Argo bug unrelated to Hera. Please double check before submitting an issue to Hera.
2. This bug occurs in Hera when...
Bug report
Describe the bug Cannot generate YAML when building recursive steps, this works in hera <= 5.14.*
Error log if applicable:
To Reproduce Full Hera code to reproduce the bug:
Expected behavior For the YAML to be properly generated, for this minimal example it shoudl be something like
Environment
Additional context Add any other context about the problem here.