v1

package
v0.0.0-...-d39b95d Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package v1 contains API Schema definitions for the core v1 API group +kubebuilder:object:generate=true +groupName=core.polyaxon.com

Index

Constants

View Source
const OperationLogsFinalizer = "operation.logs.finalizers.polyaxon.com"

OperationLogsFinalizer registration

View Source
const OperationNotificationsFinalizer = "operation.notifications.finalizers.polyaxon.com"

OperationNotificationsFinalizer registration

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "core.polyaxon.com", Version: "v1"}

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

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

func GetFailureMessage

func GetFailureMessage(entityMessage string, status OperationConditionType, reason string, message string) string

func GetMessage

func GetMessage(condition OperationConditionType, entityMessage string, status OperationConditionType, reason string, message string) string

func GetStoppedMessage

func GetStoppedMessage(entityMessage string, status OperationConditionType, reason string, message string) string

Types

type BatchJobSpec

type BatchJobSpec struct {
	// Template describes the pods that will be created.
	Template corev1.PodTemplateSpec `json:"template" protobuf:"bytes,1,opt,name=template"`
}

BatchJobSpec defines the desired state of a batch job +k8s:openapi-gen=true

func (*BatchJobSpec) DeepCopy

func (in *BatchJobSpec) DeepCopy() *BatchJobSpec

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

func (*BatchJobSpec) DeepCopyInto

func (in *BatchJobSpec) DeepCopyInto(out *BatchJobSpec)

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

type CleanPodPolicy

type CleanPodPolicy string

CleanPodPolicy describes how to deal with pods when the job is finished. +k8s:openapi-gen=true

const (
	CleanPodPolicyUndefined CleanPodPolicy = ""
	CleanPodPolicyAll       CleanPodPolicy = "All"
	CleanPodPolicyRunning   CleanPodPolicy = "Running"
	CleanPodPolicyNone      CleanPodPolicy = "None"
)

Possible values for CleanPodPolicy

type DaskJobSpec

type DaskJobSpec struct {
	// A map of ReplicaType (type) to ReplicaSpec (value). Specifies the Dask cluster configuration.
	// For example,
	//   {
	//     "Job": DaskReplicaSpec,
	//     "Worker": DaskReplicaSpec,
	//     "Scheduler": DaskReplicaSpec,
	//   }
	ReplicaSpecs map[DaskReplicaType]DaskReplicaSpec `json:"replicaSpecs" protobuf:"bytes,4,opt,name=replicaSpecs"`

	Service corev1.ServiceSpec `json:"service" protobuf:"bytes,5,opt,name=service"`
}

DaskJobSpec defines the desired state of a Dask job +k8s:openapi-gen=true

func (*DaskJobSpec) DeepCopy

func (in *DaskJobSpec) DeepCopy() *DaskJobSpec

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

func (*DaskJobSpec) DeepCopyInto

func (in *DaskJobSpec) DeepCopyInto(out *DaskJobSpec)

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

type DaskReplicaSpec

type DaskReplicaSpec struct {
	// Replicas is the desired number of replicas of the given template.
	// If unspecified, defaults to 1.
	Replicas int `json:"replicas,omitempty"`
	// Template is the object that describes the pod that
	// will be created for this replica. RestartPolicy in PodTemplateSpec
	// will be overide by RestartPolicy in ReplicaSpec
	Template corev1.PodTemplateSpec `json:"template,omitempty"`
	// Restart policy for all replicas within the job.
	// One of Always, OnFailure, Never and ExitCode.
	// Default to Never.
	RestartPolicy corev1.RestartPolicy `json:"restartPolicy,omitempty"`
}

DaskReplicaSpec is a description of dask replica +k8s:openapi-gen=true

func (*DaskReplicaSpec) DeepCopy

func (in *DaskReplicaSpec) DeepCopy() *DaskReplicaSpec

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

func (*DaskReplicaSpec) DeepCopyInto

func (in *DaskReplicaSpec) DeepCopyInto(out *DaskReplicaSpec)

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

type DaskReplicaType

type DaskReplicaType string

DaskReplicaType is the type for DaskReplica. Can be one of "Job" or "Worker" or "Scheduler".

const (
	// DaskReplicaTypeJob is the type of Master of distributed Dask
	DaskReplicaTypeJob DaskReplicaType = "Job"

	// DaskReplicaTypeWorker is the type for workers of distributed Dask.
	DaskReplicaTypeWorker DaskReplicaType = "Worker"

	// DaskReplicaTypeScheduler is the type for workers of distributed Dask.
	DaskReplicaTypeScheduler DaskReplicaType = "Scheduler"
)

type KFReplicaSpec

type KFReplicaSpec struct {
	// Replicas is the desired number of replicas of the given template.
	// If unspecified, defaults to 1.
	Replicas *int32 `json:"replicas,omitempty" protobuf:"bytes,1,opt,name=replicas"`

	// Template is the object that describes the pod that
	// will be created for this replica. RestartPolicy in PodTemplateSpec
	// will be overide by RestartPolicy in ReplicaSpec
	Template corev1.PodTemplateSpec `json:"template" protobuf:"bytes,2,opt,name=template"`

	// Restart policy for all replicas within the job.
	// One of Always, OnFailure, Never and ExitCode.
	// Default to Never.
	RestartPolicy corev1.RestartPolicy `json:"restartPolicy,omitempty" protobuf:"bytes,3,opt,name=restartPolicy"`
}

