You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
It's challenging for users to know when they need to JSON deserialize an output of a step/task in Argo.
Describe the solution you'd like
Hera should have the ability to infer what elements to deserialize based on the specification of a workflow.
Describe alternatives you've considered
Not doing this at all.
Additional context
Here's an example that illustrates the problem. At a high level:
we have a workflow that runs a set of steps
one of the steps is a reusable set of steps that is called on the output of a script that generates some numbers
we want to collate the outputs of those independent steps
the independent output of the reusable steps pipeline gets JSON encoded by Argo, resulting in independent integers coming in as JSON values
Hera successfully deserializes the JSON list that contains the values but does not deserialize the independent values
@script(image="python:3.10")defgenerate_starting_values():
print(list(range(1, 4)))
@script(image="python:3.10")defecho(value: int):
print(value)
@script(image="python:3.10")defdouble(value: int):
doubled=value*2# sleep(30 * (value + 1))print(doubled)
@script(image="python:3.10")defsquare(value: int):
squared=value*value# sleep(30 * (value + 1))print(squared)
@script(image="python:3.10")defall_sum(values: list):
print(sum(map(int, values))) # <<<<<<<<<<<<< we have to use `map` here to turn from str to int@script(image="python:3.10")defall_echo(values: list):
print(values)
withWorkflow(
generate_name="callable-steps-",
entrypoint="calling-steps",
) asw:
withSteps(
name="steps",
inputs=Parameter(name="value"),
outputs=Parameter(name="values", value_from=m.ValueFrom(parameter="{{steps.square.outputs.result}}"))
) asmy_steps:
e=echo(arguments={"value": "{{inputs.parameters.value}}"})
d=double(arguments={"value": e.result})
square(arguments={"value": d.result})
withSteps(name="calling-steps") ass:
g=generate_starting_values()
m=my_steps(arguments={"value": "{{item}}"}, with_param=g.result)
withs.parallel():
all_sum(arguments={"values": m.get_parameter("values").value})
all_echo(arguments={"values": m.get_parameter("values").value})
w.create()
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
It's challenging for users to know when they need to JSON deserialize an output of a step/task in Argo.
Describe the solution you'd like
Hera should have the ability to infer what elements to deserialize based on the specification of a workflow.
Describe alternatives you've considered
Not doing this at all.
Additional context
Here's an example that illustrates the problem. At a high level:
The text was updated successfully, but these errors were encountered: