Documentation ¶
Overview ¶
Package v1alpha2 is the v1alpha2 version of the API. +groupName=kubeflow.org
Index ¶
- Constants
- Variables
- func Int32(v int32) *int32
- func IsScheduler(typ MXReplicaType) bool
- func RegisterDefaults(scheme *runtime.Scheme) error
- func Resource(resource string) schema.GroupResource
- func SetDefaults_MXJob(mxjob *MXJob)
- func SetObjectDefaults_MXJob(in *MXJob)
- func SetObjectDefaults_MXJobList(in *MXJobList)
- type CleanPodPolicy
- type JobModeType
- type MXJob
- type MXJobCondition
- type MXJobConditionType
- type MXJobList
- type MXJobSpec
- type MXJobStatus
- type MXReplicaSpec
- type MXReplicaStatus
- type MXReplicaType
- type RestartPolicy
- type SuccessPolicy
Constants ¶
const ( // EnvKubeflowNamespace is ENV for kubeflow namespace specified by user. EnvKubeflowNamespace = "KUBEFLOW_NAMESPACE" // DefaultPortName is name of the port used to communicate between scheduler and // servers & workers. DefaultPortName = "mxjob-port" // DefaultContainerName is the name of the MXJob container. DefaultContainerName = "mxnet" // DefaultPort is default value of the port. DefaultPort = 9091 // DefaultRestartPolicy is default RestartPolicy for MXReplicaSpec. DefaultRestartPolicy = RestartPolicyNever )
const ( // GroupName is the group name use in this package. GroupName = "kubeflow.org" // Kind is the kind name. Kind = "MXJob" // GroupVersion is the version. GroupVersion = "v1beta1" // Plural is the Plural for MXJob. Plural = "mxjobs" // Singular is the singular for MXJob. Singular = "mxjob" // MXCRD is the CRD name for MXJob. MXCRD = "mxjobs.kubeflow.org" )
Variables ¶
var ( // TODO: move SchemeBuilder with zz_generated.deepcopy.go to k8s.io/api. // localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes. SchemeBuilder runtime.SchemeBuilder AddToScheme = localSchemeBuilder.AddToScheme )
var ( // SchemeGroupVersion is the 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) )
Functions ¶
func Int32 ¶
Int32 is a helper routine that allocates a new int32 value to store v and returns a pointer to it.
func IsScheduler ¶
func IsScheduler(typ MXReplicaType) bool
IsScheduler returns true if the type is Scheduler.
func RegisterDefaults ¶
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 takes an unqualified resource and returns a Group-qualified GroupResource.
func SetDefaults_MXJob ¶
func SetDefaults_MXJob(mxjob *MXJob)
SetDefaults_MXJob sets any unspecified values to defaults.
func SetObjectDefaults_MXJob ¶
func SetObjectDefaults_MXJob(in *MXJob)
func SetObjectDefaults_MXJobList ¶
func SetObjectDefaults_MXJobList(in *MXJobList)
Types ¶
type CleanPodPolicy ¶
type CleanPodPolicy string
CleanPodPolicy describes how to deal with pods when the MXJob is finished.
const ( CleanPodPolicyUndefined CleanPodPolicy = "" CleanPodPolicyAll CleanPodPolicy = "All" CleanPodPolicyRunning CleanPodPolicy = "Running" CleanPodPolicyNone CleanPodPolicy = "None" )
type JobModeType ¶
type JobModeType string
JobModeType id the type for JobMode
const ( // Train Mode, in this mode requested MXReplicaSpecs need // has Server, Scheduler, Worker MXTrain JobModeType = "MXTrain" // Tune Mode, in this mode requested MXReplicaSpecs need // has Tuner MXTune JobModeType = "MXTune" )
type MXJob ¶
type MXJob struct { metav1.TypeMeta `json:",inline"` // Standard object's metadata. metav1.ObjectMeta `json:"metadata,omitempty"` // Specification of the desired behavior of the MXJob. Spec MXJobSpec `json:"spec,omitempty"` // Most recently observed status of the MXJob. // This data may not be up to date. // Populated by the system. // Read-only. Status MXJobStatus `json:"status,omitempty"` }
MXJob represents the configuration of signal MXJob
func (*MXJob) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MXJob.
func (*MXJob) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*MXJob) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type MXJobCondition ¶
type MXJobCondition struct { // Type of MXJob condition. Type MXJobConditionType `json:"type"` // Status of the condition, one of True, False, Unknown. Status v1.ConditionStatus `json:"status"` // The reason for the condition's last transition. Reason string `json:"reason,omitempty"` // A human readable message indicating details about the transition. Message string `json:"message,omitempty"` // The last time this condition was updated. LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty"` // Last time the condition transitioned from one status to another. LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"` }
MXJobCondition describes the state of the MXJob at a certain point.
func (*MXJobCondition) DeepCopy ¶
func (in *MXJobCondition) DeepCopy() *MXJobCondition
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MXJobCondition.
func (*MXJobCondition) DeepCopyInto ¶
func (in *MXJobCondition) DeepCopyInto(out *MXJobCondition)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type MXJobConditionType ¶
type MXJobConditionType string
MXJobConditionType defines all kinds of types of MXJobStatus.
const ( // MXJobCreated means the mxjob has been accepted by the system, // but one or more of the pods/services has not been started. // This includes time before pods being scheduled and launched. MXJobCreated MXJobConditionType = "Created" // MXJobRunning means all sub-resources (e.g. services/pods) of this MXJob // have been successfully scheduled and launched. // The training is running without error. MXJobRunning MXJobConditionType = "Running" // MXJobRestarting means one or more sub-resources (e.g. services/pods) of this MXJob // reached phase failed but maybe restarted according to it's restart policy // which specified by user in v1.PodTemplateSpec. // The training is freezing/pending. MXJobRestarting MXJobConditionType = "Restarting" // MXJobSucceeded means all sub-resources (e.g. services/pods) of this MXJob // reached phase have terminated in success. // The training is complete without error. MXJobSucceeded MXJobConditionType = "Succeeded" // MXJobFailed means one or more sub-resources (e.g. services/pods) of this MXJob // reached phase failed with no restarting. // The training has failed its execution. MXJobFailed MXJobConditionType = "Failed" )
type MXJobList ¶
type MXJobList struct { metav1.TypeMeta `json:",inline"` // Standard list metadata. metav1.ListMeta `json:"metadata,omitempty"` // List of MXJobs. Items []MXJob `json:"items"` }
MXJobList is a list of MXJobs.
func (*MXJobList) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MXJobList.
func (*MXJobList) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*MXJobList) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type MXJobSpec ¶
type MXJobSpec struct { // CleanPodPolicy defines the policy to kill pods after MXJob is // succeeded. // Default to All. CleanPodPolicy *CleanPodPolicy `json:"cleanPodPolicy,omitempty"` // SuccessPolicy defines the policy to mark the MXJob as succeeded. // Default to "", using the default rules. When either scheduler // or all workers have completed, consider the job is finished. SuccessPolicy *SuccessPolicy `json:"successPolicy,omitempty"` // TTLSecondsAfterFinished is the TTL to clean up mxnet-jobs (temporary // before kubernetes adds the cleanup controller). // It may take extra ReconcilePeriod seconds for the cleanup, since // reconcile gets called periodically. // Default to infinite. TTLSecondsAfterFinished *int32 `json:"ttlSecondsAfterFinished,omitempty"` // JobMode specify the kind of MXjob to do. Different mode may have // different MXReplicaSpecs request JobMode JobModeType `json:"jobMode"` // MXReplicaSpecs is map of MXReplicaType and MXReplicaSpec // specifies the MX replicas to run. // For example, // { // "Scheduler": MXReplicaSpec, // "Server": MXReplicaSpec, // "Worker": MXReplicaSpec, // } MXReplicaSpecs map[MXReplicaType]*MXReplicaSpec `json:"mxReplicaSpecs"` }
MXJobSpec is a desired state description of the MXJob.
func (*MXJobSpec) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MXJobSpec.
func (*MXJobSpec) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type MXJobStatus ¶
type MXJobStatus struct { // Conditions is an array of current observed MXJob conditions. Conditions []MXJobCondition `json:"conditions"` // MXReplicaStatuses is map of MXReplicaType and MXReplicaStatus, // specifies the status of each MXReplica. MXReplicaStatuses map[MXReplicaType]*MXReplicaStatus `json:"mxReplicaStatuses"` // Represents time when the MXJob was acknowledged by the MXJob 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 MXJob 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 MXJob 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"` }
MXJobStatus represents the current observed state of the MXJob.
func (*MXJobStatus) DeepCopy ¶
func (in *MXJobStatus) DeepCopy() *MXJobStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MXJobStatus.
func (*MXJobStatus) DeepCopyInto ¶
func (in *MXJobStatus) DeepCopyInto(out *MXJobStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type MXReplicaSpec ¶
type MXReplicaSpec struct { // Replicas is the desired number of replicas of the given template. // If unspecified, defaults to 1. Replicas *int32 `json:"replicas,omitempty"` // Label is used as tunerServerKey, it's designed for tvm auto-tuning. Label string `json:"label,omitempty"` // Template is the object that describes the pod that // will be created for this MXReplica. RestartPolicy in PodTemplateSpec // will be overide by RestartPolicy in MXReplicaSpec Template v1.PodTemplateSpec `json:"template,omitempty"` // Restart policy for all MXReplicas within the MXJob. // One of Always, OnFailure, Never and ExitCode. // Default to Never. RestartPolicy RestartPolicy `json:"restartPolicy,omitempty"` }
MXReplicaSpec is a description of the MXReplica
func (*MXReplicaSpec) DeepCopy ¶
func (in *MXReplicaSpec) DeepCopy() *MXReplicaSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MXReplicaSpec.
func (*MXReplicaSpec) DeepCopyInto ¶
func (in *MXReplicaSpec) DeepCopyInto(out *MXReplicaSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type MXReplicaStatus ¶
type MXReplicaStatus struct { // The number of actively running pods. Active int32 `json:"active,omitempty"` // The number of pods which reached phase Succeeded. Succeeded int32 `json:"succeeded,omitempty"` // The number of pods which reached phase Failed. Failed int32 `json:"failed,omitempty"` }
MXReplicaStatus represents the current observed state of the MXReplica.
func (*MXReplicaStatus) DeepCopy ¶
func (in *MXReplicaStatus) DeepCopy() *MXReplicaStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MXReplicaStatus.
func (*MXReplicaStatus) DeepCopyInto ¶
func (in *MXReplicaStatus) DeepCopyInto(out *MXReplicaStatus)
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.
const ( // MXReplicaTypeScheduler is the type for scheduler replica in MXNet. MXReplicaTypeScheduler MXReplicaType = "Scheduler" // MXReplicaTypeServer is the type for parameter servers of distributed MXNet. MXReplicaTypeServer MXReplicaType = "Server" // MXReplicaTypeWorker is the type for workers of distributed MXNet. // This is also used for non-distributed MXNet. MXReplicaTypeWorker MXReplicaType = "Worker" // MXReplicaTypeTunerTracker // This the auto-tuning tracker e.g. autotvm tracker, it will dispatch tuning task to TunerServer MXReplicaTypeTunerTracker MXReplicaType = "TunerTracker" // MXReplicaTypeTunerServer MXReplicaTypeTunerServer MXReplicaType = "TunerServer" // MXReplicaTuner is the type for auto-tuning of distributed MXNet. // This is also used for non-distributed MXNet. MXReplicaTypeTuner MXReplicaType = "Tuner" )
type RestartPolicy ¶
type RestartPolicy string
RestartPolicy describes how the MXReplicas should be restarted. Only one of the following restart policies may be specified. If none of the following policies is specified, the default one is RestartPolicyAlways.
const ( RestartPolicyAlways RestartPolicy = "Always" RestartPolicyOnFailure RestartPolicy = "OnFailure" RestartPolicyNever RestartPolicy = "Never" // `ExitCode` policy means that user should add exit code by themselves, // `mxnet-operator` will check these exit codes to // determine the behavior when an error occurs: // - 1-127: permanent error, do not restart. // - 128-255: retryable error, will restart the pod. RestartPolicyExitCode RestartPolicy = "ExitCode" )
type SuccessPolicy ¶ added in v1.1.0
type SuccessPolicy string
SuccessPolicy will determine the success of the job
const ( SuccessPolicyDefault SuccessPolicy = "" SuccessPolicyAllWorkers SuccessPolicy = "AllWorkers" )