KFReplicaSpec is a description of kubeflow replica +k8s:openapi-gen=true

func (*KFReplicaSpec) DeepCopy

func (in *KFReplicaSpec) DeepCopy() *KFReplicaSpec

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

func (*KFReplicaSpec) DeepCopyInto

func (in *KFReplicaSpec) DeepCopyInto(out *KFReplicaSpec)

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

type MPIJobSpec

type MPIJobSpec struct {

	// Defines the policy for cleaning up pods after the Job completes.
	// Defaults to Running.
	CleanPodPolicy *CleanPodPolicy `json:"cleanPodPolicy,omitempty" protobuf:"bytes,1,opt,name=cleanPodPolicy"`

	// SchedulingPolicy defines the policy related to scheduling, e.g. gang-scheduling
	// +optional
	SchedulingPolicy *SchedulingPolicy `json:"schedulingPolicy,omitempty"  protobuf:"bytes,2,opt,name=schedulingPolicy"`

	// CleanPodPolicy defines the policy that whether to kill pods after the job completes.
	// Defaults to None.
	SlotsPerWorker *int32 `json:"slotsPerWorker,omitempty" protobuf:"bytes,3,opt,name=slotsPerWorker"`

	// `MPIReplicaSpecs` contains maps from `MPIReplicaType` to `ReplicaSpec` that
	// specify the MPI replicas to run.
	ReplicaSpecs map[MPIReplicaType]*KFReplicaSpec `json:"replicaSpecs" protobuf:"bytes,6,opt,name=replicaSpecs"`
}

MPIJobSpec defines the desired state of an mpi job +k8s:openapi-gen=true

func (*MPIJobSpec) DeepCopy

func (in *MPIJobSpec) DeepCopy() *MPIJobSpec

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

func (*MPIJobSpec) DeepCopyInto

func (in *MPIJobSpec) DeepCopyInto(out *MPIJobSpec)

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

type MPIReplicaType

type MPIReplicaType string

MPIReplicaType is the type for MPIReplica.

const (
	// MPIReplicaTypeLauncher is the type for launcher replica.
	MPIReplicaTypeLauncher MPIReplicaType = "Launcher"

	// MPIReplicaTypeWorker is the type for worker replicas.
	MPIReplicaTypeWorker MPIReplicaType = "Worker"
)

type MXJobModeType

type MXJobModeType string

MXJobModeType id the type for JobMode

const (
	// Train Mode, in this mode requested MXReplicaSpecs need
	// has Server, Scheduler, Worker
	MXTrain MXJobModeType = "MXTrain"

	// Tune Mode, in this mode requested MXReplicaSpecs need
	// has Tuner
	MXTune MXJobModeType = "MXTune"
)

type MXJobSpec

type MXJobSpec struct {
	// Defines the policy for cleaning up pods after the Job completes.
	// Defaults to Running.
	CleanPodPolicy *CleanPodPolicy `json:"cleanPodPolicy,omitempty" protobuf:"bytes,1,opt,name=cleanPodPolicy"`

	// SchedulingPolicy defines the policy related to scheduling, e.g. gang-scheduling
	// +optional
	SchedulingPolicy *SchedulingPolicy `json:"schedulingPolicy,omitempty"  protobuf:"bytes,2,opt,name=schedulingPolicy"`

	// JobMode specify the kind of MXjob to do. Different mode may have
	// different MXReplicaSpecs request
	// optional
	JobMode MXJobModeType `json:"JobMode,omitempty"  protobuf:"bytes,3,opt,name=jobMode"`

	// A map of ReplicaType (type) to ReplicaSpec (value). Specifies the MXJob cluster configuration.
	// For example,
	//   {
	//     "Master": ReplicaSpec,
	//     "Worker": ReplicaSpec,
	//   }
	ReplicaSpecs map[MXReplicaType]*KFReplicaSpec `json:"replicaSpecs" protobuf:"bytes,4,opt,name=replicaSpecs"`
}

MXJobSpec defines the desired state of a mxnet job +k8s:openapi-gen=true

func (*MXJobSpec) DeepCopy

func (in *MXJobSpec) DeepCopy() *MXJobSpec

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

func (*MXJobSpec) DeepCopyInto

func (in *MXJobSpec) DeepCopyInto(out *MXJobSpec)

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

type MXReplicaType

type MXReplicaType string

MXReplicaType is the type for MXReplica. Can be one of "Master" or "Worker".

const (
	// MXReplicaTypeScheduler is the type of Master of distributed MXJjob
	MXReplicaTypeScheduler MXReplicaType = "Scheduler"

	// MXReplicaTypeServer is the type for workers of distributed MXJjob.
	MXReplicaTypeServer MXReplicaType = "Server"

	// MXReplicaTypeWorker is the type for workers of distributed MXJjob.
	MXReplicaTypeWorker MXReplicaType = "Worker"

	// MXReplicaTypeTunerTracker is the type for workers of distributed MXJjob.
	MXReplicaTypeTunerTracker MXReplicaType = "TunerTracker"

	// MXReplicaTypeTunerServer is the type for workers of distributed MXJjob.
	MXReplicaTypeTunerServer MXReplicaType = "TunerServer"

	// MXReplicaTypeTuner is the type for workers of distributed MXJjob.
	MXReplicaTypeTuner MXReplicaType = "Tuner"
)

