v1alpha1

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the dgljob v1alpha1 API group +kubebuilder:object:generate=true +groupName=qihoo.net

Index

Constants

View Source
const (
	Kind     = "DGLJob"
	DGL_PORT = 30050
	// Annotation key
	DGLReplicaAnnotation = "dgl-replica"
	// Label key
	DGLReplicaName = "dgl-replica-name"
	DGLReplicaType = "dgl-replica-type"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "qihoo.net", 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
)

Functions

This section is empty.

Types

type CleanPodPolicy

type CleanPodPolicy string

CleanPodPolicy describes how to deal with pods when the job is finished

const (
	// CleanPodPolicyAll policy will clean all pods when job finished
	CleanPodPolicyAll CleanPodPolicy = "All"
	// CleanPodPolicyRunning policy will clean running pods when job finished
	CleanPodPolicyRunning CleanPodPolicy = "Running"
	// CleanPodPolicyNever policy None
	CleanPodPolicyNone CleanPodPolicy = "None"
)

type DGLJob

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

	Spec   DGLJobSpec   `json:"spec,omitempty"`
	Status DGLJobStatus `json:"status,omitempty"`
}

DGLJob is the Schema for the dgljobs API

func (*DGLJob) DeepCopy

func (in *DGLJob) DeepCopy() *DGLJob

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

func (*DGLJob) DeepCopyInto

func (in *DGLJob) DeepCopyInto(out *DGLJob)

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

func (*DGLJob) DeepCopyObject

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

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

type DGLJobList

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

DGLJobList contains a list of DGLJob

func (*DGLJobList) DeepCopy

func (in *DGLJobList) DeepCopy() *DGLJobList

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

func (*DGLJobList) DeepCopyInto

func (in *DGLJobList) DeepCopyInto(out *DGLJobList)

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

func (*DGLJobList) DeepCopyObject

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

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

type DGLJobSpec

type DGLJobSpec struct {
	SlotsPerWorker *int `json:"slotsPerWorker,omitempty"`

	// PartitionMode defines the policy how to partition. Defaults to DGL-API.
	// +kubebuilder:default:=DGL-API
	PartitionMode *PartitionMode `json:"partitionMode,omitempty"`

	// CleanPodPolicy defines the policy that whether to kill pods after the job completes. Defaults to None.
	// +kubebuilder:default:=Running
	CleanPodPolicy *CleanPodPolicy `json:"cleanPodPolicy,omitempty"`

	// DGLReplicaSpecs describes the spec of launcher or worker base on pod template
	DGLReplicaSpecs map[ReplicaType]*ReplicaSpec `json:"dglReplicaSpecs"`
}

DGLJobSpec defines the desired state of DGLJob

func (*DGLJobSpec) DeepCopy

func (in *DGLJobSpec) DeepCopy() *DGLJobSpec

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

func (*DGLJobSpec) DeepCopyInto

func (in *DGLJobSpec) DeepCopyInto(out *DGLJobSpec)

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

type DGLJobStatus

type DGLJobStatus struct {
	Phase JobPhase `json:"phase,omitempty"`

	// ReplicaStatuses is map of ReplicaType and ReplicaStatus,
	// specifies the status of each replica.
	ReplicaStatuses map[ReplicaType]*ReplicaStatus `json:"replicaStatuses"`

	// Represents time when the job was acknowledged by the job 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 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"`

	// Represents 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"`
}

DGLJobStatus defines the observed state of DGLJob

func (*DGLJobStatus) DeepCopy

func (in *DGLJobStatus) DeepCopy() *DGLJobStatus

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

func (*DGLJobStatus) DeepCopyInto

func (in *DGLJobStatus) DeepCopyInto(out *DGLJobStatus)

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

type JobPhase

type JobPhase string

JobPhase defines the phase of the job.

const (
	Starting     JobPhase = "Starting"
	Pending      JobPhase = "Pending"
	Partitioning JobPhase = "Partitioning"
	Partitioned  JobPhase = "Partitioned"
	Training     JobPhase = "Training"
	Completed    JobPhase = "Completed"
	Failed       JobPhase = "Failed"
	Evicted      JobPhase = "Evicted"
	Succeed      JobPhase = "Succeed"
)

type PartitionMode added in v0.1.1

type PartitionMode string

PartitionMode describes how to deal with the partitioning

const (
	// PartitionModeDGLAPI will partition standalone
	PartitionModeDGLAPI PartitionMode = "DGL-API"
	// PartitionModeParMETIS will partition in a fully distributed manner
	PartitionModeParMETIS PartitionMode = "ParMETIS"
	// PartitionModeSkip will skip the partitioning
	PartitionModeSkip PartitionMode = "Skip"
)

type ReplicaSpec

type ReplicaSpec struct {
	// Replicas replica
	Replicas *int `json:"replicas,omitempty"`

	// Template is the object that describes the pod that
	// will be created for this replica
	Template corev1.PodTemplateSpec `json:"template"`
}

ReplicaSpec is a description of the 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 ReplicaStatus

type ReplicaStatus struct {
	// The number of actively running pods.
	Running int `json:"running,omitempty"`
	// The number of pending pods.
	Pending int `json:"pending,omitempty"`
	// The number of starting pods.
	Starting int `json:"starting,omitempty"`
	// The number of pods which reached phase Succeeded.
	Succeeded int `json:"succeeded,omitempty"`
	// The number of pods which reached phase Failed.
	Failed int `json:"failed,omitempty"`
	// Replica ready string
	Ready string `json:"ready,omitempty"`
}

ReplicaStatus represents the current observed state of replica

func (*ReplicaStatus) DeepCopy

func (in *ReplicaStatus) DeepCopy() *ReplicaStatus

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

func (*ReplicaStatus) DeepCopyInto

func (in *ReplicaStatus) DeepCopyInto(out *ReplicaStatus)

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

type ReplicaType

type ReplicaType string
const (
	LauncherReplica    ReplicaType = "Launcher"
	WorkerReplica      ReplicaType = "Worker"
	PartitionerReplica ReplicaType = "Partitioner"
)

Jump to

Keyboard shortcuts

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