pipelines icon indicating copy to clipboard operation
pipelines copied to clipboard

[Environment Variables for ContainerSpec] Possibility to add custom env variables to a container component

Open hahahannes opened this issue 4 months ago • 0 comments

Feature Area

/area components

What feature would you like to see?

When using a ContainerSpec inside a pipeline, it would be useful to have the possibility to pass environment variables. At the moment only command and args can be provided.

@dsl.container_component
def user_workload(foo: Input[Dataset]):
    return dsl.ContainerSpec(image='alpine', command=['sh', '-c', 'echo Hello, $0'], args=[foo.path])
@dsl.container_component
def user_workload(foo: Input[Dataset]):
    return dsl.ContainerSpec(image='alpine', env={"FOO": foo.path})

What is the use case or pain point?

I want to run a pipeline where a user can submit the container image that shall be run. I want to provide some configuration values to the container but don't need to know the command. I would rather tell the user to use these environment values so that I am independent of different commands.

Is there a workaround currently?

At the moment, I pass the command and my parameters as arguments.


Love this idea? Give it a 👍.

hahahannes avatar Oct 03 '24 13:10 hahahannes