v1beta2

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2024 License: Apache-2.0 Imports: 6 Imported by: 10

Documentation

Overview

Package v1beta2 is the v1beta2 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 = common.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 = "v1beta2"
	// Plural is the Plural for TFJob.
	Plural = "tfjobs"
	// Singular is the singular for TFJob.
	Singular = "tfjob"
	// TFCRD is the CRD name for TFJob.
	TFCRD = "tfjobs.kubeflow.org"
)

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 IsChieforMaster

func IsChieforMaster(typ TFReplicaType) bool

IsChieforMaster returns true if the type is Master or Chief.

func IsEvaluator

func IsEvaluator(typ TFReplicaType) bool

IsEvaluator returns true if the type is Evaluator.

func IsWorker

func IsWorker(typ TFReplicaType) bool

IsWorker returns true if the type is Worker.

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 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 common.JobStatus `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 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 {
	// Specifies the duration in seconds relative to the startTime that the job may be active
	// before the system tries to terminate it; value must be positive integer.
	// This method applies only to pods with restartPolicy == OnFailure or Always.
	// +optional
	ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty"`

	// Optional number of retries before marking this job failed.
	// +optional
	BackoffLimit *int32 `json:"backoffLimit,omitempty"`

	// CleanPodPolicy defines the policy to kill pods after TFJob is
	// succeeded.
	// Default to Running.
	CleanPodPolicy *common.CleanPodPolicy `json:"cleanPodPolicy,omitempty"`

	// TTLSecondsAfterFinished is the TTL to clean up tf-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"`

	// TFReplicaSpecs is map of TFReplicaType and ReplicaSpec
	// specifies the TF replicas to run.
	// For example,
	//   {
	//     "PS": ReplicaSpec,
	//     "Worker": ReplicaSpec,
	//   }
	TFReplicaSpecs map[TFReplicaType]*common.ReplicaSpec `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 TFReplicaType

type TFReplicaType common.ReplicaType

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"

	// TFReplicaTypeMaster is the type for master worker of distributed TensorFlow.
	// This is similar to chief, and kept just for backwards compatibility.
	TFReplicaTypeMaster TFReplicaType = "Master"

	// 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