v1alpha1

package
v0.0.0-...-9490451 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0, BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the elastic v1alpha1 API group +kubebuilder:object:generate=true +groupName=elastic.iml.github.io

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "elastic.iml.github.io", Version: "v1alpha1"}

	// 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

	// SchemeGroupVersionKind is the gvk of ElasticJob
	SchemeGroupVersionKind = GroupVersion.WithKind("ElasticJob")
)

Functions

This section is empty.

Types

type ElasticJob

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

	Spec   ElasticJobSpec   `json:"spec,omitempty"`
	Status ElasticJobStatus `json:"status,omitempty"`
}

ElasticJob is the Schema for the elasticjobs API

func (*ElasticJob) DeepCopy

func (in *ElasticJob) DeepCopy() *ElasticJob

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

func (*ElasticJob) DeepCopyInto

func (in *ElasticJob) DeepCopyInto(out *ElasticJob)

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

func (*ElasticJob) DeepCopyObject

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

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

type ElasticJobList

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

ElasticJobList contains a list of ElasticJob

func (*ElasticJobList) DeepCopy

func (in *ElasticJobList) DeepCopy() *ElasticJobList

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

func (*ElasticJobList) DeepCopyInto

func (in *ElasticJobList) DeepCopyInto(out *ElasticJobList)

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

func (*ElasticJobList) DeepCopyObject

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

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

type ElasticJobSpec

type ElasticJobSpec struct {

	// DistributionStrategy specifies the distribution strategy of a job.
	// Now, the strategy supports parameter-server and ring-allreduce.
	DistributionStrategy string `json:"distributionStrategy,omitempty"`

	// ResourceLimits specifies the maximum resource of a job. For example,
	// {"cpu": "100", "memory": "10240Mi"} means the number of maximum cpu cores
	// is 100 and the maximum of all Pods is 10Gi.
	ResourceLimits map[string]string `json:"resourceLimits,omitempty"`

	// optimizeMode specifies the mode to optimize the job resoruce.
	// Now, it support "mannual/single-job/cluster".
	OptimizeMode string `json:"optimizeMode,omitempty"`

	// BrainService specifies the address of Brain to optimize the job resource.
	// It is only used when optimizeMode is cluster.
	BrainService string `json:"brainService,omitempty"`

	// EnableElasticScheduling starts elasticity of Pods.
	EnableElasticScheduling bool `json:"enableElasticScheduling,omitempty"`

	// EnableDynamicSharding starts the dynamic sharding of the dataset.
	EnableDynamicSharding bool `json:"enableDynamicSharding,omitempty"`

	// A map of ReplicaType (type) to ReplicaSpec (value). Specifies the training cluster configuration.
	// For example,
	//   {
	//     "PS": ReplicaSpec,
	//     "Worker": ReplicaSpec,
	//   }
	ReplicaSpecs map[commonv1.ReplicaType]*ReplicaSpec `json:"replicaSpecs"`

	// Envs specifies environment variables for Pods of the job.
	Envs map[string]*corev1.EnvVar `json:"envs,omitempty"`
}

ElasticJobSpec defines the desired state of ElasticJob

func (*ElasticJobSpec) DeepCopy

func (in *ElasticJobSpec) DeepCopy() *ElasticJobSpec

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

func (*ElasticJobSpec) DeepCopyInto

func (in *ElasticJobSpec) DeepCopyInto(out *ElasticJobSpec)

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

type ElasticJobStatus

type ElasticJobStatus struct {
	commonv1.JobStatus `json:"status,omitempty"`

	// Phase shows the phase of job lifecycle
	Phase commonv1.JobConditionType `json:"phase,omitempty"`

	// ScalePlan is a name of ScalePlan CRD to scale the job resource.
	ScalePlan string `json:"scalePlan,omitempty"`
}

ElasticJobStatus defines the observed state of ElasticJob

func (*ElasticJobStatus) DeepCopy

func (in *ElasticJobStatus) DeepCopy() *ElasticJobStatus

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

func (*ElasticJobStatus) DeepCopyInto

func (in *ElasticJobStatus) DeepCopyInto(out *ElasticJobStatus)

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

type PodMeta

type PodMeta struct {
	// Name is the name of the Pod
	Name string `json:"name,omitempty"`

	// Id is the identity of the Pod
	ID int `json:"id,omitempty"`

	// Type is the type of the Pod
	Type commonv1.ReplicaType `json:"type,omitempty"`

	// RankIndex is the index of the Pod
	RankIndex int `json:"rankIndex,omitempty"`

	// Service is the service whose endpoint is the Pod.
	Service string `json:"service,omitempty"`

	// Resource defines the resource of each replica
	Resource corev1.ResourceList `json:"resource,omitempty"`
}

PodMeta specifies the meta of a Pod.

func (*PodMeta) DeepCopy

func (in *PodMeta) DeepCopy() *PodMeta

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