type NotificationSpec

type NotificationSpec struct {
	Connections []string                         `json:"connections" protobuf:"bytes,1,opt,name=connections"`
	Trigger     OperationTriggerNotificationType `json:"trigger" protobuf:"bytes,2,opt,name=trigger"`
}

NotificationSpec is definition of how to send notification for new status of this operation +k8s:openapi-gen=true

func (*NotificationSpec) DeepCopy

func (in *NotificationSpec) DeepCopy() *NotificationSpec

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

func (*NotificationSpec) DeepCopyInto

func (in *NotificationSpec) DeepCopyInto(out *NotificationSpec)

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

type Operation

type Operation struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`

	// Specifies the number of retries before marking this job failed.
	// +optional
	Termination TerminationSpec `json:"termination,omitempty" protobuf:"bytes,2,opt,name=termination"`

	// Flag to set a finalizer for collecting logs
	// +optional
	CollectLogs bool `json:"collectLogs" protobuf:"bytes,3,opt,name=collectLogs"`

	// Flag to set tell if Polyaxon should sync statuses with control plane
	// +optional
	SyncStatuses bool `json:"syncStatuses" protobuf:"bytes,4,opt,name=syncStatuses"`

	// List of notigications for this operation
	// +optional
	Notifications []NotificationSpec `json:"notifications,omitempty" protobuf:"bytes,5,opt,name=notifications"`

	// Specification of the desired behavior of a job.
	// +optional
	BatchJobSpec *BatchJobSpec `json:"batchJobSpec,omitempty" protobuf:"bytes,6,opt,name=batchJobSpec"`

	// Specification of the desired behavior of a Service.
	ServiceSpec *ServiceSpec `json:"serviceSpec,omitempty" protobuf:"bytes,7,opt,name=serviceSpec"`

	// Specification of the desired behavior of a TFJob.
	TFJobSpec *TFJobSpec `json:"tfJobSpec,omitempty" protobuf:"bytes,8,opt,name=tfJobSpec"`

	// Specification of the desired behavior of a PytorchJob.
	PytorchJobSpec *PytorchJobSpec `json:"pytorchJobSpec,omitempty" protobuf:"bytes,9,opt,name=pytorchJobSpec"`

	// Specification of the desired behavior of a PaddleJob.
	PaddleJobSpec *PaddleJobSpec `json:"paddleJobSpec,omitempty" protobuf:"bytes,10,opt,name=paddleJobSpec"`

	// Specification of the desired behavior of a MXJob.
	MXJobSpec *MXJobSpec `json:"mxJobSpec,omitempty" protobuf:"bytes,11,opt,name=mxJobSpec"`

	// Specification of the desired behavior of a XGBoostJob.
	XGBoostJobSpec *XGBoostJobSpec `json:"xgboostJobSpec,omitempty" protobuf:"bytes,12,opt,name=xgboostJobSpec"`

	// Specification of the desired behavior of a MPIJob.
	MPIJobSpec *MPIJobSpec `json:"mpiJobSpec,omitempty" protobuf:"bytes,13,opt,name=mpiJobSpec"`

	// Specification of the desired behavior of a DaskJob.
	DaskJobSpec *DaskJobSpec `json:"daskJobSpec,omitempty" protobuf:"bytes,14,opt,name=daskJobSpec"`

	// Specification of the desired behavior of a RayJob.
	RayJobSpec *RayJobSpec `json:"rayJobSpec,omitempty" protobuf:"bytes,15,opt,name=rayJobSpec"`

	// Current status of an op.
	// +optional
	Status OperationStatus `json:"status,omitempty" protobuf:"bytes,11,opt,name=status"`
}

Operation is the Schema for the operations API +k8s:openapi-gen=true +kubebuilder:resource:shortName=op +kubebuilder:subresource:status

func (*Operation) AddLogsFinalizer

func (instance *Operation) AddLogsFinalizer()

AddLogsFinalizer handler for Operation

func (*Operation) AddNotificationsFinalizer

func (instance *Operation) AddNotificationsFinalizer()

AddNotificationsFinalizer handler for Operation

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.

func (*Operation) DeepCopyObject

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

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

func (*Operation) HasLogsFinalizer

func (instance *Operation) HasLogsFinalizer() bool

HasLogsFinalizer check for Operation

func (*Operation) HasNotificationsFinalizer

func (instance *Operation) HasNotificationsFinalizer() bool

HasNotificationsFinalizer check for Operation

func (*Operation) HasWarning

func (instance *Operation) HasWarning() bool

HasWarning checks if the Operation succeeded

func (*Operation) IsBeingDeleted

func (instance *Operation) IsBeingDeleted() bool

IsBeingDeleted checks if the job is being deleted

func (*Operation) IsDone

func (instance *Operation) IsDone() bool

IsDone checks if it the Operation reached a final condition

func (*Operation) IsFailed

func (instance *Operation) IsFailed() bool

IsFailed checks if the Operation failed

func (*Operation) IsRunning

func (instance *Operation) IsRunning() bool

IsRunning checks if the Operation is running

func (*Operation) IsStarting

func (instance *Operation) IsStarting() bool

IsStarting checks if the Operation is statrting

func (*Operation) IsStopped

func (instance *Operation) IsStopped() bool

IsStopped checks if the Operation stopped

func (*Operation) IsSucceeded

func (instance *Operation) IsSucceeded() bool

IsSucceeded checks if the Operation succeeded

func (*Operation) LogFailed

func (instance *Operation) LogFailed(reason, message string) bool

LogFailed sets Operation to failed

func (*Operation) LogRunning

func (instance *Operation) LogRunning() bool

LogRunning sets Operation to running

func (*Operation) LogStarting

func (instance *Operation) LogStarting() bool

LogStarting sets Operation to statrting

func (*Operation) LogStopped

func (instance *Operation) LogStopped(reason, message string) bool

LogStopped sets Operation to stopped

func (*Operation) LogSucceeded

func (instance *Operation) LogSucceeded() bool

LogSucceeded sets Operation to succeeded

func (*Operation) LogWarning

func (instance *Operation) LogWarning(reason, message string) bool

LogWarning sets Operation to succeeded

func (*Operation) RemoveLogsFinalizer

func (instance *Operation) RemoveLogsFinalizer()

RemoveLogsFinalizer handler for Operation

func (*Operation) RemoveNotificationsFinalizer

func (instance *Operation) RemoveNotificationsFinalizer()

RemoveNotificationsFinalizer handler for Operation

type OperationCondition

type OperationCondition struct {
	// Type is the type of the condition.
	Type OperationConditionType `json:"type" protobuf:"bytes,1,opt,name=type"`

	// Status of the condition, one of True, False, Unknown.
	Status corev1.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status"`

	// The last time this condition was updated.
	// +optional
	LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty" protobuf:"bytes,3,opt,name=lastUpdateTime"`

	// Last time the condition transitioned.
	// +optional
	LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,4,opt,name=lastTransitionTime"`

	// The reason for this container condition.
	// +optional
	Reason string `json:"reason,omitempty" protobuf:"bytes,5,opt,name=reason"`

	// A human readable message indicating details about the transition.
	// +optional
	Message string `json:"message,omitempty" protobuf:"bytes,6,opt,name=message"`
}

