Skip to content

How to parametrise volumes with @script() ? #738

Closed Answered by elliotgunton
EricBoix asked this question in Q&A
Discussion options

You must be logged in to vote

Unfortunately right now the easiest way to do this is a mix of Argo syntax and the inputs present in the script decorator (we're working on improving this!)

@script(
    image="python:3.9-alpine",
    inputs=[Parameter(name="persistedVolume")],  # specify an input to the template here instead of as a function arg
    volume=Volume(
        name="workdir",
        mount_path="{{inputs.parameters.persistedVolume}}",  # refer to the input with Argo syntax
    ),
)
def do_some_stuff():          #  persisted_volume (probably) not needed here
     <snip ... some python code ...snip>

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by elliotgunton
Comment options

You must be logged in to vote
1 reply
@elliotgunton
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants