Documentation
¶
Overview ¶
Package v1 is the v1 version of the API. +groupName=kubeflow.org
Package v1 contains API Schema definitions for the kubeflow.org v1 API group +kubebuilder:object:generate=true +groupName=kubeflow.org
Index ¶
- Constants
- Variables
- func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition
- func Int32(v int32) *int32
- func IsChieforMaster(typ commonv1.ReplicaType) bool
- func IsEvaluator(typ commonv1.ReplicaType) bool
- func IsWorker(typ commonv1.ReplicaType) bool
- func RegisterDefaults(scheme *runtime.Scheme) error
- func Resource(resource string) schema.GroupResource
- func SetDefaults_TFJob(tfjob *TFJob)
- func SetObjectDefaults_TFJob(in *TFJob)
- func SetObjectDefaults_TFJobList(in *TFJobList)
- type SuccessPolicy
- type TFJob
- type TFJobList
- type TFJobSpec
Constants ¶
const ( // 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 // Kind is the kind name. Kind = "TFJob" // Plural is the Plural for TFJob. Plural = "tfjobs" // Singular is the singular for TFJob. Singular = "tfjob" )
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 ¶
var ( // GroupVersion is group version used to register these objects GroupVersion = schema.GroupVersion{Group: "kubeflow.org", Version: "v1"} // SchemeBuilder is used to add go types to the GroupVersionKind scheme SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} // AddToScheme adds the types in this group-version to the given scheme. AddToScheme = SchemeBuilder.AddToScheme )
var SchemeGroupVersion = GroupVersion
SchemeGroupVersion is group version used to register these objects.
Functions ¶
func GetOpenAPIDefinitions ¶
func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition
func 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 ¶
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 ¶ added in v1.1.0
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"`
// +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 ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TFJob.
func (*TFJob) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*TFJob) DeepCopyObject ¶
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 ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TFJobList.
func (*TFJobList) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*TFJobList) DeepCopyObject ¶
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.
//+kubebuilder:validation:Optional
RunPolicy commonv1.RunPolicy `json:"runPolicy"`
// 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 ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TFJobSpec.
func (*TFJobSpec) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.