OperationCondition defines the conditions of Operation or OpService +k8s:openapi-gen=true

func NewOperationCondition

func NewOperationCondition(conditionType OperationConditionType, status corev1.ConditionStatus, reason, message string) OperationCondition

NewOperationCondition makes a new instance of OperationCondition

func (*OperationCondition) DeepCopy

func (in *OperationCondition) DeepCopy() *OperationCondition

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

func (*OperationCondition) DeepCopyInto

func (in *OperationCondition) DeepCopyInto(out *OperationCondition)

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

type OperationConditionType

type OperationConditionType string

OperationConditionType maps the conditions of a job or service once deployed +k8s:openapi-gen=true

const (
	// OperationStarting means underlaying Operation has started.
	OperationStarting OperationConditionType = "Starting"
	// OperationRunning means underlaying Operation is running,
	OperationRunning OperationConditionType = "Running"
	// OperationWarning means underlaying Operation has some issues.
	OperationWarning OperationConditionType = "Warning"
	// OperationSucceeded means underlaying Operation has completed successfully.
	OperationSucceeded OperationConditionType = "Succeeded"
	// OperationFailed means underlaying Operation has failed.
	OperationFailed OperationConditionType = "Failed"
	// OperationStopped means that the Operation was stopped/killed.
	OperationStopped OperationConditionType = "Stopped"
)

type OperationList

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

OperationList contains a list of Operation

func (*OperationList) DeepCopy

func (in *OperationList) DeepCopy() *OperationList

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

func (*OperationList) DeepCopyInto

func (in *OperationList) DeepCopyInto(out *OperationList)

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

func (*OperationList) DeepCopyObject

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

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

type OperationStatus

type OperationStatus struct {
	// The latest available observations of an object's current state.
	// +optional
	// +patchMergeKey=type
	// +patchStrategy=merge
	Conditions []OperationCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`

	// Represents the time when the job was acknowledged by the 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" protobuf:"bytes,2,opt,name=startTime"`

	// Represents the time when the job 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" protobuf:"bytes,3,opt,name=completionTime"`

	// Represents the last time when the job 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" protobuf:"bytes,4,opt,name=lastReconcileTime"`
}

OperationStatus defines the observed state of a job or a service +k8s:openapi-gen=true

func (*OperationStatus) DeepCopy

func (in *OperationStatus) DeepCopy() *OperationStatus

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

func (*OperationStatus) DeepCopyInto

func (in *OperationStatus) DeepCopyInto(out *OperationStatus)

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

type OperationTriggerNotificationType

type OperationTriggerNotificationType string

OperationTriggerNotificationType maps the notifiable conditions +k8s:openapi-gen=true

const (
	// OperationSucceededTrigger means underlaying Operation has completed successfully.
	OperationSucceededTrigger OperationTriggerNotificationType = "Succeeded"
	// OperationFailedTrigger means underlaying Operation has failed.
	OperationFailedTrigger OperationTriggerNotificationType = "Failed"
	// OperationStoppedTrigger means that the Operation was stopped/killed.
	OperationStoppedTrigger OperationTriggerNotificationType = "Stopped"
	// OperationDoneTrigger means that the Operation was stopped/killed.
	OperationDoneTrigger OperationTriggerNotificationType = "Done"
)

