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

[GSOC] Add validator for feasible space distribution #2404

Merged

Conversation

shashank-iitbhu
Copy link
Contributor

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 #2374

Checklist:

  • Docs included if any changes are user facing

Copy link
Member

@tenzen-y tenzen-y left a comment

Choose a reason for hiding this comment

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

As we discussed in today sync, we need to implement the unit testing.

Copy link
Member

@tenzen-y tenzen-y left a comment

Choose a reason for hiding this comment

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

@shashank-iitbhu Could you add a valid distribution so that we can verify the valid case?

Parameters: []experimentsv1beta1.ParameterSpec{

@shashank-iitbhu
Copy link
Contributor Author

@shashank-iitbhu Could you add a valid distribution so that we can verify the valid case?

Parameters: []experimentsv1beta1.ParameterSpec{

Added a test case for valid distribution.

pkg/webhook/v1beta1/experiment/validator/validator.go Outdated Show resolved Hide resolved
Comment on lines 470 to 478
parameters: func() []experimentsv1beta1.ParameterSpec {
ps := newFakeInstance().Spec.Parameters
ps[0].FeasibleSpace = experimentsv1beta1.FeasibleSpace{
Max: "5",
Min: "1",
Distribution: experimentsv1beta1.DistributionUniform,
}
return ps
}(),
Copy link
Member

@tenzen-y tenzen-y Aug 18, 2024

Choose a reason for hiding this comment

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

Suggested change
parameters: func() []experimentsv1beta1.ParameterSpec {
ps := newFakeInstance().Spec.Parameters
ps[0].FeasibleSpace = experimentsv1beta1.FeasibleSpace{
Max: "5",
Min: "1",
Distribution: experimentsv1beta1.DistributionUniform,
}
return ps
}(),
parameters: newFakeInstance(),

We already set the valid parameters in the newFakeInstance function, right?

return ps
}(),
wantErr: nil,
testDescription: "Valid distribution case",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
testDescription: "Valid distribution case",
testDescription: "Valid parameters case",

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@tenzen-y
Copy link
Member

@shashank-iitbhu Could you address lint errors?

Signed-off-by: Shashank Mittal <[email protected]>

validation logic fixed

added unit test

added unit test for valid distribution

requested changes made

Update pkg/webhook/v1beta1/experiment/validator/validator.go

Co-authored-by: Yuki Iwai <[email protected]>

fmt
Comment on lines 27 to 28
"k8s.io/apimachinery/pkg/util/validation/field"

Copy link
Member

Choose a reason for hiding this comment

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

Could you consolidate this dependency group into the Line 29-35 group?
After you remove the line 28, you run make update.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Signed-off-by: Shashank Mittal <[email protected]>
Copy link
Member

@tenzen-y tenzen-y left a comment

Choose a reason for hiding this comment

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

Thanks!
/lgtm
/approve

Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tenzen-y

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

@google-oss-prow google-oss-prow bot merged commit 4964d04 into kubeflow:master Aug 20, 2024
63 checks passed
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.

[GSOC] Project 8: Support various Parameter Distribution in Katib
2 participants