v1alpha1

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2020 License: Apache-2.0, Apache-2.0 Imports: 5 Imported by: 2

Documentation

Overview

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

Index

Constants

View Source
const (
	// GroupName is the group name use in this package.
	GroupName = "kubeflow.org"
	// TFJobResourceKind is the kind name.
	TFJobResourceKind = "TFJob"
	// GroupVersion is the version.
	GroupVersion = "v1alpha1"
)
View Source
const (
	CRDKind       = "tfjob"
	CRDKindPlural = "tfjobs"
	CRDGroup      = "kubeflow.org"
	CRDVersion    = "v1alpha1"
	// Value of the APP label that gets applied to a lot of entities.
	AppLabel = "tensorflow-job"
	// Defaults for the Spec
	TFPort   = 2222
	Replicas = 1
)
View Source
const (
	DefaultTFContainer string = "tensorflow"
	DefaultTFImage     string = "tensorflow/tensorflow:1.3.0"
)

Variables

View Source
var (
	// SchemaBuilder is an object of runtime.SchemaBuilder
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
	AddToScheme   = SchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: CRDVersion}

SchemeGroupVersion is the group version used to register these objects.

Functions

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(obj *TFJob)

SetDefaults_TFJob initializes any uninitialized values to default values

func SetObjectDefaults_TFJob

func SetObjectDefaults_TFJob(in *TFJob)

func SetObjectDefaults_TFJobList

func SetObjectDefaults_TFJobList(in *TFJobList)

Types

type AcceleratorConfig

type AcceleratorConfig struct {
	Volumes []AcceleratorVolume
	EnvVars []EnvironmentVariableConfig
}

AcceleratorConfig represents accelerator volumes to be mounted into container along with environment variables.

func (*AcceleratorConfig) DeepCopy

func (in *AcceleratorConfig) DeepCopy() *AcceleratorConfig

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

func (*AcceleratorConfig) DeepCopyInto

func (in *AcceleratorConfig) DeepCopyInto(out *AcceleratorConfig)

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

type AcceleratorVolume

type AcceleratorVolume struct {
	Name      string
	HostPath  string
	MountPath string
}

AcceleratorVolume represents a host path that must be mounted into each container that needs to use GPUs.

func (*AcceleratorVolume) DeepCopy

func (in *AcceleratorVolume) DeepCopy() *AcceleratorVolume

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

func (*AcceleratorVolume) DeepCopyInto

func (in *AcceleratorVolume) DeepCopyInto(out *AcceleratorVolume)

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

type ChiefSpec

type ChiefSpec struct {
	ReplicaName  string `json:"replicaName"`
	ReplicaIndex int    `json:"replicaIndex"`
}

ChiefSpec structure storing the replica name and replica index

func (*ChiefSpec) DeepCopy

func (in *ChiefSpec) DeepCopy() *ChiefSpec

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

func (*ChiefSpec) DeepCopyInto

func (in *ChiefSpec) DeepCopyInto(out *ChiefSpec)

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

type ControllerConfig

type ControllerConfig struct {
	// Accelerators is a map from the name of the accelerator to the config for that accelerator.
	// This should match the value specified as a container limit.
	// e.g. alpha.kubernetes.io/nvidia-gpu
	Accelerators map[string]AcceleratorConfig

	// Path to the file containing the grpc server source
	GrpcServerFilePath string
}

ControllerConfig is a structure for storing the controller configuration

func (*ControllerConfig) DeepCopy

func (in *ControllerConfig) DeepCopy() *ControllerConfig

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

func (*ControllerConfig) DeepCopyInto

func (in *ControllerConfig) DeepCopyInto(out *ControllerConfig)

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

type EnvironmentVariableConfig

type EnvironmentVariableConfig struct {
	Name  string
	Value string
}

EnvironmentVariableConfig represents the environment variables and their values.

func (*EnvironmentVariableConfig) DeepCopy

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

func (*EnvironmentVariableConfig) DeepCopyInto

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

type ReplicaState

type ReplicaState string

ReplicaState is a enum to store the status of replica

const (
	ReplicaStateUnknown   ReplicaState = "Unknown"
	ReplicaStateRunning   ReplicaState = "Running"
	ReplicaStateFailed    ReplicaState = "Failed"
	ReplicaStateSucceeded ReplicaState = "Succeeded"
)