type PaddleElasticPolicy

type PaddleElasticPolicy struct {
	// minReplicas is the lower limit for the number of replicas to which the training job
	// can scale down.  It defaults to null.
	// +optional
	MinReplicas *int32 `json:"minReplicas,omitempty"`
	// upper limit for the number of pods that can be set by the autoscaler; cannot be smaller than MinReplicas, defaults to null.
	// +optional
	MaxReplicas *int32 `json:"maxReplicas,omitempty"`

	// MaxRestarts is the limit for restart times of pods in elastic mode.
	// +optional
	MaxRestarts *int32 `json:"maxRestarts,omitempty"`

	// Metrics contains the specifications which are used to calculate the
	// desired replica count (the maximum replica count across all metrics will
	// be used).  The desired replica count is calculated with multiplying the
	// ratio between the target value and the current value by the current
	// number of pods. Ergo, metrics used must decrease as the pod count is
	// increased, and vice-versa.  See the individual metric source types for
	// more information about how each type of metric must respond.
	// If not set, the HPA will not be created.
	// +optional
	Metrics []autoscalingv2.MetricSpec `json:"metrics,omitempty"`
}

func (*PaddleElasticPolicy) DeepCopy

func (in *PaddleElasticPolicy) DeepCopy() *PaddleElasticPolicy

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

func (*PaddleElasticPolicy) DeepCopyInto

func (in *PaddleElasticPolicy) DeepCopyInto(out *PaddleElasticPolicy)

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

type PaddleJobSpec

type PaddleJobSpec struct {
	// Defines the policy for cleaning up pods after the Job completes.
	// Defaults to Running.
	CleanPodPolicy *CleanPodPolicy `json:"cleanPodPolicy,omitempty" protobuf:"bytes,1,opt,name=cleanPodPolicy"`

	// SchedulingPolicy defines the policy related to scheduling, e.g. gang-scheduling
	// +optional
	SchedulingPolicy *SchedulingPolicy `json:"schedulingPolicy,omitempty"  protobuf:"bytes,2,opt,name=schedulingPolicy"`

	// ElasticPolicy holds the elastic policy for paddle job.
	ElasticPolicy *PaddleElasticPolicy `json:"elasticPolicy,omitempty"  protobuf:"bytes,3,opt,name=elasticPolicy"`

	// A map of ReplicaType (type) to ReplicaSpec (value). Specifies the Paddle cluster configuration.
	// For example,
	//   {
	//     "Master": ReplicaSpec,
	//     "Worker": ReplicaSpec,
	//   }
	ReplicaSpecs map[PaddleReplicaType]*KFReplicaSpec `json:"replicaSpecs" protobuf:"bytes,4,opt,name=replicaSpecs"`
}

PaddleJobSpec defines the desired state of a paddle job +k8s:openapi-gen=true

func (*PaddleJobSpec) DeepCopy

func (in *PaddleJobSpec) DeepCopy() *PaddleJobSpec

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

func (*PaddleJobSpec) DeepCopyInto

func (in *PaddleJobSpec) DeepCopyInto(out *PaddleJobSpec)

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

type PaddleReplicaType

type PaddleReplicaType string

TFReplicaType is the type for TFReplica. Can be one of: "Chief"/"Master" (semantically equivalent), "Worker", "PS", or "Evaluator".

const (
	// PaddleoostReplicaTypeMaster is the type of Master of distributed PaddleoostJjob
	PaddleoostReplicaTypeMaster PaddleReplicaType = "Master"

	// PaddleoostReplicaTypeWorker is the type for workers of distributed PaddleoostJjob.
	PaddleoostReplicaTypeWorker PaddleReplicaType = "Worker"
)

type PyTorchReplicaType

type PyTorchReplicaType string

PyTorchReplicaType is the type for PyTorchReplica. Can be one of "Master" or "Worker".

const (
	// PyTorchReplicaTypeMaster is the type of Master of distributed PyTorch
	PyTorchReplicaTypeMaster PyTorchReplicaType = "Master"

	// PyTorchReplicaTypeWorker is the type for workers of distributed PyTorch.
	PyTorchReplicaTypeWorker PyTorchReplicaType = "Worker"
)

type PytorchElasticPolicy

