Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Runtimes] Adding a modifier and auto-mount option to configure multiple env variables #2276

Merged
merged 6 commits into from Aug 29, 2022

Conversation

theSaarco
Copy link
Member

@theSaarco theSaarco commented Aug 18, 2022

Added a modifier function set_env_variables to add multiple env. variables to a runtime. Also added an env auto-mount option to use this function automatically. This can be used to mount an arbitrary set of env variables to every runtime in a project.
While there are existing ways through MLRun/KFP-modifiers to add env. variables to runtimes, they have some short-comings, which this function solves:

  • Since it's a modifier, it can be used with RunConfig which has an option to apply modifiers, but does not have ways to set env. variables on the RunConfig itself. Also, since auto-mount option is available, it can be used for every job submitted without having to tweak the RunConfig parameters
  • It accepts multiple env. variables in a single execution. This makes it flexible and suitable to use in auto-mount where there's a single default modifier which can be configured
  • The variables can be passed as a dictionary or as kwargs. Again, this makes it easier to configure it as auto-mount function. For example, you can call:
    function.apply(set_env_variables({"ENV1": "value1", "ENV2": "value2"}))
    and can also do the same with:
    function.apply(set_env_variables(ENV1="value1", ENV2="value2"))
    The kwargs option is more limited and should be used for simple keys/values, while the dictionary option can be used for keys which do not pass as Python parameter names etc.

@theSaarco theSaarco changed the title [Runtimes] Adding a modifier to mount multiple env variables [Runtimes] Adding a modifier and auto-mount option to mount multiple env variables Aug 28, 2022
@theSaarco theSaarco changed the title [Runtimes] Adding a modifier and auto-mount option to mount multiple env variables [Runtimes] Adding a modifier and auto-mount option to configure multiple env variables Aug 28, 2022
@Tankilevitch Tankilevitch merged commit 68f1b4e into mlrun:development Aug 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants