v1

package
v0.0.0-...-1ab8632 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package v1 is the v1 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 = "v1"
	// 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"
)
View Source
const (
	// TFReplicaTypePS is the type for parameter servers of distributed TensorFlow.
	TFReplicaTypePS commonv1.ReplicaType = "PS"

	// TFReplicaTypeWorker is the type for workers of distributed TensorFlow.
	// This is also used for non-distributed TensorFlow.
	TFReplicaTypeWorker commonv1.ReplicaType = "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 commonv1.ReplicaType = "Chief"

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

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

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 commonv1.ReplicaType) bool

IsChieforMaster returns true if the type is Master or Chief.

func IsEvaluator

func IsEvaluator(typ commonv1.ReplicaType) bool

IsEvaluator returns true if the type is Evaluator.

func IsWorker

func IsWorker(typ commonv1.ReplicaType) 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 SuccessPolicy

type SuccessPolicy string

SuccessPolicy is the success policy.

const (
	SuccessPolicyDefault    SuccessPolicy = ""
	SuccessPolicyAllWorkers SuccessPolicy = "AllWorkers"
)

type TFJob

type TFJob struct {
	// Standard Kubernetes type metadata.
	metav1.TypeMeta `json:",inline"`

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

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

	// Most recently observed status of the TFJob.
	// Populated by the system.
	// Read-only.
	// +optional
	Status commonv1.JobStatus `json:"status,omitempty"`
}

TFJob represents a TFJob resource.

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 {
	// Standard type metadata.
	metav1.TypeMeta `json:",inline"`

	// Standard list metadata.
	// +optional
	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 {
	// RunPolicy encapsulates various runtime policies of the distributed training
	// job, for example how to clean up resources and how long the job can stay
	// active.
	RunPolicy commonv1.RunPolicy `json:"runPolicy,inline"`

	// SuccessPolicy defines the policy to mark the TFJob as succeeded.
	// Default to "", using the default rules.
	// +optional
	SuccessPolicy *SuccessPolicy `json:"successPolicy,omitempty"`

	// A map of TFReplicaType (type) to ReplicaSpec (value). Specifies the TF cluster configuration.
	// For example,
	//   {
	//     "PS": ReplicaSpec,
	//     "Worker": ReplicaSpec,
	//   }
	TFReplicaSpecs map[commonv1.ReplicaType]*commonv1.ReplicaSpec `json:"tfReplicaSpecs"`

	// // A switch to enable dynamic worker
	EnableDynamicWorker bool `json:"enableDynamicWorker,omitempty"`
}

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.

Jump to

Keyboard shortcuts

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