pipelines icon indicating copy to clipboard operation
pipelines copied to clipboard

Pass env vars to create_custom_training_job_from_component

Open jmmanso opened this issue 1 year ago • 2 comments

Feature Area

/area components

What feature would you like to see?

I would like to add an env_var argument to the custom_job.utils.create_custom_training_job_from_component function, so that I can pass environment variables to my application container.

What is the use case or pain point?

When building pipeline components with this function, there is no way to pass environment variables to my container. It is weird that this function supports all other parts of the container spec, except "env". I wonder if this was just an oversight.

Is there a workaround currently?

I had to vendor and modify the code of create_custom_training_job_from_component. It's a super simple change, just add env_vars as argument and add this inside the function:

 if env_vars:
        worker_pool_spec["container_spec"]["env"] = env_vars

Love this idea? Give it a 👍.

jmmanso avatar Oct 27 '23 20:10 jmmanso

/assign @connor-mccarthy

zijianjoy avatar Nov 02 '23 22:11 zijianjoy

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Feb 01 '24 07:02 github-actions[bot]

This issue has been automatically closed because it has not had recent activity. Please comment "/reopen" to reopen it.

github-actions[bot] avatar Mar 14 '24 07:03 github-actions[bot]

@jmmanso did you find a workaround for this?

pthieu avatar Jun 17 '24 15:06 pthieu

@pthieu it actually got fixed at the source, thanks for following up

jmmanso avatar Jun 17 '24 16:06 jmmanso