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(experiment): Delete dup trials #647

Merged
merged 3 commits into from
Jun 12, 2019
Merged

Conversation

gaocegege
Copy link
Member

@gaocegege gaocegege commented Jun 12, 2019

Signed-off-by: Ce Gao gaoce@caicloud.io

What this PR does / why we need it:

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

  1. Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.

Release note:



This change is Reviewable

Signed-off-by: Ce Gao <gaoce@caicloud.io>
Copy link
Member Author

@gaocegege gaocegege left a comment

Choose a reason for hiding this comment

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

/assign @johnugeorge

There are some bugs without the PR

Sometimes we will create dup trials, then unit test will fail.

@gaocegege
Copy link
Member Author

/assign @hougangliu

return err
}
actualDeleteCount := int(deleteCount)
if int32(len(trials.Items)) < deleteCount {
Copy link
Member

Choose a reason for hiding this comment

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

when do this condition happen?

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 idea, just to make sure the program won't crash.

Copy link
Member

Choose a reason for hiding this comment

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

I am not sure if it is needed. deleteCount is updated on the results of List operation. https://github.com/kubeflow/katib/blob/master/pkg/controller/v1alpha2/experiment/experiment_controller.go#L280

One question is if List operation returns stale entries. But this is not solved here too

Copy link
Member Author

Choose a reason for hiding this comment

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

Because we do not use the trials from https://github.com/kubeflow/katib/blob/master/pkg/controller/v1alpha2/experiment/experiment_controller.go#L280 . Thus the result may be not consistent, IMO.

Copy link
Member Author

Choose a reason for hiding this comment

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

This just to avoid IndexOutOfBoundsException

Copy link
Member

Choose a reason for hiding this comment

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

What if you use the earlier trial.Items results than a new List operation?

Copy link
Member Author

Choose a reason for hiding this comment

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

It works for me. I am working on it now.

Signed-off-by: Ce Gao <gaoce@caicloud.io>
@gaocegege
Copy link
Member Author

Comments are addressed, please take a look.
Thanks for your time 😄

Signed-off-by: Ce Gao <gaoce@caicloud.io>
@johnugeorge
Copy link
Member

/lgtm

@johnugeorge
Copy link
Member

/approve

@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: johnugeorge

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 ff27b55 into kubeflow:master Jun 12, 2019
@gaocegege gaocegege deleted the delete branch June 12, 2019 09:08
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