type PytorchElasticPolicy struct {
	// minReplicas is the lower limit for the number of replicas to which the training job
	// can scale down.  It defaults to null.
	// +optional
	MinReplicas *int32 `json:"minReplicas,omitempty"`
	// upper limit for the number of pods that can be set by the autoscaler; cannot be smaller than MinReplicas, defaults to null.
	// +optional
	MaxReplicas *int32 `json:"maxReplicas,omitempty"`

	RDZVBackend *RDZVBackend `json:"rdzvBackend,omitempty"`
	RDZVPort    *int32       `json:"rdzvPort,omitempty"`
	RDZVHost    *string      `json:"rdzvHost,omitempty"`
	RDZVID      *string      `json:"rdzvId,omitempty"`
	// RDZVConf contains additional rendezvous configuration (<key1>=<value1>,<key2>=<value2>,...).
	RDZVConf []RDZVConf `json:"rdzvConf,omitempty"`
	// Start a local standalone rendezvous backend that is represented by a C10d TCP store
	// on port 29400. Useful when launching single-node, multi-worker job. If specified
	// --rdzv_backend, --rdzv_endpoint, --rdzv_id are auto-assigned; any explicitly set values
	// are ignored.
	Standalone *bool `json:"standalone,omitempty"`
	// Number of workers per node; supported values: [auto, cpu, gpu, int].
	// Deprecated: This API is deprecated in v1.7+
	// Use .spec.nprocPerNode instead.
	NProcPerNode *int32 `json:"nProcPerNode,omitempty"`

	MaxRestarts *int32 `json:"maxRestarts,omitempty"`

	// Metrics contains the specifications which are used to calculate the
	// desired replica count (the maximum replica count across all metrics will
	// be used).  The desired replica count is calculated with multiplying the
	// ratio between the target value and the current value by the current
	// number of pods. Ergo, metrics used must decrease as the pod count is
	// increased, and vice-versa.  See the individual metric source types for
	// more information about how each type of metric must respond.
	// If not set, the HPA will not be created.
	// +optional
	Metrics []autoscalingv2.MetricSpec `json:"metrics,omitempty"`
}

func (*PytorchElasticPolicy) DeepCopy

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

func (*PytorchElasticPolicy) DeepCopyInto

func (in *PytorchElasticPolicy) DeepCopyInto(out *PytorchElasticPolicy)

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

type PytorchJobSpec

type PytorchJobSpec struct {
	// Defines the policy for cleaning up pods after the Job completes.
	// Defaults to Running.
	CleanPodPolicy *CleanPodPolicy `json:"cleanPodPolicy,omitempty" protobuf:"bytes,1,opt,name=cleanPodPolicy"`

	// SchedulingPolicy defines the policy related to scheduling, e.g. gang-scheduling
	// +optional
	SchedulingPolicy *SchedulingPolicy `json:"schedulingPolicy,omitempty"  protobuf:"bytes,2,opt,name=schedulingPolicy"`

	// ElasticPolicy defines the policy related to elastic scaling
	ElasticPolicy *PytorchElasticPolicy `json:"elasticPolicy,omitempty"  protobuf:"bytes,3,opt,name=elasticPolicy"`

	// A map of ReplicaType (type) to ReplicaSpec (value). Specifies the PyTorch cluster configuration.
	// For example,
	//   {
	//     "Master": PyTorchReplicaSpec,
	//     "Worker": PyTorchReplicaSpec,
	//   }
	ReplicaSpecs map[PyTorchReplicaType]*KFReplicaSpec `json:"replicaSpecs" protobuf:"bytes,4,opt,name=replicaSpecs"`

	// Number of workers per node; supported values: [auto, cpu, gpu, int].
	// For more, https://github.com/pytorch/pytorch/blob/26f7f470df64d90e092081e39507e4ac751f55d6/torch/distributed/run.py#L629-L658.
	// Defaults to auto.
	NprocPerNode *string `json:"nprocPerNode,omitempty" protobuf:"bytes,5,opt,name=replicaSpecs"`
}

PytorchJobSpec defines the desired state of a pytorch job +k8s:openapi-gen=true

func (*PytorchJobSpec) DeepCopy

func (in *PytorchJobSpec) DeepCopy() *PytorchJobSpec

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

func (*PytorchJobSpec) DeepCopyInto

func (in *PytorchJobSpec) DeepCopyInto(out *PytorchJobSpec)

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

type RDZVBackend

type RDZVBackend string
const (
	// BackendC10D is the rendezvous backend type for C10d.
	BackendC10D RDZVBackend = "c10d"
	// BackendETCD is the rendezvous backend type for ETCD.
	BackendETCD RDZVBackend = "etcd"
	// BackendETCDV2 is the rendezvous backend type for ETCD v2.
	BackendETCDV2 RDZVBackend = "etcd-v2"
)

type RDZVConf

type RDZVConf struct {
	Key   string `json:"key,omitempty"`
	Value string `json:"value,omitempty"`
}

func (*RDZVConf) DeepCopy

func (in *RDZVConf) DeepCopy() *RDZVConf

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

func (*RDZVConf) DeepCopyInto

func (in *RDZVConf) DeepCopyInto(out *RDZVConf)

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

type RayJobSpec

type RayJobSpec struct {
	// Important: Run "make" to regenerate code after modifying this file
	Entrypoint string `json:"entrypoint,omitempty"`
	// Metadata is data to store along with this job.
	Metadata map[string]string `json:"metadata,omitempty"`
	// RuntimeEnv yaml representing the runtime environment
	RuntimeEnv string `json:"runtimeEnv,omitempty"`
	// RayVersion is the version of ray being used. This determines the autoscaler's image version.
	RayVersion string `json:"rayVersion,omitempty"`
	// Head replica spec
	Head RayReplicaSpec `json:"head" protobuf:"bytes,3,opt,name=head"`
	// Worker replicas spec
	Workers []RayReplicaSpec `json:"workers" protobuf:"bytes,3,opt,name=workers"`
}

RayJobSpec defines the desired state of a Ray job +k8s:openapi-gen=true

func (*RayJobSpec) DeepCopy

func (in *RayJobSpec) DeepCopy() *RayJobSpec

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

func (*RayJobSpec) DeepCopyInto

func (in *RayJobSpec) DeepCopyInto(out *RayJobSpec)

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

