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): add experiment_id parameter to create run methods #9004

Merged
merged 1 commit into from
Mar 24, 2023

Conversation

droctothorpe
Copy link
Contributor

@droctothorpe droctothorpe commented Mar 17, 2023

Description of your changes:
Currently, create_run_from_pipeline_func and create_run_from_pipeline_package accept an experiment_name parameter and lookup the experiment ID with a backend call via create_experiment.

This tiny PR lets users pass the experiment ID directly as an optional alternative, circumventing the extra call, and improving alignment between these methods and create_recurring_run.

It also decouples the experiment handling logic from the run name handling logic. They were interleaved previously.

Checklist:

@google-oss-prow
Copy link

Hi @droctothorpe. Thanks for your PR.

I'm waiting for a kubeflow member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@droctothorpe
Copy link
Contributor Author

/assign @connor-mccarthy

@connor-mccarthy
Copy link
Member

@gkcalat @chensun, I seem to recall some discussion around particular parts of the API having trouble with requests that specify an experiment ID. It's possible I'm misremembering. Could you let me know if this sounds familiar?

/ok-to-test

@droctothorpe
Copy link
Contributor Author

FWIW, the run_pipeline invocation receives an experiment ID, it's just preceded by an ID lookup via create_experiment when the experiment name is passed.

@gkcalat
Copy link
Member

gkcalat commented Mar 17, 2023

As for the backend, a run in v1 API could have a resource reference to a parent experiment. In v2, the Run message got experiment_id field. If it's missing, the backend will assign the run to the default experiment. If the default experiment is missing (not created), then the BE will throw an error.

In v2, we recently marked experiment_id field outside of the Run message in CreateRunRequest as deprecated to align it with resource hierarchy logic in v1. experiment_id inside the Run should be set by SDK.

Adding a reference to the parent experiment by ID instead of name in v1 makes sense to me.

sdk/python/kfp/client/client.py Outdated Show resolved Hide resolved
sdk/python/kfp/client/client.py Show resolved Hide resolved
@droctothorpe droctothorpe force-pushed the experiment-id branch 4 times, most recently from c3b0a97 to 5be0a6c Compare March 20, 2023 23:11
@droctothorpe
Copy link
Contributor Author

Addressed the yapf finding. Are the other test failures unrelated?

Copy link
Member

@chensun chensun left a comment

Choose a reason for hiding this comment

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

/lgtm

sdk/python/kfp/client/client.py Show resolved Hide resolved
Co-authored-by: alenawang <[email protected]>
Co-authored-by: andreafehrman <[email protected]>
Co-authored-by: owmasch <[email protected]>
Co-authored-by: ryanrusson <[email protected]>
@google-oss-prow
Copy link

@droctothorpe: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
kubeflow-pipelines-sdk-execution-tests 4c9d4f5 link true /test kubeflow-pipelines-sdk-execution-tests

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@droctothorpe droctothorpe requested review from chensun and removed request for zijianjoy and connor-mccarthy March 22, 2023 15:28
Copy link
Member

@chensun chensun left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@google-oss-prow google-oss-prow bot added the lgtm label Mar 24, 2023
@google-oss-prow
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

@chensun chensun merged commit 3e1f3c6 into kubeflow:master Mar 24, 2023
@droctothorpe droctothorpe deleted the experiment-id branch March 24, 2023 18:32
rd-pong pushed a commit to rd-pong/pipelines that referenced this pull request Apr 26, 2023
…w#9004)

Co-authored-by: alenawang <[email protected]>
Co-authored-by: andreafehrman <[email protected]>
Co-authored-by: owmasch <[email protected]>
Co-authored-by: ryanrusson <[email protected]>
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.

4 participants