-
Notifications
You must be signed in to change notification settings - Fork 724
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
[SDK] Use Training Client without Kube Config #1740
[SDK] Use Training Client without Kube Config #1740
Conversation
Pull Request Test Coverage Report for Build 3997111929
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andreyvelich Thanks for this work!
This is very useful!
/lgtm
config_file: str = None, | ||
context: str = None, | ||
client_configuration: client.Configuration = None, | ||
no_config: bool = False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not necessary? If client_configuration
is not None, then it should take precedence over config_file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we remove no_config
, I guess we can not inform about missing client_configuration
, right?
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tenzen-y is right . I did this since user can set config_file
and client_configuration
to add additional information about the config at the same time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We had discussion with @johnugeorge around this.
I guess kube-config supports all configuration that user can set via client.Configuration()
object (proxy, token. etc.).
@terrytangyuan @tenzen-y Did you ever see the use-case when user wants to set custom client_configuration
with existing kube-config ?
If not, we can do this:
- If user set
config_file
useload_kube_config()
. - If user doesn't set
config_file
and doesn't setclient_configuration
useload_kube_config()
orload_incluster_config()
. - If user set
client_configuration
skipload_kube_config()
andload_incluster_config()
.
no_config
flag might look a bit hacky.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I have not seen that use case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tenzen-y @terrytangyuan @johnugeorge I modified the PR to ignore kube config when client_configuration
is set.
Let's see if we get any user request to change it back.
config_file=None, | ||
context=None, | ||
client_configuration=None, | ||
persist_config=True, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andreyvelich Is it possible to set a persistent_config
with a client_configuration
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think persistent_config
is used when we send client_configuration to load_kube_config()
for Kubernetes python client.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It makes sense.
Thanks to @andreyvelich! /lgtm Also, can we introduce the same improvement to Katib? |
Sure, I submit PR before the release once @terrytangyuan @johnugeorge agree on that change. |
LGTM |
Thanks! /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andreyvelich, terrytangyuan 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 |
This change will allow user to create
TrainingClient
without kube config using Client Configuration and Bearer Token.It is useful for remote-like and enterprise usage of our SDK.
Similar to this example: https://github.com/kubernetes-client/python/blob/67f9c7a97081b4526470cad53576bc3b71fa6fcc/examples/remote_cluster.py#L31
/assign @kubeflow/wg-training-leads @tenzen-y @anencore94