v1alpha3

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 10, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Copyright 2019 The Kubernetes 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.

Package v1alpha3 contains API Schema definitions for the experiment v1alpha3 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=github.com/kubeflow/katib/pkg/apis/controller/experiments/v1alpha3 +k8s:defaulter-gen=TypeMeta +kubebuilder:subresource:status +groupName=experiment.kubeflow.org

Package v1alpha3 contains API Schema definitions for the experiment v1alpha3 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=github.com/kubeflow/katib/pkg/apis/controller/experiments/v1alpha3 +k8s:defaulter-gen=TypeMeta +kubebuilder:subresource:status +groupName=experiments.kubeflow.org

Index

Constants

View Source
const (
	// Default value of Spec.ParallelTrialCount
	DefaultTrialParallelCount = 3

	// Default value of Spec.ConfigMapName for Trial template
	DefaultTrialConfigMapName = "trial-template"

	// Default value of Spec.TemplatePath
	DefaultTrialTemplatePath = "defaultTrialTemplate.yaml"

	// Default value of Spec.DefaultResumePolicy
	DefaultResumePolicy = LongRunning
)
View Source
const (
	Group   = "kubeflow.org"
	Version = "v1alpha3"
)

Variables

View Source
var (
	// SchemeGroupVersion is group version used to register these objects
	SchemeGroupVersion = schema.GroupVersion{Group: Group, Version: Version}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}
	AddToScheme   = SchemeBuilder.AddToScheme
)

Functions

func Resource

func Resource(resource string) schema.GroupResource

Resource is required by pkg/client/listers/...

Types

type Experiment

type Experiment struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   ExperimentSpec   `json:"spec,omitempty"`
	Status ExperimentStatus `json:"status,omitempty"`
}

Structure of the Experiment custom resource. +k8s:openapi-gen=true +kubebuilder:subresource:status

func (*Experiment) DeepCopy

func (in *Experiment) DeepCopy() *Experiment

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Experiment.

func (*Experiment) DeepCopyInto

func (in *Experiment) DeepCopyInto(out *Experiment)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Experiment) DeepCopyObject

func (in *Experiment) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*Experiment) GetLastConditionType

func (exp *Experiment) GetLastConditionType() (ExperimentConditionType, error)

func (*Experiment) HasRunningTrials

func (exp *Experiment) HasRunningTrials() bool

func (*Experiment) IsCompleted

func (exp *Experiment) IsCompleted() bool

func (*Experiment) IsCompletedReason

func (exp *Experiment) IsCompletedReason(reason string) bool

func (*Experiment) IsCreated

func (exp *Experiment) IsCreated() bool

func (*Experiment) IsFailed

func (exp *Experiment) IsFailed() bool

func (*Experiment) IsRestarting

func (exp *Experiment) IsRestarting() bool

func (*Experiment) IsRunning

func (exp *Experiment) IsRunning() bool

func (*Experiment) IsSucceeded

func (exp *Experiment) IsSucceeded() bool

func (*Experiment) MarkExperimentStatusCreated

func (exp *Experiment) MarkExperimentStatusCreated(reason, message string)

func (*Experiment) MarkExperimentStatusFailed

func (exp *Experiment) MarkExperimentStatusFailed(reason, message string)

func (*Experiment) MarkExperimentStatusRestarting

func (exp *Experiment) MarkExperimentStatusRestarting(reason, message string)

func (*Experiment) MarkExperimentStatusRunning

func (exp *Experiment) MarkExperimentStatusRunning(reason, message string)

func (*Experiment) MarkExperimentStatusSucceeded

func (exp *Experiment) MarkExperimentStatusSucceeded(reason, message string)

func (*Experiment) SetDefault

func (e *Experiment) SetDefault()

type ExperimentCondition

type ExperimentCondition struct {
	// Type of experiment condition.
	Type ExperimentConditionType `json:"type"`

	// Status of the condition, one of True, False, Unknown.
	Status v1.ConditionStatus `json:"status"`

	// The reason for the condition's last transition.
	Reason string `json:"reason,omitempty"`

	// A human readable message indicating details about the transition.
	Message string `json:"message,omitempty"`

	// The last time this condition was updated.
	LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty"`

	// Last time the condition transitioned from one status to another.
	LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
}

+k8s:deepcopy-gen=true ExperimentCondition describes the state of the experiment at a certain point.

func (*ExperimentCondition) DeepCopy

func (in *ExperimentCondition) DeepCopy() *ExperimentCondition

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExperimentCondition.

func (*ExperimentCondition) DeepCopyInto

func (in *ExperimentCondition) DeepCopyInto(out *ExperimentCondition)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ExperimentConditionType

type ExperimentConditionType string

ExperimentConditionType defines the state of an Experiment.

const (
	ExperimentCreated    ExperimentConditionType = "Created"
	ExperimentRunning    ExperimentConditionType = "Running"
	ExperimentRestarting ExperimentConditionType = "Restarting"
	ExperimentSucceeded  ExperimentConditionType = "Succeeded"
	ExperimentFailed     ExperimentConditionType = "Failed"
)

