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

Clear default exp table on delete and create default exp on run create if none exists #1199

Merged

Conversation

rileyjbauer
Copy link
Contributor

@rileyjbauer rileyjbauer commented Apr 22, 2019

With this change, if the delete experiment API is called on the default
experiment, then the ID will also be removed from the default_experiments
table.

Additionally, if the default experiment doesn't exist and a new run is
created without an experiment, a new default experiment will be created,
and the run will be placed within this experiment.

This PR also fixes an issue in some of the backend store files where the connection to the database was not being closed. This wasn't much of an issue in production, but it appeared that in the test environment, only one connection was allowed, so failing to close the connection would cause subsequent queries to fail, claiming that the table no longer existed.


This change is Reviewable

if no default exists

With this change, if the delete experiment API is called on the default
experiment, then the ID will also be removed from the default_experiments
table.

Additionally, if the default experiment doesn't exist and a new run is
created without an experiment, a new default experiment will be created,
and the run will be placed within this experiment.
@rileyjbauer rileyjbauer changed the title [WIP] - Clear default exp table on delete and create default exp on run create if none exists Clear default exp table on delete and create default exp on run create if none exists Apr 24, 2019
@rileyjbauer rileyjbauer force-pushed the create-and-delete-default-exp branch from 3445425 to 57fc0f0 Compare April 24, 2019 23:35
@@ -188,6 +189,11 @@ func (s *ExperimentStore) DeleteExperiment(id string) error {
tx.Rollback()
return util.NewInternalServerError(err, "Failed to delete experiment %s from table", id)
}
err = s.defaultExperimentStore.ClearDefaultExperimentId(tx, id)
Copy link
Member

Choose a reason for hiding this comment

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

how about naming this wipeoutExperimentIdIfDefault or something equvalent.
with this name it's a bit hard to follow without context

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, you're very right. How about UnsetDefaultExperimentIdIfIdMatches ?

@IronPan
Copy link
Member

IronPan commented Apr 24, 2019

/lgtm

@rileyjbauer
Copy link
Contributor Author

/test kubeflow-pipeline-e2e-test

@yebrahim
Copy link
Contributor

Why allow the default experiment to be deleted? If it's created automatically on init, I'd think it's a permanent resource.
I think I don't understand the model at work here, what does the default_experiments table do? Why not just have one permanent row in the experiments table with a preset id?

@rileyjbauer
Copy link
Contributor Author

Why allow the default experiment to be deleted? If it's created automatically on init, I'd think it's a permanent resource.
I think I don't understand the model at work here, what does the default_experiments table do? Why not just have one permanent row in the experiments table with a preset id?

"Permanence" can be difficult to ensure in practice, and manually specifying a UUID is generally discouraged as well. The default_experiments table just stores the ID of the current default experiment so its UUID can be generated normally, but we can still find it without relying on its name or anything like that

@IronPan
Copy link
Member

IronPan commented Apr 29, 2019

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: IronPan

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

1 similar comment
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: IronPan

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

@k8s-ci-robot k8s-ci-robot merged commit d88ba38 into kubeflow:master Apr 29, 2019
@rileyjbauer rileyjbauer deleted the create-and-delete-default-exp branch May 6, 2019 22:11
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