type RayReplicaSpec

type RayReplicaSpec struct {
	// we can have multiple worker groups, we distinguish them by name
	GroupName string `json:"groupName,omitempty"`
	// Replicas is the desired number of replicas of the given template.
	// If unspecified, defaults to 1.
	Replicas *int32 `json:"replicas,omitempty"`
	// MinReplicas defaults to 1
	MinReplicas *int32 `json:"minReplicas,omitempty"`
	// MaxReplicas defaults to maxInt32
	MaxReplicas *int32 `json:"maxReplicas,omitempty"`
	// RayStartParams are the params of the start command: address, object-store-memory, ...
	RayStartParams map[string]string `json:"rayStartParams,omitempty"`
	// Template is the object that describes the pod that
	// will be created for this replica. RestartPolicy in PodTemplateSpec
	// will be overide by RestartPolicy in ReplicaSpec
	Template corev1.PodTemplateSpec `json:"template,omitempty"`
	// Restart policy for all replicas within the job.
	// One of Always, OnFailure, Never and ExitCode.
	// Default to Never.
	RestartPolicy corev1.RestartPolicy `json:"restartPolicy,omitempty"`
}

RayReplicaSpec is a description of ray replica +k8s:openapi-gen=true

func (*RayReplicaSpec) DeepCopy

func (in *RayReplicaSpec) DeepCopy() *RayReplicaSpec

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

func (*RayReplicaSpec) DeepCopyInto

func (in *RayReplicaSpec) DeepCopyInto(out *RayReplicaSpec)

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

type SchedulingPolicy

type SchedulingPolicy struct {
	MinAvailable           *int32                                     `json:"minAvailable,omitempty"`
	Queue                  string                                     `json:"queue,omitempty"`
	MinResources           *map[corev1.ResourceName]resource.Quantity `json:"minResources,omitempty"`
	PriorityClass          string                                     `json:"priorityClass,omitempty"`
	ScheduleTimeoutSeconds *int32                                     `json:"scheduleTimeoutSeconds,omitempty"`
}

SchedulingPolicy encapsulates various scheduling policies of the distributed training job, for example `minAvailable` for gang-scheduling. +k8s:openapi-gen=true

func (*SchedulingPolicy) DeepCopy

func (in *SchedulingPolicy) DeepCopy() *SchedulingPolicy

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

func (*SchedulingPolicy) DeepCopyInto

func (in *SchedulingPolicy) DeepCopyInto(out *SchedulingPolicy)

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

type ServiceSpec

type ServiceSpec struct {
	// Replicas is the number of desired replicas.
	// This is a pointer to distinguish between explicit zero and unspecified.
	// Defaults to 1.
	// +optional
	Replicas *int32 `json:"replicas,omitempty" default:"1" protobuf:"varint,1,opt,name=replicas"`

	// List of ports to expose on the service
	// +optional
	Ports []int32 `json:"ports,omitempty" protobuf:"varint,2,rep,name=ports"`

	// Is external service
	// +optional
	IsExternal bool `json:"isExternal,omitempty" protobuf:"varint,3,rep,name=IsExternal"`

	// Template describes the pods that will be created.
	Template corev1.PodTemplateSpec `json:"template" protobuf:"bytes,4,opt,name=template"`
}

ServiceSpec defines the desired state of a service +k8s:openapi-gen=true

func (*ServiceSpec) DeepCopy

func (in *ServiceSpec) DeepCopy() *ServiceSpec

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

func (*ServiceSpec) DeepCopyInto

func (in *ServiceSpec) DeepCopyInto(out *ServiceSpec)

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

type TFJobSpec

type TFJobSpec struct {
	// Defines the policy for cleaning up pods after the Job completes.
	// Defaults to Running.
	CleanPodPolicy *CleanPodPolicy `json:"cleanPodPolicy,omitempty" protobuf:"bytes,1,opt,name=cleanPodPolicy"`

	// SchedulingPolicy defines the policy related to scheduling, e.g. gang-scheduling
	// +optional
	SchedulingPolicy *SchedulingPolicy `json:"schedulingPolicy,omitempty"  protobuf:"bytes,2,opt,name=schedulingPolicy"`

	// SuccessPolicy defines the policy to mark the TFJob as succeeded.
	// Default to "", using the default rules.
	// +optional
	SuccessPolicy *TFSuccessPolicy `json:"successPolicy,omitempty" protobuf:"bytes,3,opt,name=successPolicy"`

	// A switch to enable dynamic worker
	EnableDynamicWorker bool `json:"enableDynamicWorker,omitempty" protobuf:"bytes,4,opt,name=enableDynamicWorker"`

	// A map of ReplicaType (type) to ReplicaSpec (value). Specifies the TF cluster configuration.
	// For example,
	//   {
	//     "PS": ReplicaSpec,
	//     "Worker": ReplicaSpec,
	//   }
	ReplicaSpecs map[TFReplicaType]*KFReplicaSpec `json:"replicaSpecs" protobuf:"bytes,5,opt,name=replicaSpecs"`
}

TFJobSpec defines the desired state of a tf job +k8s:openapi-gen=true

func (*TFJobSpec) DeepCopy

func (in *TFJobSpec) DeepCopy() *TFJobSpec

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

func (*TFJobSpec) DeepCopyInto