type State

type State string

State is a enum to store the state of tf job

const (
	StateUnknown   State = "Unknown"
	StateRunning   State = "Running"
	StateSucceeded State = "Succeeded"
	StateFailed    State = "Failed"
)

type TFJob

type TFJob struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              TFJobSpec   `json:"spec"`
	Status            TFJobStatus `json:"status"`
}

TFJob describes tfjob info

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
	// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
	metav1.ListMeta `json:"metadata,omitempty"`
	// Items is a list of TFJobs
	Items []TFJob `json:"items"`
}

TFJobList is a list of TFJobs clusters.

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 TFJobPhase

type TFJobPhase string

TFJobPhase is a enum to store the phase of tf job

const (
	TFJobPhaseNone     TFJobPhase = ""
	TFJobPhaseCreating TFJobPhase = "Creating"
	TFJobPhaseRunning  TFJobPhase = "Running"
	TFJobPhaseCleanUp  TFJobPhase = "CleanUp"
	TFJobPhaseFailed   TFJobPhase = "Failed"
	TFJobPhaseDone     TFJobPhase = "Done"
)

type TFJobSpec

type TFJobSpec struct {
	// TODO(jlewi): Can we we get rid of this and use some value from Kubernetes or a random ide.
	RuntimeId string

	// ReplicaSpecs specifies the TF replicas to run.
	ReplicaSpecs []*TFReplicaSpec `json:"replicaSpecs"`

	// TFImage defines the tensorflow docker image that should be used for default parameter server
	TFImage string `json:"tfImage,omitempty"`

	// TerminationPolicy specifies the condition that the tfjob should be considered finished.
	TerminationPolicy *TerminationPolicySpec `json:"terminationPolicy,omitempty"`

	// SchedulerName specifies the name of scheduler which should handle the TFJob
	SchedulerName string `json:"schedulerName,omitempty"`
}

TFJobSpec structure for storing the TFJob specifications

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 {
	// Phase is the TFJob running phase
	Phase  TFJobPhase `json:"phase"`
	Reason string     `json:"reason"`

	// State indicates the state of the job.
	State State `json:"state"`

	// ReplicaStatuses specifies the status of each TF replica.
	ReplicaStatuses []*TFReplicaStatus `json:"replicaStatuses"`
}

TFJobStatus is a structure for storing the status of tf jobs

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 number of desired replicas.
	// This is a pointer to distinguish between explicit zero and unspecified.
	// Defaults to 1.
	// More info: http://kubernetes.io/docs/user-guide/replication-controller#what-is-a-replication-controller
	// +optional
	Replicas *int32              `json:"replicas,omitempty" protobuf:"varint,1,opt,name=replicas"`
	Template *v1.PodTemplateSpec `json:"template,omitempty" protobuf:"bytes,3,opt,name=template"`
	// TFPort is the port to use for TF services.
	TFPort        *int32 `json:"tfPort,omitempty" protobuf:"varint,1,opt,name=tfPort"`
	TFReplicaType `json:"tfReplicaType"`
}

TODO(jlewi): We probably want to add a name field. This would allow us to have more than 1 type of each worker. // TFReplicaSpec might be useful if you wanted to have a separate set of workers to do eval.

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 {
	TFReplicaType `json:"tf_replica_type"`

	// State is the overall state of the replica
	State ReplicaState `json:"state"`

	// ReplicasStates provides the number of replicas in each status.
	ReplicasStates map[ReplicaState]int
}

TFReplicaStatus is a structure for storing the status of tf replica

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 determines how a set of TF processes are handled.

const (
	MASTER TFReplicaType = "MASTER"
	PS     TFReplicaType = "PS"
	WORKER TFReplicaType = "WORKER"
)

type TerminationPolicySpec

type TerminationPolicySpec struct {
	// Chief policy waits for a particular process (which is the chief) to exit.
	Chief *ChiefSpec `json:"chief,omitempty"`
}

TerminationPolicySpec structure for storing specifications for process termination

func (*TerminationPolicySpec) DeepCopy

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

func (*TerminationPolicySpec) DeepCopyInto

func (in *TerminationPolicySpec) DeepCopyInto(out *TerminationPolicySpec)

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