v1alpha2

package
v0.9.8 Latest Latest
Warning

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

Go to latest
Published: May 11, 2023 License: Apache-2.0, Apache-2.0 Imports: 7 Imported by: 2

Documentation

Overview

Package v1alpha2 is the v1alpha2 version of the API. +groupName=kubeflow.org

Index

Constants

View Source
const (
	// EnvKubeflowNamespace is ENV for kubeflow namespace specified by user.
	EnvKubeflowNamespace = "KUBEFLOW_NAMESPACE"

	// DefaultPortName is name of the port used to communicate between PS and
	// workers.
	DefaultPortName = "tfjob-port"
	// DefaultContainerName is the name of the TFJob container.
	DefaultContainerName = "tensorflow"
	// DefaultPort is default value of the port.
	DefaultPort = 2222
	// DefaultRestartPolicy is default RestartPolicy for TFReplicaSpec.
	DefaultRestartPolicy = RestartPolicyNever
)
View Source
const (
	// GroupName is the group name use in this package.
	GroupName = "kubeflow.org"
	// Kind is the kind name.
	Kind = "TFJob"
	// GroupVersion is the version.
	GroupVersion = "v1alpha2"
	// Plural is the Plural for TFJob.
	Plural = "tfjobs"
	// Singular is the singular for TFJob.
	Singular = "tfjob"
)

Variables

View Source
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
)
View Source
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

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 takes an unqualified resource and returns a Group-qualified GroupResource.

func SetDefaults_TFJob

func SetDefaults_TFJob(tfjob *TFJob)

SetDefaults_TFJob sets any unspecified values to defaults.

func SetObjectDefaults_TFJob

func SetObjectDefaults_TFJob(in *TFJob)

func SetObjectDefaults_TFJobList

func SetObjectDefaults_TFJobList(in *TFJobList)

Types

type CleanPodPolicy

type CleanPodPolicy string

CleanPodPolicy describes how to deal with pods when the TFJob is finished.

const (
	CleanPodPolicyUndefined CleanPodPolicy = ""
	CleanPodPolicyAll       CleanPodPolicy = "All"
	CleanPodPolicyRunning   CleanPodPolicy = "Running"
	CleanPodPolicyNone      CleanPodPolicy = "None"
)

type RestartPolicy

type RestartPolicy string

RestartPolicy describes how the TFReplicas 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,
	// `tf-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 TFJob

type TFJob struct {
	metav1.TypeMeta `json:",inline"`

	// Standard object's metadata.
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// Specification of the desired behavior of the TFJob.
	Spec TFJobSpec `json:"spec,omitempty"`

	// Most recently observed status of the TFJob.
	// This data may not be up to date.
	// Populated by the system.
	// Read-only.
	Status TFJobStatus `json:"status,omitempty"`
}

TFJob represents the configuration of signal TFJob

func (*TFJob) DeepCopy

func (in *TFJob) DeepCopy() *TFJob

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

func (*TFJob) DeepCopyInto

func (in *TFJob) DeepCopyInto(out *TFJob)

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

func (*TFJob) DeepCopyObject

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

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

type TFJobCondition

type TFJobCondition struct {
	// Type of TFJob condition.
	Type TFJobConditionType `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"`
}

TFJobCondition describes the state of the TFJob at a certain point.

func (*TFJobCondition) DeepCopy

func (in *TFJobCondition) DeepCopy() *TFJobCondition

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

func (*TFJobCondition) DeepCopyInto

func (in *TFJobCondition) DeepCopyInto(out *TFJobCondition)

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

type TFJobConditionType

type TFJobConditionType string

TFJobConditionType defines all kinds of types of TFJobStatus.

const (
	// TFJobCreated means the tfjob 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.
	TFJobCreated TFJobConditionType = "Created"

	// TFJobRunning means all sub-resources (e.g. services/pods) of this TFJob
	// have been successfully scheduled and launched.
	// The training is running without error.
	TFJobRunning TFJobConditionType = "Running"

	// TFJobRestarting means one or more sub-resources (e.g. services/pods) of this TFJob
	// reached phase failed but maybe restarted according to it's restart policy
	// which specified by user in v1.PodTemplateSpec.
	// The training is freezing/pending.
	TFJobRestarting TFJobConditionType = "Restarting"

	// TFJobSucceeded means all sub-resources (e.g. services/pods) of this TFJob
	// reached phase have terminated in success.
	// The training is complete without error.
	TFJobSucceeded TFJobConditionType = "Succeeded"

	// TFJobFailed means one or more sub-resources (e.g. services/pods) of this TFJob
	// reached phase failed with no restarting.
	// The training has failed its execution.
	TFJobFailed TFJobConditionType = "Failed"
)