func (in *TFJobSpec) DeepCopyInto(out *TFJobSpec)

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

type TFReplicaType

type TFReplicaType string

TFReplicaType is the type for TFReplica. Can be one of: "Chief"/"Master" (semantically equivalent), "Worker", "PS", or "Evaluator".

const (
	// TFReplicaTypePS is the type for parameter servers of distributed TensorFlow.
	TFReplicaTypePS TFReplicaType = "PS"

	// TFReplicaTypeWorker is the type for workers of distributed TensorFlow.
	// This is also used for non-distributed TensorFlow.
	TFReplicaTypeWorker TFReplicaType = "Worker"

	// TFReplicaTypeChief is the type for chief worker of distributed TensorFlow.
	// If there is "chief" replica type, it's the "chief worker".
	// Else, worker:0 is the chief worker.
	TFReplicaTypeChief TFReplicaType = "Chief"

	// TFReplicaTypeMaster is the type for master worker of distributed TensorFlow.
	// This is similar to chief, and kept just for backwards compatibility.
	TFReplicaTypeMaster TFReplicaType = "Master"

	// TFReplicaTypeEval is the type for evaluation replica in TensorFlow.
	TFReplicaTypeEval TFReplicaType = "Evaluator"
)

type TFSuccessPolicy

type TFSuccessPolicy string

SuccessPolicy is the success policy.

const (
	SuccessPolicyDefault    TFSuccessPolicy = ""
	SuccessPolicyAllWorkers TFSuccessPolicy = "AllWorkers"
)

type TerminationSpec

type TerminationSpec struct {
	// Specifies the number of retries before marking this job failed.
	// Defaults to 0
	// +optional
	BackoffLimit *int32 `json:"backoffLimit,omitempty" default:"1" protobuf:"varint,1,opt,name=backoffLimit"`

	// Specifies the duration (in seconds) since startTime during which the job can remain active
	// before it is terminated. Must be a positive integer.
	// This setting applies only to pods where restartPolicy is OnFailure or Always.
	// +optional
	ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty" protobuf:"varint,2,opt,name=activeDeadlineSeconds"`

	// ttlSecondsAfterFinished limits the lifetime of a Job that has finished
	// execution (either Complete or Failed). If this field is set,
	// ttlSecondsAfterFinished after the Job finishes, it is eligible to be
	// automatically deleted. When the Job is being deleted, its lifecycle
	// guarantees (e.g. finalizers) will be honored. If this field is unset,
	// the Job won't be automatically deleted. If this field is set to zero,
	// the Job becomes eligible to be deleted immediately after it finishes.
	// This field is alpha-level and is only honored by servers that enable the
	// TTLAfterFinished feature.
	// TODO: (Cleanup logic once kubernetes adds the cleanup controller)
	// +optional
	TTLSecondsAfterFinished *int32 `json:"ttlSecondsAfterFinished,omitempty" protobuf:"varint,3,opt,name=ttlSecondsAfterFinished"`
}

TerminationSpec defines the desired termination specification for handliong timeout, retries, and ttl +k8s:openapi-gen=true

func (*TerminationSpec) DeepCopy

func (in *TerminationSpec) DeepCopy() *TerminationSpec

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

func (*TerminationSpec) DeepCopyInto

func (in *TerminationSpec) DeepCopyInto(out *TerminationSpec)

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

type XGBReplicaType

type XGBReplicaType string

TFReplicaType is the type for TFReplica. Can be one of: "Chief"/"Master" (semantically equivalent), "Worker", "PS", or "Evaluator".

const (
	// XGBoostReplicaTypeMaster is the type of Master of distributed XGBoostJjob
	XGBoostReplicaTypeMaster XGBReplicaType = "Scheduler"

	// XGBoostReplicaTypeWorker is the type for workers of distributed XGBoostJjob.
	XGBoostReplicaTypeWorker XGBReplicaType = "Worker"
)

type XGBoostJobSpec

type XGBoostJobSpec struct {
	// Defines the policy for cleaning up pods after the Job completes.
	// Defaults to Running.
	CleanPodPolicy *CleanPodPolicy `json:"cleanPodPolicy,omitempty" protobuf:"bytes,1,opt,name=cleanPodPolicy"`

	// SchedulingPolicy defines the policy related to scheduling, e.g. gang-scheduling
	// +optional
	SchedulingPolicy *SchedulingPolicy `json:"schedulingPolicy,omitempty"  protobuf:"bytes,2,opt,name=schedulingPolicy"`

	// A map of ReplicaType (type) to ReplicaSpec (value). Specifies the XGBoost cluster configuration.
	// For example,
	//   {
	//     "Master": ReplicaSpec,
	//     "Worker": ReplicaSpec,
	//   }
	ReplicaSpecs map[XGBReplicaType]*KFReplicaSpec `json:"replicaSpecs" protobuf:"bytes,3,opt,name=replicaSpecs"`
}

XGBoostJobSpec defines the desired state of a xgboost job +k8s:openapi-gen=true

func (*XGBoostJobSpec) DeepCopy

func (in *XGBoostJobSpec) DeepCopy() *XGBoostJobSpec

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

func (*XGBoostJobSpec) DeepCopyInto

func (in *XGBoostJobSpec) DeepCopyInto(out *XGBoostJobSpec)

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