func (*PodMeta) DeepCopyInto

func (in *PodMeta) DeepCopyInto(out *PodMeta)

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

type ReplicaResourceSpec

type ReplicaResourceSpec struct {
	// Replicas is the number of replica
	Replicas int `json:"replicas,omitempty"`

	// Resource defines the resource of each replica
	Resource corev1.ResourceList `json:"resource,omitempty"`
}

ReplicaResourceSpec specifies the number and resources of replica.

func (*ReplicaResourceSpec) DeepCopy

func (in *ReplicaResourceSpec) DeepCopy() *ReplicaResourceSpec

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

func (*ReplicaResourceSpec) DeepCopyInto

func (in *ReplicaResourceSpec) DeepCopyInto(out *ReplicaResourceSpec)

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

type ReplicaSpec

type ReplicaSpec struct {
	commonv1.ReplicaSpec `json:",inline"`

	// RestartCount is the number of relaunching a failed replica.
	RestartCount int `json:"restartCount,omitempty"`

	// AutoScale is the flag to auto scale the number of replicas and resource of each replica.
	AutoScale bool `json:"autoScale,omitempty"`

	// RestartTimeout is the time to wait a hanging replica.
	RestartTimeout int `json:"restartTimeout,omitempty"`

	// Priority supports high/low/0.5. The 0.5 means that half workers have high priority,
	// and half workers have low priority. The default value is low.
	Priority string `json:"priority,omitempty"`
}

ReplicaSpec specifies the number and resources of replica.

func (*ReplicaSpec) DeepCopy

func (in *ReplicaSpec) DeepCopy() *ReplicaSpec

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

func (*ReplicaSpec) DeepCopyInto

func (in *ReplicaSpec) DeepCopyInto(out *ReplicaSpec)

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

type ScalePlan

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

	Spec   ScaleSpec       `json:"spec,omitempty"`
	Status ScalePlanStatus `json:"status,omitempty"`
}

ScalePlan is the Schema for the scaling plan API

func (*ScalePlan) DeepCopy

func (in *ScalePlan) DeepCopy() *ScalePlan

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

func (*ScalePlan) DeepCopyInto

func (in *ScalePlan) DeepCopyInto(out *ScalePlan)

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

func (*ScalePlan) DeepCopyObject

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

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

type ScalePlanList

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

ScalePlanList contains a list of ScalePlan

func (*ScalePlanList) DeepCopy

func (in *ScalePlanList) DeepCopy() *ScalePlanList

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

func (*ScalePlanList) DeepCopyInto

func (in *ScalePlanList) DeepCopyInto(out *ScalePlanList)

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

func (*ScalePlanList) DeepCopyObject

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

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

type ScalePlanStatus

type ScalePlanStatus struct {

	// CreateTime represents time when the scaling plan was acknowledged by the controller.
	CreateTime *metav1.Time `json:"createTime,omitempty"`

	// FinishTime represents time when the scaling plan is executed by the controller.
	FinishTime *metav1.Time `json:"finishTime,omitempty"`

	// Phase shows the phase of scalePlan lifecycle
	Phase commonv1.JobConditionType `json:"phase,omitempty"`
}

ScalePlanStatus defines the observed state of ElasticJob

func (*ScalePlanStatus) DeepCopy

func (in *ScalePlanStatus) DeepCopy() *ScalePlanStatus

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

func (*ScalePlanStatus) DeepCopyInto

func (in *ScalePlanStatus) DeepCopyInto(out *ScalePlanStatus)

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

type ScaleSpec

type ScaleSpec struct {

	// A map of ReplicaType (type) to ReplicaSpec (value). Specifies the resource of a job.
	// For example,
	//   {
	//     "PS": ReplicaResourceSpec,
	//     "worker": ReplicaResourceSpec,
	//   }
	ReplicaResourceSpecs map[commonv1.ReplicaType]ReplicaResourceSpec `json:"replicaResourceSpecs,omitempty"`

	// CreatePods are Pods to be created.
	CreatePods []PodMeta `json:"createPods,omitempty"`

	// RemovePods are Pods to be removed
	RemovePods []PodMeta `json:"removePods,omitempty"`

	// MigratePods are Pods to be migrated to other Pods with the new resource.
	MigratePods []PodMeta `json:"migratePods,omitempty"`

	// PsHosts are hosts of PS Pods
	PsHosts []string `json:"psHosts,omitempty"`

	// OwnerJob specifies a job to scale.
	OwnerJob string `json:"ownerJob,omitempty"`
}

ScaleSpec defines the desired resource state of an ElasticJob

func (*ScaleSpec) DeepCopy

func (in *ScaleSpec) DeepCopy() *ScaleSpec

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

func (*ScaleSpec) DeepCopyInto

func (in *ScaleSpec) DeepCopyInto(out *ScaleSpec)

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