kubeflow / katib

Automated Machine Learning on Kubernetes
https://www.kubeflow.org/docs/components/katib
Apache License 2.0
1.51k stars 442 forks source link

[GSoC] Added `DistributionType` to Experiment API #2377

Closed shashank-iitbhu closed 3 months ago

shashank-iitbhu commented 4 months ago

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:

shashank-iitbhu commented 4 months ago

ParameterType and DistributionType can be made exclusive using this logic

// Check that only one of ParameterType or DistributionType is specified
        if (param.ParameterType != "" && param.DistributionType != "") ||
            (param.ParameterType == "" && param.DistributionType == "") {
            allErrs = append(allErrs, field.Invalid(parametersPath.Index(i).Child("parameterType"),
                param.ParameterType, "either parameterType or distributionType must be specified, but not both"))
        }

at https://github.com/kubeflow/katib/blob/154a85b7408a827c35150874c1197ec910072bab/pkg/webhook/v1beta1/experiment/validator/validator.go#L254-L256

cc @andreyvelich @tenzen-y

shashank-iitbhu commented 4 months ago

/area gsoc

google-oss-prow[bot] commented 3 months ago

[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: - ~~[OWNERS](https://github.com/kubeflow/katib/blob/master/OWNERS)~~ [tenzen-y] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment