Passing argument to an inlined container ? (in quest of modularity) #727
-
I'm trying to pass arguments to a container build within an explicit Step.
goes from hera.workflows import Container, Parameter, Step, Steps, Workflow
whalesay_container = Container(
name="whalesay",
inputs=[Parameter(name="message")],
image="docker/whalesay",
command=["cowsay"],
args=["{{inputs.parameters.message}}"],
)
my_step = Step( # Explicit Step construction
name="inlined-step",
inline=whalesay_container, # Has to use "inline" because "template" was failing
arguments=[Parameter(name="message", value="Inline.")],
)
cluster = define_cluster()
with Workflow(generate_name="workflow-name-", entrypoint="main") as w:
with Steps(name="main") as s:
whalesay_container( # OK: implicit Step construction
name="not-inlined-step",
arguments=[Parameter(name="message", value="OK.")],
)
s.sub_steps.append(my_step). # FAIL
w.create() The above will fail with a message of the form 'templates.main.steps failed to resolve {{inputs.parameters.message}}'} Hence my question: how can one pass arguments to an explicitly build Step ? Notes
|
Beta Was this translation helpful? Give feedback.
Answered by
elliotgunton
Aug 3, 2023
Replies: 1 comment 1 reply
-
This is a problem with Argo itself with |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
elliotgunton
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a problem with Argo itself with
inline
steps being broken before v3.4.9. See argoproj/argo-workflows#11074. This code should work on 3.4.9