Documentation
¶
Overview ¶
Package v1 is the v1 version of the API. +groupName=paddlepaddle.org
Index ¶
- Constants
- Variables
- func CRDName() string
- func GetGeneratedDeepCopyFuncs() []conversion.GeneratedDeepCopyFuncdeprecated
- func Resource(resource string) schema.GroupResource
- type MasterSpec
- type PserverSpec
- type ResourceState
- type TrainerJobScaleStatus
- type TrainerSpec
- type TrainingJob
- type TrainingJobList
- type TrainingJobPhase
- type TrainingJobSpec
- type TrainingJobStatus
- type TrainingResourceStatus
- type TrainingResourceType
Constants ¶
const ( // CRDKind is the kind of K8s CRD. CRDKind = "TrainingJob" // CRDKindPlural is the plural of CRDKind. CRDKindPlural = "trainingjobs" // CRDShortName is the short name of CRD. CRDShortName = "tj" // CRDGroup is the name of group. CRDGroup = "paddlepaddle.org" // CRDVersion is the version of CRD. CRDVersion = "v1" )
const ( // TrainingJobPhaseNone is empty TrainingJobPhase. TrainingJobPhaseNone TrainingJobPhase = "" // TrainingJobPhaseCreating is creating TrainingJobPhase. TrainingJobPhaseCreating = "creating" // TrainingJobPhaseRunning is running TrainingJobPhase. TrainingJobPhaseRunning = "running" // TrainingJobPhaseSucceeded is succeeded TrainingJobPhase. TrainingJobPhaseSucceeded = "succeeded" // TrainingJobPhaseFailed is failed TrainingJobPhase. TrainingJobPhaseFailed = "failed" )
const ( // ResourceStateNone is the initial state of training job ResourceStateNone ResourceState = "" // ResourceStateStarting is the starting state of ResourceState. ResourceStateStarting = "starting" // ResourceStateRunning is the running state of ResourceState. ResourceStateRunning = "running" // ResourceStateFailed is the failed state of ResourceState. ResourceStateFailed = "failed" // ResourceStateSucceeded is the succeeded state of ResourceState ResourceStateSucceeded = "succeeded" )
Variables ¶
var ( // SchemeBuilder will call register SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) // AddToScheme will apply all the stored functions to the scheme AddToScheme = SchemeBuilder.AddToScheme )
var SchemeGroupVersion = schema.GroupVersion{Group: CRDGroup, Version: CRDVersion}
SchemeGroupVersion is the group version used to register these objects.
Functions ¶
func GetGeneratedDeepCopyFuncs
deprecated
func GetGeneratedDeepCopyFuncs() []conversion.GeneratedDeepCopyFunc
GetGeneratedDeepCopyFuncs returns the generated funcs, since we aren't registering them.
Deprecated: deepcopy registration will go away when static deepcopy is fully implemented.
func Resource ¶
func Resource(resource string) schema.GroupResource
Resource takes an unqualified resource and returns a Group-qualified GroupResource.
Types ¶
type MasterSpec ¶
type MasterSpec struct { EtcdEndpoint string `json:"etcd-endpoint"` Resources corev1.ResourceRequirements `json:"resources"` ReplicaSpec *v1beta1.ReplicaSet `json:"replicaSpec"` }
MasterSpec is the spec for a master in the paddle job
func (*MasterSpec) DeepCopy ¶
func (in *MasterSpec) DeepCopy() *MasterSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MasterSpec.
func (*MasterSpec) DeepCopyInto ¶
func (in *MasterSpec) DeepCopyInto(out *MasterSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PserverSpec ¶
type PserverSpec struct { MinInstance int `json:"min-instance"` MaxInstance int `json:"max-instance"` Resources corev1.ResourceRequirements `json:"resources"` ReplicaSpec *v1beta1.ReplicaSet `json:"replicaSpec"` }
PserverSpec is the spec for pservers in the paddle job
func (*PserverSpec) DeepCopy ¶
func (in *PserverSpec) DeepCopy() *PserverSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PserverSpec.
func (*PserverSpec) DeepCopyInto ¶
func (in *PserverSpec) DeepCopyInto(out *PserverSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type TrainerJobScaleStatus ¶
type TrainerJobScaleStatus struct { }
TrainerJobScaleStatus is status of trainer jobs.
func (*TrainerJobScaleStatus) DeepCopy ¶
func (in *TrainerJobScaleStatus) DeepCopy() *TrainerJobScaleStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TrainerJobScaleStatus.
func (*TrainerJobScaleStatus) DeepCopyInto ¶
func (in *TrainerJobScaleStatus) DeepCopyInto(out *TrainerJobScaleStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type TrainerSpec ¶
type TrainerSpec struct { EtcdEndpoint string `json:"etcd-endpoint"` Entrypoint string `json:"entrypoint"` Workspace string `json:"workspace"` MinInstance int `json:"min-instance"` MaxInstance int `json:"max-instance"` Resources corev1.ResourceRequirements `json:"resources"` ReplicaSpec *batchv1.Job `json:"replicaSpec"` }
TrainerSpec is the spec for trainers in the paddle job
func (*TrainerSpec) DeepCopy ¶
func (in *TrainerSpec) DeepCopy() *TrainerSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TrainerSpec.
func (*TrainerSpec) DeepCopyInto ¶
func (in *TrainerSpec) DeepCopyInto(out *TrainerSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type TrainingJob ¶
type TrainingJob struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec TrainingJobSpec `json:"spec"` Status TrainingJobStatus `json:"status"` }
TrainingJob is a specification for a TrainingJob resource
func (*TrainingJob) DeepCopy ¶
func (in *TrainingJob) DeepCopy() *TrainingJob
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TrainingJob.
func (*TrainingJob) DeepCopyInto ¶
func (in *TrainingJob) DeepCopyInto(out *TrainingJob)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*TrainingJob) DeepCopyObject ¶
func (in *TrainingJob) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*TrainingJob) Elastic ¶
func (s *TrainingJob) Elastic() bool
Elastic returns true if the job can scale to more workers.
func (*TrainingJob) GPU ¶
func (s *TrainingJob) GPU() int
GPU convert Resource Limit Quantity to int
func (*TrainingJob) NeedGPU ¶
func (s *TrainingJob) NeedGPU() bool
NeedGPU returns true if the job need GPU resource to run.
func (*TrainingJob) String ¶
func (s *TrainingJob) String() string
type TrainingJobList ¶
type TrainingJobList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata"` // Items means the list of paddle job/TrainingJob Items []TrainingJob `json:"items"` }
TrainingJobList is a list of TrainingJob resources
func (*TrainingJobList) DeepCopy ¶
func (in *TrainingJobList) DeepCopy() *TrainingJobList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TrainingJobList.
func (*TrainingJobList) DeepCopyInto ¶
func (in *TrainingJobList) DeepCopyInto(out *TrainingJobList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*TrainingJobList) DeepCopyObject ¶
func (in *TrainingJobList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type TrainingJobSpec ¶
type TrainingJobSpec struct { // General job attributes. Image string `json:"image,omitempty"` // If you want to use the hostnetwork instead of container network // portmanager is necessary. About portmanager, please refer to // https://github.com/PaddlePaddle/cloud/blob/develop/doc/hostnetwork/hostnetwork.md HostNetwork bool `json:"host_network,omitempty"` Port int `json:"port,omitempty"` PortsNum int `json:"ports_num,omitempty"` PortsNumForSparse int `json:"ports_num_for_sparse,omitempty"` FaultTolerant bool `json:"fault_tolerant,omitempty"` Passes int `json:"passes,omitempty"` Volumes []corev1.Volume `json:"volumes"` VolumeMounts []corev1.VolumeMount `json:"VolumeMounts"` NodeSelector map[string]string `json:"NodeSelector"` //TODO(m3ngyang) simplify the structure of sub-resource(mengyang) //TrainingJob components. Master MasterSpec `json:"master"` Pserver PserverSpec `json:"pserver"` Trainer TrainerSpec `json:"trainer"` }
TrainingJobSpec is the spec for a TrainingJob resource
func (*TrainingJobSpec) DeepCopy ¶
func (in *TrainingJobSpec) DeepCopy() *TrainingJobSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TrainingJobSpec.
func (*TrainingJobSpec) DeepCopyInto ¶
func (in *TrainingJobSpec) DeepCopyInto(out *TrainingJobSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type TrainingJobStatus ¶
type TrainingJobStatus struct { // Phase is phase of TrainingJob Phase TrainingJobPhase `json:"phase"` // Reason is the reason of job phase failed Reason string `json:"reason"` // ScaleStatus is autoscale status of trainer jobs // TODO(ZhengQi): this will used in autoscale mode in future. ScaleStatus TrainerJobScaleStatus `json:"scale_status"` // ReplicaStatuses is detail status of resources // TODO(ZhengQi): should we only considered trainer job now? ReplicaStatuses []*TrainingResourceStatus `json:"replica_statuses"` }
TrainingJobStatus is the status for a TrainingJob resource.
func (*TrainingJobStatus) DeepCopy ¶
func (in *TrainingJobStatus) DeepCopy() *TrainingJobStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TrainingJobStatus.
func (*TrainingJobStatus) DeepCopyInto ¶
func (in *TrainingJobStatus) DeepCopyInto(out *TrainingJobStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type TrainingResourceStatus ¶
type TrainingResourceStatus struct { // TrainingResourceType the type of TrainingJob resource, include MASTER PSERVER and TRAINER TrainingResourceType `json:"training_resource_type"` // State is the state of a type of resource State ResourceState `json:"state"` // ResourceStates is the number of resource in different state ResourceStates map[ResourceState]int `json:"resource_states"` }
TrainingResourceStatus is the status of every resource
func (*TrainingResourceStatus) DeepCopy ¶
func (in *TrainingResourceStatus) DeepCopy() *TrainingResourceStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TrainingResourceStatus.
func (*TrainingResourceStatus) DeepCopyInto ¶
func (in *TrainingResourceStatus) DeepCopyInto(out *TrainingResourceStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type TrainingResourceType ¶
type TrainingResourceType string
TrainingResourceType the type of TrainingJob resource, include MASTER PSERVER and TRAINER
const ( // Master is the master name of TrainingResourceType. Master TrainingResourceType = "MASTER" // Pserver is the pserver name of TrainingResourceType. Pserver TrainingResourceType = "PSERVER" // Trainer is the trainer name of TrainingResourceType. Trainer TrainingResourceType = "TRAINER" )