type TFJobList

type TFJobList struct {
	metav1.TypeMeta `json:",inline"`

	// Standard list metadata.
	metav1.ListMeta `json:"metadata,omitempty"`

	// List of TFJobs.
	Items []TFJob `json:"items"`
}

TFJobList is a list of TFJobs.

func (*TFJobList) DeepCopy

func (in *TFJobList) DeepCopy() *TFJobList

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

func (*TFJobList) DeepCopyInto

func (in *TFJobList) DeepCopyInto(out *TFJobList)

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

func (*TFJobList) DeepCopyObject

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

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

type TFJobSpec

type TFJobSpec struct {
	// CleanPodPolicy defines the policy to kill pods after TFJob is
	// succeeded.
	// Default to All.
	CleanPodPolicy *CleanPodPolicy `json:"cleanPodPolicy,omitempty"`

	// TFReplicaSpecs is map of TFReplicaType and TFReplicaSpec
	// specifies the TF replicas to run.
	// For example,
	//   {
	//     "PS": TFReplicaSpec,
	//     "Worker": TFReplicaSpec,
	//   }
	TFReplicaSpecs map[TFReplicaType]*TFReplicaSpec `json:"tfReplicaSpecs"`
}

TFJobSpec is a desired state description of the TFJob.

func (*TFJobSpec) DeepCopy

func (in *TFJobSpec) DeepCopy() *TFJobSpec

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

func (*TFJobSpec) DeepCopyInto

func (in *TFJobSpec) DeepCopyInto(out *TFJobSpec)

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

type TFJobStatus

type TFJobStatus struct {
	// Conditions is an array of current observed TFJob conditions.
	Conditions []TFJobCondition `json:"conditions"`

	// TFReplicaStatuses is map of TFReplicaType and TFReplicaStatus,
	// specifies the status of each TFReplica.
	TFReplicaStatuses map[TFReplicaType]*TFReplicaStatus `json:"tfReplicaStatuses"`

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

TFJobStatus represents the current observed state of the TFJob.

func (*TFJobStatus) DeepCopy

func (in *TFJobStatus) DeepCopy() *TFJobStatus

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

func (*TFJobStatus) DeepCopyInto

func (in *TFJobStatus) DeepCopyInto(out *TFJobStatus)

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

type TFReplicaSpec

type TFReplicaSpec 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 TFReplica. RestartPolicy in PodTemplateSpec
	// will be overide by RestartPolicy in TFReplicaSpec
	Template v1.PodTemplateSpec `json:"template,omitempty"`

	// Restart policy for all TFReplicas within the TFJob.
	// One of Always, OnFailure, Never and ExitCode.
	// Default to Never.
	RestartPolicy RestartPolicy `json:"restartPolicy,omitempty"`
}

TFReplicaSpec is a description of the TFReplica

func (*TFReplicaSpec) DeepCopy

func (in *TFReplicaSpec) DeepCopy() *TFReplicaSpec

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

func (*TFReplicaSpec) DeepCopyInto

func (in *TFReplicaSpec) DeepCopyInto(out *TFReplicaSpec)

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

type TFReplicaStatus

type TFReplicaStatus 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"`
}

TFReplicaStatus represents the current observed state of the TFReplica.

func (*TFReplicaStatus) DeepCopy

func (in *TFReplicaStatus) DeepCopy() *TFReplicaStatus

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

func (*TFReplicaStatus) DeepCopyInto

func (in *TFReplicaStatus) DeepCopyInto(out *TFReplicaStatus)

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

type TFReplicaType

type TFReplicaType string

TFReplicaType is the type for TFReplica.

const (
	// TFReplicaTypePS is the type for parameter servers of distributed TensorFlow.
	TFReplicaTypePS TFReplicaType = "PS"

	// TFReplicaTypeWorker is the type for workers of distributed TensorFlow.
	// This is also used for non-distributed TensorFlow.
	TFReplicaTypeWorker TFReplicaType = "Worker"

	// TFReplicaTypeChief is the type for chief worker of distributed TensorFlow.
	// If there is "chief" replica type, it's the "chief worker".
	// Else, worker:0 is the chief worker.
	TFReplicaTypeChief TFReplicaType = "Chief"

	// TFReplicaTypeEval is the type for evaluation replica in TensorFlow.
	TFReplicaTypeEval TFReplicaType = "Evaluator"
)

Jump to

Keyboard shortcuts

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