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

feat(sdk.v2): Support container environment variable in v2. #6515

Merged
merged 2 commits into from Sep 7, 2021

Conversation

chensun
Copy link
Member

@chensun chensun commented Sep 7, 2021

Description of your changes:
In v1, the add_env_variable() method takes an input of type kubernetes.client.models.V1EnvVar, which does not fit for Vertex Pipelines. So we add a new method set_env_variable() for v2.
The new method accepts a pair of name and value from constant values, but not from PipelineParam. The same limitation also exists in v1 add_env_variable().

Checklist:

@google-cla google-cla bot added the cla: yes label Sep 7, 2021
@chensun chensun requested review from neuromage and removed request for Ark-kun September 7, 2021 09:12
Copy link
Contributor

@ji-yaqi ji-yaqi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

_PipelineContainerSpec.EnvVar(name=name, value=value)
for name, value in self.env_dict.items()
])
return self
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe not for this PR, but I realized a lot of setting/adding functions return the Container. Wondering whether returning the container is needed, since the user setting the requirements already has the container?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the reason for returning container is to allow chained setting, for example, task.set_cpu_limi(...).set_env_variable(...).set_caching_option(...).
Without return self, the above setting has to be split into multi-lines:

task.set_cpu_limi(...)
task.set_env_variable(...)
task.set_caching_option(...)

@chensun
Copy link
Member Author

chensun commented Sep 7, 2021

/approve

@google-oss-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chensun

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-robot google-oss-robot merged commit 29226e9 into kubeflow:master Sep 7, 2021
@chensun chensun deleted the env branch September 7, 2021 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants