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): CLI - Allow upload_version by the pipeline's name. Fixes #3901 #4087

Merged
merged 24 commits into from
Jul 8, 2020

Conversation

NikeNano
Copy link
Member

Description of your changes:
This pr updates the KFP cli to allow pipeline upload_version to accept name instead of id. This will make is easier for some users and allow for a larger flexibility.

This should fix PR: #3901

We could also the check that only one/and always one of pipeline_name and pipeline_is using click, whould this be prefered?

@kubeflow-bot
Copy link

This change is Reviewable

sdk/python/kfp/_client.py Outdated Show resolved Hide resolved
@NikeNano
Copy link
Member Author

Thanks for the feedback @Bobgy. I have not used protobuff before but gave it a try and got it working at least :)! I am not sure where it would make the most sense to put filter_pb2.py and if it should be auto generated and if so how? Concerning the filtering on namespace I am not sure how we can do it? Is it allowed to do the same way?

@NikeNano
Copy link
Member Author

Thanks for the feedback @Ark-kun, resolved the comments.

@NikeNano
Copy link
Member Author

NikeNano commented Jul 1, 2020

/test kubeflow-pipeline-sample-test

sdk/python/kfp/_client.py Outdated Show resolved Hide resolved
@NikeNano
Copy link
Member Author

NikeNano commented Jul 1, 2020

@Ark-kun I have updated but are getting some issues with ProtoBuf and it seems to be a issue related to versions for ProtoBuf. I have updated the packages in the requirement file but are builds/test using dependencies from somewhere else?

This threads talks about the issue: https://stackoverflow.com/questions/61922334/how-to-solve-attributeerror-module-google-protobuf-descriptor-has-no-attribu

Copy link
Contributor

@Bobgy Bobgy left a comment

Choose a reason for hiding this comment

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

Great work! Thanks for figuring out how to generate a proper helper class for the filter!

sdk/python/kfp/_client.py Show resolved Hide resolved
sdk/python/kfp/_client.py Outdated Show resolved Hide resolved
sdk/python/kfp/_client.py Outdated Show resolved Hide resolved
sdk/python/kfp/_client.py Outdated Show resolved Hide resolved
sdk/python/kfp/filter_pb2.py Outdated Show resolved Hide resolved
@Bobgy Bobgy changed the title feat(Cli). Update to allow upload_version to be done using only the name. feat(sdk): CLI - Update to allow upload_version to be done using only the name. Jul 3, 2020
@Bobgy
Copy link
Contributor

Bobgy commented Jul 3, 2020

updated title to better comply with our convention

Copy link
Contributor

@Bobgy Bobgy left a comment

Choose a reason for hiding this comment

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

thanks @NikeNano!

mostly good now. I added comments about some implementation details

sdk/python/kfp/cli/pipeline.py Show resolved Hide resolved
sdk/python/kfp/_client.py Outdated Show resolved Hide resolved
Args:
name: pipeline name
page_token: token for starting of the page.
page_size: size of the page.
Copy link
Contributor

Choose a reason for hiding this comment

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

reminder, also the docstring

Copy link
Member Author

Choose a reason for hiding this comment

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

sorry, multi tasking while listening in to some meetings.

@Bobgy
Copy link
Contributor

Bobgy commented Jul 6, 2020

Backup plan: did you consider constructing the json payload by yourself, the filter package is just a helper, we may not need it at all like in frontend code sample.

I though about it but, assumed the preferred way was to built the proper helper file. I will push an solution where we do it as the frontend :)

I agree proper helper is the preferred way, just that when it's hard to get it working. We can choose the practical path.

@Bobgy Bobgy changed the title feat(sdk): CLI - Update to allow upload_version to be done using only the name. feat(sdk): CLI - Allow upload_version by the pipeline's name. Fixes #3901 Jul 6, 2020
@Bobgy
Copy link
Contributor

Bobgy commented Jul 6, 2020

Updated title to be more concise and indicates which issue it solved

sdk/python/kfp/_client.py Outdated Show resolved Hide resolved
@Bobgy
Copy link
Contributor

Bobgy commented Jul 6, 2020

/lgtm
This is perfect!

/assign @Ark-kun @numerology
Do you want to further review?

I think this is good to go.

Copy link

@numerology numerology left a comment

Choose a reason for hiding this comment

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

Thanks! @NikeNano

sdk/python/kfp/_client.py Outdated Show resolved Hide resolved
# Operators on scalar values. Only applies to one of |int_value|,
# |long_value|, |string_value| or |timestamp_value|.
"EQUALS" : 1,
"NOT_EQUALS" : 2,

Choose a reason for hiding this comment

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

Just for my education, is the predicates other than 'EQUALS' being used now in the client?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, they are not I kept them on order to have a reference for the alternative since we don't have a proper helper file. Maybe we should remove it. Initially I only. set it to 1, but @Bobgy suggested that we added a mapping in order for readers of the code to understand what it meant.

sdk/python/kfp/_client.py Outdated Show resolved Hide resolved
sdk/python/kfp/cli/pipeline.py Outdated Show resolved Hide resolved
sdk/python/kfp/cli/pipeline.py Outdated Show resolved Hide resolved
sdk/python/kfp/cli/pipeline.py Outdated Show resolved Hide resolved
Co-authored-by: Jiaxiao Zheng <jxzheng@google.com>
@k8s-ci-robot k8s-ci-robot removed the lgtm label Jul 7, 2020
Niklas Hansson and others added 2 commits July 7, 2020 14:23
Co-authored-by: Jiaxiao Zheng <jxzheng@google.com>
@Bobgy
Copy link
Contributor

Bobgy commented Jul 8, 2020

/lgtm
/approve

Thanks!

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Bobgy

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

@Bobgy
Copy link
Contributor

Bobgy commented Jul 8, 2020

@googlebot rescan

@k8s-ci-robot k8s-ci-robot merged commit aae1eba into kubeflow:master Jul 8, 2020
Jeffwan pushed a commit to Jeffwan/pipelines that referenced this pull request Dec 9, 2020
…ubeflow#3901 (kubeflow#4087)

* Update _client.py

* Allow for passing name instead of only pipeline_id

* fixed old rebase issue

* protobuf fix

* raise error and remove f-string

* moved file

* updated python proto packages versions

* Update sdk/python/kfp/_client.py

* restructured and added to build

* changes structure of import

* Updated the files

* further updates of client and filter.proto

* alternative

* clean up

* clean up

* remove helperfiles

* futher clean up

* clean up or eaither name or id

* update doc strings

* remove page_size

* Update sdk/python/kfp/_client.py

Co-authored-by: Jiaxiao Zheng <jxzheng@google.com>

* Update sdk/python/kfp/cli/pipeline.py

Co-authored-by: Jiaxiao Zheng <jxzheng@google.com>

* updated to classical string formattin

Co-authored-by: Jiaxiao Zheng <jxzheng@google.com>
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.

7 participants