Documentation
¶
Overview ¶
Copyright 2018 The Kubeflow Authors
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Package v1alpha2 is the v1alpha2 version of the API. +groupName=kubeflow.org
Index ¶
- Constants
- Variables
- func Int32(v int32) *int32
- func RegisterDefaults(scheme *runtime.Scheme) error
- func Resource(resource string) schema.GroupResource
- func SetDefaults_MPIJob(mpiJob *MPIJob)
- func SetObjectDefaults_MPIJob(in *MPIJob)
- func SetObjectDefaults_MPIJobList(in *MPIJobList)
- type CleanPodPolicy
- type JobCondition
- type JobConditionType
- type JobStatus
- type MPIJob
- type MPIJobList
- type MPIJobSpec
- type MPIReplicaType
- type ReplicaSpec
- type ReplicaStatus
- type ReplicaType
- type RestartPolicy
Constants ¶
const ( // GroupName is the group name use in this package. GroupName = "kubeflow.org" // Kind is the kind name. Kind = "MPIJob" // GroupVersion is the version. GroupVersion = "v1alpha2" )
const (
// EnvKubeflowNamespace is ENV for kubeflow namespace specified by user.
EnvKubeflowNamespace = "KUBEFLOW_NAMESPACE"
)
Variables ¶
var ( SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes, addDefaultingFuncs) AddToScheme = SchemeBuilder.AddToScheme SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: GroupVersion} SchemeGroupVersionKind = schema.GroupVersionKind{Group: GroupName, Version: GroupVersion, Kind: 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 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_MPIJob ¶
func SetDefaults_MPIJob(mpiJob *MPIJob)
func SetObjectDefaults_MPIJob ¶
func SetObjectDefaults_MPIJob(in *MPIJob)
func SetObjectDefaults_MPIJobList ¶
func SetObjectDefaults_MPIJobList(in *MPIJobList)
Types ¶
type CleanPodPolicy ¶
type CleanPodPolicy string
CleanPodPolicy describes how to deal with pods when the job is finished.
const ( CleanPodPolicyUndefined CleanPodPolicy = "" CleanPodPolicyAll CleanPodPolicy = "All" CleanPodPolicyRunning CleanPodPolicy = "Running" CleanPodPolicyNone CleanPodPolicy = "None" )
Possible values for CleanPodPolicy
type JobCondition ¶
type JobCondition struct { // Type of job condition. Type JobConditionType `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"` }
+k8s:deepcopy-gen=true JobCondition describes the state of the job at a certain point.
func (*JobCondition) DeepCopy ¶
func (in *JobCondition) DeepCopy() *JobCondition
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobCondition.
func (*JobCondition) DeepCopyInto ¶
func (in *JobCondition) DeepCopyInto(out *JobCondition)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type JobConditionType ¶
type JobConditionType string
JobConditionType defines all kinds of types of JobStatus.
const ( // JobCreated means the job 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. JobCreated JobConditionType = "Created" // JobRunning means all sub-resources (e.g. services/pods) of this job // have been successfully scheduled and launched. // The training is running without error. JobRunning JobConditionType = "Running" // JobRestarting means one or more sub-resources (e.g. services/pods) of this job // reached phase failed but maybe restarted according to it's restart policy // which specified by user in v1.PodTemplateSpec. // The training is freezing/pending. JobRestarting JobConditionType = "Restarting" // JobSucceeded means all sub-resources (e.g. services/pods) of this job // reached phase have terminated in success. // The training is complete without error. JobSucceeded JobConditionType = "Succeeded" // JobFailed means one or more sub-resources (e.g. services/pods) of this job // reached phase failed with no restarting. // The training has failed its execution. JobFailed JobConditionType = "Failed" )
type JobStatus ¶
type JobStatus struct { // Conditions is an array of current observed job conditions. Conditions []JobCondition `json:"conditions"` // 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"` }
+k8s:deepcopy-gen=true JobStatus represents the current observed state of the training Job.
func (*JobStatus) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobStatus.
func (*JobStatus) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type MPIJob ¶
type MPIJob struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec MPIJobSpec `json:"spec,omitempty"` Status JobStatus `json:"status,omitempty"` }
func (*MPIJob) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MPIJob.
func (*MPIJob) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*MPIJob) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type MPIJobList ¶
type MPIJobList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata"` Items []MPIJob `json:"items"` }
func (*MPIJobList) DeepCopy ¶
func (in *MPIJobList) DeepCopy() *MPIJobList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MPIJobList.
func (*MPIJobList) DeepCopyInto ¶
func (in *MPIJobList) DeepCopyInto(out *MPIJobList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*MPIJobList) DeepCopyObject ¶
func (in *MPIJobList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type MPIJobSpec ¶
type MPIJobSpec struct { // Specifies the number of slots per worker used in hostfile. // Defaults to 1. // +optional SlotsPerWorker *int32 `json:"slotsPerWorker,omitempty"` // TODO: Move this to `RunPolicy` in common operator, see discussion in https://github.com/kubeflow/tf-operator/issues/960 // Specifies the number of retries before marking this job failed. // Defaults to 6. // +optional BackoffLimit *int32 `json:"backoffLimit,omitempty"` // TODO: Move this to `RunPolicy` in common operator, see discussion in https://github.com/kubeflow/tf-operator/issues/960 // Specifies the duration in seconds relative to the start time that // the job may be active before the system tries to terminate it. // Note that this takes precedence over `BackoffLimit` field. // +optional ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty"` // CleanPodPolicy defines the policy that whether to kill pods after the job completes. // Defaults to None. CleanPodPolicy *CleanPodPolicy `json:"cleanPodPolicy,omitempty"` // `MPIReplicaSpecs` contains maps from `MPIReplicaType` to `ReplicaSpec` that // specify the MPI replicas to run. MPIReplicaSpecs map[MPIReplicaType]*ReplicaSpec `json:"mpiReplicaSpecs"` }
func (*MPIJobSpec) DeepCopy ¶
func (in *MPIJobSpec) DeepCopy() *MPIJobSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MPIJobSpec.
func (*MPIJobSpec) DeepCopyInto ¶
func (in *MPIJobSpec) DeepCopyInto(out *MPIJobSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type MPIReplicaType ¶
type MPIReplicaType ReplicaType
MPIReplicaType is the type for MPIReplica.
const ( // MPIReplicaTypeLauncher is the type for launcher replica. MPIReplicaTypeLauncher MPIReplicaType = "Launcher" // MPIReplicaTypeWorker is the type for worker replicas. MPIReplicaTypeWorker MPIReplicaType = "Worker" )
type ReplicaSpec ¶
type ReplicaSpec struct { // Replicas is the desired number of replicas of the given template. // If unspecified, defaults to 1. Replicas *int32 `json:"replicas,omitempty"` // Template is the object that describes the pod that // will be created for this replica. RestartPolicy in PodTemplateSpec // will be overide by RestartPolicy in ReplicaSpec Template v1.PodTemplateSpec `json:"template,omitempty"` // Restart policy for all replicas within the job. // One of Always, OnFailure, Never and ExitCode. // Default to Never. RestartPolicy RestartPolicy `json:"restartPolicy,omitempty"` }
+k8s:deepcopy-gen=true 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. 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"` }
ReplicaStatus represents the current observed state of the 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
ReplicaType represents the type of the replica. Each operator needs to define its own set of ReplicaTypes.
type RestartPolicy ¶
type RestartPolicy string
RestartPolicy describes how the replicas 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" // RestartPolicyExitCode policy means that user should add exit code by themselves, // The job 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" )
Possible values for RestartPolicy