v1alpha1

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the xdl v1alpha1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=github.com/alibaba/kubedl/api/xdl +k8s:defaulter-gen=TypeMeta +groupName=xdl.kubedl.io

Package v1alpha1 contains API Schema definitions for the xdl v1alpha1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=github.com/alibaba/kubedl/api/xdl +k8s:defaulter-gen=TypeMeta +groupName=xdl.kubedl.io

Index

Constants

View Source
const (
	// Field of XDLJobSpec, 0 indicate that job finish util all workers done.
	DefaultMinFinishWorkNum int32 = 0
	// Field of XDLJobSpec, 90 indicate that job finish util 90% workers done.
	DefaultMinFinishWorkRate int32 = 90
	// Field of XDLJobSpec, default total failover times of job is 20.
	DefaultBackoffLimit int32 = 20
	// TODO(qiukai.cqk): ensure default names
	DefaultContainerName     = "xdl"
	DefaultContainerPortName = "xdljob-port"
	DefaultPort              = 2222
	DefaultRestartPolicy     = v1.RestartPolicyNever
)
View Source
const (
	// GroupName is the group name use in this package.
	GroupName = "xdl.kubedl.io"
	// Kind is the kind name.
	Kind = "XDLJob"
	// GroupVersion is the version.
	GroupVersion = "v1alpha1"
	// Plural is the Plural for XDLJob.
	Plural = "xdljobs"
	// Singular is the singular for XDLJob.
	Singular = "xdljob"
)
View Source
const (
	// XDLReplicaTypePS is the type for parameter servers of distributed XDL.
	XDLReplicaTypePS v1.ReplicaType = "PS"

	// XDLReplicaTypeWorker is the type for workers of distributed XDL.
	// This is also used for non-distributed XDL.
	XDLReplicaTypeWorker v1.ReplicaType = "Worker"

	// XDLReplicaTypeScheduler is the type for code auto-generation scheduler of
	// distributed XDL.
	XDLReplicaTypeScheduler v1.ReplicaType = "Scheduler"

	// XDLReplicaTypeExtendRole is the extended replica type of distributed XDL.
	// ExtendRole may participate in computing and be seen as another kind of
	// worker.
	XDLReplicaTypeExtendRole v1.ReplicaType = "ExtendRole"
)

Variables

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

	// SchemeGroupVersionKind is the GroupVersionKind of the resource.
	SchemeGroupVersionKind = SchemeGroupVersion.WithKind(Kind)

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

Functions

func Int32

func Int32(v int32) *int32

Int32 is a helper routine that allocates a new int32 value to store v and returns a pointer to it.

func RegisterDefaults

func RegisterDefaults(scheme *runtime.Scheme) error

RegisterDefaults adds defaulters functions to the given scheme. Public to allow building arbitrary schemes. All generated defaulters are covering - they call all nested defaulters.

func Resource

func Resource(resource string) schema.GroupResource

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

func SetDefaults_XDLJob

func SetDefaults_XDLJob(xdlJob *XDLJob)

SetDefaults_XDLJob sets any unspecified values to defaults.

func SetObjectDefaults_XDLJob

func SetObjectDefaults_XDLJob(in *XDLJob)

func SetObjectDefaults_XDLJobList

func SetObjectDefaults_XDLJobList(in *XDLJobList)

Types

type XDLJob

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

	Spec   XDLJobSpec   `json:"spec,omitempty"`
	Status v1.JobStatus `json:"status,omitempty"`
}

XDLJob is the Schema for the xdljobs API +k8s:openapi-gen=true

func (*XDLJob) DeepCopy

func (in *XDLJob) DeepCopy() *XDLJob

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

func (*XDLJob) DeepCopyInto

func (in *XDLJob) DeepCopyInto(out *XDLJob)

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

func (*XDLJob) DeepCopyObject

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

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

type XDLJobList

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

XDLJobList contains a list of XDLJob

func (*XDLJobList) DeepCopy

func (in *XDLJobList) DeepCopy() *XDLJobList

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

func (*XDLJobList) DeepCopyInto

func (in *XDLJobList) DeepCopyInto(out *XDLJobList)

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

func (*XDLJobList) DeepCopyObject

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

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

type XDLJobSpec

type XDLJobSpec struct {
	// RunPolicy encapsulates various runtime policies of the distributed training
	// job, for example how to clean up resources and how long the job can stay
	// active.
	v1.RunPolicy `json:",inline"`

	// XDLReplicaSpecs is map of ReplicaType and ReplicaSpec
	// specifies the XDL replicas to run.
	// For example,
	//   {
	//     "PS": ReplicaSpec,
	//     "Worker": ReplicaSpec,
	//   }
	XDLReplicaSpecs map[v1.ReplicaType]*v1.ReplicaSpec `json:"xdlReplicaSpecs"`

	// MinFinishWorkerNum specifies the minimum number of successfully finished
	// workers such that the job is treated as successful. Not specifying this
	// value means all worker should be successfully finished.
	MinFinishWorkerNum *int32 `json:"minFinishWorkNum,omitempty"`

	// MinFinishWorkPercentage specifies the minimum percentage of all workers
	// that should be finished successfully such that the job is treated as successful.
	// MinFinishWorkPercentage takes precedence over  MinFinishWorkerNum if both are
	// specified.
	MinFinishWorkerPercentage *int32 `json:"minFinishWorkRate,omitempty"`
}

XDLJobSpec defines the desired state of XDLJob

func (*XDLJobSpec) DeepCopy

func (in *XDLJobSpec) DeepCopy() *XDLJobSpec

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

func (*XDLJobSpec) DeepCopyInto

func (in *XDLJobSpec) DeepCopyInto(out *XDLJobSpec)

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