-
Notifications
You must be signed in to change notification settings - Fork 459
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
Python SDK - Generate Name functionality for creating experiments. #2272
Merged
google-oss-prow
merged 12 commits into
kubeflow:master
from
bharathk005:feature-py-sdk-create-exp-generateName
Apr 2, 2024
Merged
Changes from 2 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
e7eefc5
added dco
bharathk005 1039f4b
updated condition
bharathk005 5be7150
added exception to catch missing name and generateName
bharathk005 ccc1be2
updated experiment_name in create_experiment
bharathk005 15d4582
py sdk create_exp - added type validation
bharathk005 9e24312
Merge branch 'kubeflow:master' into feature-py-sdk-create-exp-generat…
bharathk005 84f42d3
added dco
bharathk005 e75ad6b
updated condition
bharathk005 67f12c1
added exception to catch missing name and generateName
bharathk005 56b3f31
updated experiment_name in create_experiment
bharathk005 c583c68
py sdk create_exp - added type validation
bharathk005 a4e4b62
Merge branch 'feature-py-sdk-create-exp-generateName' of github.com:b…
bharathk005 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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, it will raise Exception if
experiment.metadata.name
is not set.We might need to have something like this:
Any thoughts @droctothorpe @tenzen-y @johnugeorge @bharathk005 @fensterwetter
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 the review.
I have added some changes based on your suggestions. Test cases pass on my machine.
Regarding the type assertion, the function already expects a "models.V1beta1Experiment" type:
katib/sdk/python/v1beta1/kubeflow/katib/api/katib_client.py
Lines 78 to 80 in 1039f4b
Please let me know if we still need to check for the type.
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.
Additionally, I would suggest to add the Exception if both
name
andgenerateName
are specified.@andreyvelich 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.
Won't Kubernetes Python client throw an error when we try to create custom resources in that 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.
That's true, but since Python is not strong typed language, users can still send
dict
as Experiment. Otherwise, we need to checktype(experiment)
and through exception. Do we want to give users functionality to pass dict withcreate_experiment
API @droctothorpe @tenzen-y @johnugeorge ?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 imaged like 102-103:
katib/sdk/python/v1beta1/kubeflow/katib/api/katib_client.py
Lines 102 to 103 in 5be7150
So, my concerns have gone away. Thanks.
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 agree with the necessary for type assertion, but I think this is PR to support name generation.
So, I'm ok with working on it in another PR.
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 @andreyvelich thanks for the comments.
Are these the changes that need to be implemented?
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 @andreyvelich Thanks for your time. I have pushed a commit with the changes mentioned in this thread. Please review and let me know.