type ExperimentList

type ExperimentList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Experiment `json:"items"`
}

ExperimentList contains a list of Experiments

func (*ExperimentList) DeepCopy

func (in *ExperimentList) DeepCopy() *ExperimentList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExperimentList.

func (*ExperimentList) DeepCopyInto

func (in *ExperimentList) DeepCopyInto(out *ExperimentList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ExperimentList) DeepCopyObject

func (in *ExperimentList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ExperimentSpec

type ExperimentSpec struct {
	// List of hyperparameter configurations.
	Parameters []ParameterSpec `json:"parameters,omitempty"`

	// Describes the objective of the experiment.
	Objective *common.ObjectiveSpec `json:"objective,omitempty"`

	// Describes the suggestion algorithm.
	Algorithm *common.AlgorithmSpec `json:"algorithm,omitempty"`

	// Template for each run of the trial.
	TrialTemplate *TrialTemplate `json:"trialTemplate,omitempty"`

	// How many trials can be processed in parallel.
	// Defaults to 3
	ParallelTrialCount *int32 `json:"parallelTrialCount,omitempty"`

	// Max completed trials to mark experiment as succeeded
	MaxTrialCount *int32 `json:"maxTrialCount,omitempty"`

	// Max failed trials to mark experiment as failed.
	MaxFailedTrialCount *int32 `json:"maxFailedTrialCount,omitempty"`

	// For v1alpha3 we will keep the metrics collector implementation same as v1alpha1.
	MetricsCollectorSpec *common.MetricsCollectorSpec `json:"metricsCollectorSpec,omitempty"`

	NasConfig *NasConfig `json:"nasConfig,omitempty"`

	// Describes resuming policy which usually take effect after experiment terminated.
	ResumePolicy ResumePolicyType `json:"resumePolicy,omitempty"`
}

func (*ExperimentSpec) DeepCopy

func (in *ExperimentSpec) DeepCopy() *ExperimentSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExperimentSpec.

func (*ExperimentSpec) DeepCopyInto

func (in *ExperimentSpec) DeepCopyInto(out *ExperimentSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ExperimentStatus

type ExperimentStatus struct {
	// Represents time when the Experiment was acknowledged by the Experiment controller.
	// It is not guaranteed to be set in happens-before order across separate operations.
	// It is represented in RFC3339 form and is in UTC.
	StartTime *metav1.Time `json:"startTime,omitempty"`

	// Represents time when the Experiment was completed. It is not guaranteed to
	// be set in happens-before order across separate operations.
	// It is represented in RFC3339 form and is in UTC.
	CompletionTime *metav1.Time `json:"completionTime,omitempty"`

	// Represents last time when the Experiment was reconciled. It is not guaranteed to
	// be set in happens-before order across separate operations.
	// It is represented in RFC3339 form and is in UTC.
	LastReconcileTime *metav1.Time `json:"lastReconcileTime,omitempty"`

	// List of observed runtime conditions for this Experiment.
	Conditions []ExperimentCondition `json:"conditions,omitempty"`

	// Current optimal trial parameters and observations.
	CurrentOptimalTrial OptimalTrial `json:"currentOptimalTrial,omitempty"`

	// List of trial names which are running.
	RunningTrialList []string `json:"runningTrialList,omitempty"`

	// List of trial names which are pending.
	PendingTrialList []string `json:"pendingTrialList,omitempty"`

	// List of trial names which have already failed.
	FailedTrialList []string `json:"failedTrialList,omitempty"`

	// List of trial names which have already succeeded.
	SucceededTrialList []string `json:"succeededTrialList,omitempty"`

	// List of trial names which have been killed.
	KilledTrialList []string `json:"killedTrialList,omitempty"`

	// Trials is the total number of trials owned by the experiment.
	Trials int32 `json:"trials,omitempty"`

	// How many trials have succeeded.
	TrialsSucceeded int32 `json:"trialsSucceeded,omitempty"`

	// How many trials have failed.
	TrialsFailed int32 `json:"trialsFailed,omitempty"`

	// How many trials have been killed.
	TrialsKilled int32 `json:"trialsKilled,omitempty"`

	// How many trials are currently pending.
	TrialsPending int32 `json:"trialsPending,omitempty"`

	// How many trials are currently running.
	TrialsRunning int32 `json:"trialsRunning,omitempty"`
}

func (*ExperimentStatus) DeepCopy

func (in *ExperimentStatus) DeepCopy() *ExperimentStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExperimentStatus.

func (*ExperimentStatus) DeepCopyInto

func (in *ExperimentStatus) DeepCopyInto(out *ExperimentStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type FeasibleSpace

type FeasibleSpace struct {
	Max  string   `json:"max,omitempty"`
	Min  string   `json:"min,omitempty"`
	List []string `json:"list,omitempty"`
	Step string   `json:"step,omitempty"`
}

func (*FeasibleSpace) DeepCopy

func (in *FeasibleSpace) DeepCopy() *FeasibleSpace

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeasibleSpace.

func (*FeasibleSpace) DeepCopyInto

func (in *FeasibleSpace) DeepCopyInto(out *FeasibleSpace)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type GoTemplate

type GoTemplate struct {
	TemplateSpec *TemplateSpec `json:"templateSpec,omitempty"`
	RawTemplate  string        `json:"rawTemplate,omitempty"`
}

func (*GoTemplate) DeepCopy

func (in *GoTemplate) DeepCopy() *GoTemplate

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GoTemplate.

func (*GoTemplate) DeepCopyInto

func (in *GoTemplate) DeepCopyInto(out *GoTemplate)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type GraphConfig

type GraphConfig struct {
	NumLayers   *int32  `json:"numLayers,omitempty"`
	InputSizes  []int32 `json:"inputSizes,omitempty"`
	OutputSizes []int32 `json:"outputSizes,omitempty"`
}

GraphConfig contains a config of DAG

func (*GraphConfig) DeepCopy

func (in *GraphConfig) DeepCopy() *GraphConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GraphConfig.

func (*GraphConfig) DeepCopyInto

func (in *GraphConfig) DeepCopyInto(out *GraphConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type NasConfig

type NasConfig struct {
	GraphConfig GraphConfig `json:"graphConfig,omitempty"`
	Operations  []Operation `json:"operations,omitempty"`
}

NasConfig contains config for NAS job

func (*NasConfig) DeepCopy

func (in *NasConfig) DeepCopy() *NasConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NasConfig.

func (*NasConfig) DeepCopyInto

func (in *NasConfig) DeepCopyInto(out *NasConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Operation

type Operation struct {
	OperationType string          `json:"operationType,omitempty"`
	Parameters    []ParameterSpec `json:"parameters,omitempty"`
}

Operation contains type of operation in DAG

func (*Operation) DeepCopy

func (in *Operation) DeepCopy() *Operation

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Operation.

func (*Operation) DeepCopyInto

func (in *Operation) DeepCopyInto(out *Operation)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type OptimalTrial

type OptimalTrial struct {
	// BestTrialName is the name of the best trial.
	BestTrialName string `json:"bestTrialName"`
	// Key-value pairs for hyperparameters and assignment values.
	ParameterAssignments []common.ParameterAssignment `json:"parameterAssignments"`

	// Observation for this trial
	Observation common.Observation `json:"observation,omitempty"`
}

OptimalTrial is the metrics and assignments of the best trial.

func (*OptimalTrial) DeepCopy

func (in *OptimalTrial) DeepCopy() *OptimalTrial

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OptimalTrial.

func (*OptimalTrial) DeepCopyInto

func (in *OptimalTrial) DeepCopyInto(out *OptimalTrial)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ParameterSpec

type ParameterSpec struct {
	Name          string        `json:"name,omitempty"`
	ParameterType ParameterType `json:"parameterType,omitempty"`
	FeasibleSpace FeasibleSpace `json:"feasibleSpace,omitempty"`
}

func (*ParameterSpec) DeepCopy

func (in *ParameterSpec) DeepCopy() *ParameterSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ParameterSpec.

func (*ParameterSpec) DeepCopyInto

func (in *ParameterSpec) DeepCopyInto(out *ParameterSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ParameterType

type ParameterType string
const (
	ParameterTypeUnknown     ParameterType = "unknown"
	ParameterTypeDouble      ParameterType = "double"
	ParameterTypeInt         ParameterType = "int"
	ParameterTypeDiscrete    ParameterType = "discrete"
	ParameterTypeCategorical ParameterType = "categorical"
)

type ResumePolicyType

type ResumePolicyType string
const (
	NeverResume ResumePolicyType = "Never"
	LongRunning ResumePolicyType = "LongRunning"
)

type TemplateSpec

type TemplateSpec struct {
	ConfigMapName      string `json:"configMapName,omitempty"`
	ConfigMapNamespace string `json:"configMapNamespace,omitempty"`
	TemplatePath       string `json:"templatePath,omitempty"`
}

func (*TemplateSpec) DeepCopy

func (in *TemplateSpec) DeepCopy() *TemplateSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TemplateSpec.

func (*TemplateSpec) DeepCopyInto

func (in *TemplateSpec) DeepCopyInto(out *TemplateSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TrialTemplate

type TrialTemplate struct {
	Retain     bool        `json:"retain,omitempty"`
	GoTemplate *GoTemplate `json:"goTemplate,omitempty"`
}

func (*TrialTemplate) DeepCopy

func (in *TrialTemplate) DeepCopy() *TrialTemplate

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TrialTemplate.

func (*TrialTemplate) DeepCopyInto

func (in *TrialTemplate) DeepCopyInto(out *TrialTemplate)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL