mirror of
https://github.com/hanzo-ml/katib.git
synced 2026-09-24 00:31:27 +00:00
* chore(ci): add k8s version 1.31. Signed-off-by: Electronic-Waste <[email protected]> * chore(Makefile): upgrade envtest version to 1.31 & setup-envtest to release-0.19. Signed-off-by: Electronic-Waste <[email protected]> * chore: update k8s related package in go.mod Signed-off-by: Electronic-Waste <[email protected]> * chore: make generate. Signed-off-by: Electronic-Waste <[email protected]> * fix(test): add SkipNameValidation option to test frame. Signed-off-by: Electronic-Waste <[email protected]> * refactor(grpc): remove deprecated grpc.Dial implementation. Signed-off-by: Electronic-Waste <[email protected]> * fix(dependency): remove dependency on k8s v1.28 Signed-off-by: Electronic-Waste <[email protected]> * fix: add type assertion to ptr.To Signed-off-by: Electronic-Waste <[email protected]> --------- Signed-off-by: Electronic-Waste <[email protected]>
140 lines
7.3 KiB
Go
140 lines
7.3 KiB
Go
/*
|
|
Copyright 2022 The Kubeflow Authors.
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
you may not use this file except in compliance with the License.
|
|
You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
*/
|
|
|
|
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
|
|
|
package v1beta1
|
|
|
|
import (
|
|
commonv1beta1 "github.com/kubeflow/katib/pkg/apis/controller/common/v1beta1"
|
|
experimentsv1beta1 "github.com/kubeflow/katib/pkg/apis/controller/experiments/v1beta1"
|
|
)
|
|
|
|
// ExperimentSpecApplyConfiguration represents a declarative configuration of the ExperimentSpec type for use
|
|
// with apply.
|
|
type ExperimentSpecApplyConfiguration struct {
|
|
Parameters []ParameterSpecApplyConfiguration `json:"parameters,omitempty"`
|
|
Objective *commonv1beta1.ObjectiveSpec `json:"objective,omitempty"`
|
|
Algorithm *commonv1beta1.AlgorithmSpec `json:"algorithm,omitempty"`
|
|
EarlyStopping *commonv1beta1.EarlyStoppingSpec `json:"earlyStopping,omitempty"`
|
|
TrialTemplate *TrialTemplateApplyConfiguration `json:"trialTemplate,omitempty"`
|
|
ParallelTrialCount *int32 `json:"parallelTrialCount,omitempty"`
|
|
MaxTrialCount *int32 `json:"maxTrialCount,omitempty"`
|
|
MaxFailedTrialCount *int32 `json:"maxFailedTrialCount,omitempty"`
|
|
MetricsCollectorSpec *commonv1beta1.MetricsCollectorSpec `json:"metricsCollectorSpec,omitempty"`
|
|
NasConfig *NasConfigApplyConfiguration `json:"nasConfig,omitempty"`
|
|
ResumePolicy *experimentsv1beta1.ResumePolicyType `json:"resumePolicy,omitempty"`
|
|
}
|
|
|
|
// ExperimentSpecApplyConfiguration constructs a declarative configuration of the ExperimentSpec type for use with
|
|
// apply.
|
|
func ExperimentSpec() *ExperimentSpecApplyConfiguration {
|
|
return &ExperimentSpecApplyConfiguration{}
|
|
}
|
|
|
|
// WithParameters adds the given value to the Parameters field in the declarative configuration
|
|
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
|
|
// If called multiple times, values provided by each call will be appended to the Parameters field.
|
|
func (b *ExperimentSpecApplyConfiguration) WithParameters(values ...*ParameterSpecApplyConfiguration) *ExperimentSpecApplyConfiguration {
|
|
for i := range values {
|
|
if values[i] == nil {
|
|
panic("nil value passed to WithParameters")
|
|
}
|
|
b.Parameters = append(b.Parameters, *values[i])
|
|
}
|
|
return b
|
|
}
|
|
|
|
// WithObjective sets the Objective field in the declarative configuration to the given value
|
|
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
|
// If called multiple times, the Objective field is set to the value of the last call.
|
|
func (b *ExperimentSpecApplyConfiguration) WithObjective(value commonv1beta1.ObjectiveSpec) *ExperimentSpecApplyConfiguration {
|
|
b.Objective = &value
|
|
return b
|
|
}
|
|
|
|
// WithAlgorithm sets the Algorithm field in the declarative configuration to the given value
|
|
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
|
// If called multiple times, the Algorithm field is set to the value of the last call.
|
|
func (b *ExperimentSpecApplyConfiguration) WithAlgorithm(value commonv1beta1.AlgorithmSpec) *ExperimentSpecApplyConfiguration {
|
|
b.Algorithm = &value
|
|
return b
|
|
}
|
|
|
|
// WithEarlyStopping sets the EarlyStopping field in the declarative configuration to the given value
|
|
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
|
// If called multiple times, the EarlyStopping field is set to the value of the last call.
|
|
func (b *ExperimentSpecApplyConfiguration) WithEarlyStopping(value commonv1beta1.EarlyStoppingSpec) *ExperimentSpecApplyConfiguration {
|
|
b.EarlyStopping = &value
|
|
return b
|
|
}
|
|
|
|
// WithTrialTemplate sets the TrialTemplate field in the declarative configuration to the given value
|
|
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
|
// If called multiple times, the TrialTemplate field is set to the value of the last call.
|
|
func (b *ExperimentSpecApplyConfiguration) WithTrialTemplate(value *TrialTemplateApplyConfiguration) *ExperimentSpecApplyConfiguration {
|
|
b.TrialTemplate = value
|
|
return b
|
|
}
|
|
|
|
// WithParallelTrialCount sets the ParallelTrialCount field in the declarative configuration to the given value
|
|
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
|
// If called multiple times, the ParallelTrialCount field is set to the value of the last call.
|
|
func (b *ExperimentSpecApplyConfiguration) WithParallelTrialCount(value int32) *ExperimentSpecApplyConfiguration {
|
|
b.ParallelTrialCount = &value
|
|
return b
|
|
}
|
|
|
|
// WithMaxTrialCount sets the MaxTrialCount field in the declarative configuration to the given value
|
|
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
|
// If called multiple times, the MaxTrialCount field is set to the value of the last call.
|
|
func (b *ExperimentSpecApplyConfiguration) WithMaxTrialCount(value int32) *ExperimentSpecApplyConfiguration {
|
|
b.MaxTrialCount = &value
|
|
return b
|
|
}
|
|
|
|
// WithMaxFailedTrialCount sets the MaxFailedTrialCount field in the declarative configuration to the given value
|
|
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
|
// If called multiple times, the MaxFailedTrialCount field is set to the value of the last call.
|
|
func (b *ExperimentSpecApplyConfiguration) WithMaxFailedTrialCount(value int32) *ExperimentSpecApplyConfiguration {
|
|
b.MaxFailedTrialCount = &value
|
|
return b
|
|
}
|
|
|
|
// WithMetricsCollectorSpec sets the MetricsCollectorSpec field in the declarative configuration to the given value
|
|
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
|
// If called multiple times, the MetricsCollectorSpec field is set to the value of the last call.
|
|
func (b *ExperimentSpecApplyConfiguration) WithMetricsCollectorSpec(value commonv1beta1.MetricsCollectorSpec) *ExperimentSpecApplyConfiguration {
|
|
b.MetricsCollectorSpec = &value
|
|
return b
|
|
}
|
|
|
|
// WithNasConfig sets the NasConfig field in the declarative configuration to the given value
|
|
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
|
// If called multiple times, the NasConfig field is set to the value of the last call.
|
|
func (b *ExperimentSpecApplyConfiguration) WithNasConfig(value *NasConfigApplyConfiguration) *ExperimentSpecApplyConfiguration {
|
|
b.NasConfig = value
|
|
return b
|
|
}
|
|
|
|
// WithResumePolicy sets the ResumePolicy field in the declarative configuration to the given value
|
|
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
|
// If called multiple times, the ResumePolicy field is set to the value of the last call.
|
|
func (b *ExperimentSpecApplyConfiguration) WithResumePolicy(value experimentsv1beta1.ResumePolicyType) *ExperimentSpecApplyConfiguration {
|
|
b.ResumePolicy = &value
|
|
return b
|
|
}
|