Documentation
¶
Overview ¶
Package v1alpha1 is the v1alpha1 version of the API. +groupName=kubeflow.org
Index ¶
- Constants
- Variables
- func RegisterDefaults(scheme *runtime.Scheme) error
- func Resource(resource string) schema.GroupResource
- func SetDefaults_PyTorchJob(obj *PyTorchJob)
- func SetObjectDefaults_PyTorchJob(in *PyTorchJob)
- func SetObjectDefaults_PyTorchJobList(in *PyTorchJobList)
- type AcceleratorConfig
- type AcceleratorVolume
- type ControllerConfig
- type EnvironmentVariableConfig
- type MasterSpec
- type PyTorchJob
- type PyTorchJobList
- type PyTorchJobPhase
- type PyTorchJobSpec
- type PyTorchJobStatus
- type PyTorchReplicaSpec
- type PyTorchReplicaStatus
- type PyTorchReplicaType
- type ReplicaState
- type State
- type TerminationPolicySpec
Constants ¶
const ( // GroupName is the group name use in this package. GroupName = "kubeflow.org" // ResourceKind is the kind name. ResourceKind = "PyTorchJob" // GroupVersion is the version. GroupVersion = "v1alpha1" )
const ( CRDKind = "pytorchjob" CRDKindPlural = "pytorchjobs" CRDGroup = "kubeflow.org" CRDVersion = "v1alpha1" // Value of the APP label that gets applied to a lot of entities. AppLabel = "pytorch-job" // Defaults for the Spec MasterPort = 23456 Replicas = 1 )
const ( DefaultPyTorchContainer string = "pytorch" DefaultPyTorchImage string = "pytorch/pytorch:v0.2" )
Variables ¶
var ( SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) AddToScheme = SchemeBuilder.AddToScheme )
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: CRDVersion}
SchemeGroupVersion is the group version used to register these objects.
Functions ¶
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_PyTorchJob ¶
func SetDefaults_PyTorchJob(obj *PyTorchJob)
SetDefaults_PyTorchJob sets any unspecified values to defaults
func SetObjectDefaults_PyTorchJob ¶
func SetObjectDefaults_PyTorchJob(in *PyTorchJob)
func SetObjectDefaults_PyTorchJobList ¶
func SetObjectDefaults_PyTorchJobList(in *PyTorchJobList)
Types ¶
type AcceleratorConfig ¶
type AcceleratorConfig struct { Volumes []AcceleratorVolume EnvVars []EnvironmentVariableConfig }
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 ¶
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 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 }
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 ¶
func (*EnvironmentVariableConfig) DeepCopy ¶
func (in *EnvironmentVariableConfig) DeepCopy() *EnvironmentVariableConfig
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvironmentVariableConfig.
func (*EnvironmentVariableConfig) DeepCopyInto ¶
func (in *EnvironmentVariableConfig) DeepCopyInto(out *EnvironmentVariableConfig)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type MasterSpec ¶
type MasterSpec struct { ReplicaName string `json:"replicaName"` ReplicaRank int `json:"replicaRank"` }
func (*MasterSpec) DeepCopy ¶
func (in *MasterSpec) DeepCopy() *MasterSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MasterSpec.
func (*MasterSpec) DeepCopyInto ¶
func (in *MasterSpec) DeepCopyInto(out *MasterSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PyTorchJob ¶
type PyTorchJob struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec PyTorchJobSpec `json:"spec"` Status PyTorchJobStatus `json:"status"` }
PyTorchJob describes pytorchjob info
func (*PyTorchJob) DeepCopy ¶
func (in *PyTorchJob) DeepCopy() *PyTorchJob
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PyTorchJob.
func (*PyTorchJob) DeepCopyInto ¶
func (in *PyTorchJob) DeepCopyInto(out *PyTorchJob)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*PyTorchJob) DeepCopyObject ¶
func (in *PyTorchJob) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type PyTorchJobList ¶
type PyTorchJobList 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 PyTorchJobs Items []PyTorchJob `json:"items"` }
PyTorchJobList is a list of PyTorchJobs clusters.
func (*PyTorchJobList) DeepCopy ¶
func (in *PyTorchJobList) DeepCopy() *PyTorchJobList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PyTorchJobList.
func (*PyTorchJobList) DeepCopyInto ¶
func (in *PyTorchJobList) DeepCopyInto(out *PyTorchJobList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*PyTorchJobList) DeepCopyObject ¶
func (in *PyTorchJobList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type PyTorchJobPhase ¶
type PyTorchJobPhase string
const ( PyTorchJobPhaseNone PyTorchJobPhase = "" PyTorchJobPhaseCreating PyTorchJobPhase = "Creating" PyTorchJobPhaseRunning PyTorchJobPhase = "Running" PyTorchJobPhaseCleanUp PyTorchJobPhase = "CleanUp" PyTorchJobPhaseFailed PyTorchJobPhase = "Failed" PyTorchJobPhaseDone PyTorchJobPhase = "Done" )
type PyTorchJobSpec ¶
type PyTorchJobSpec 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 PyTorch replicas to run. ReplicaSpecs []*PyTorchReplicaSpec `json:"replicaSpecs"` // PyTorchImage defines the tensorflow docker image that should be used for default parameter server PyTorchImage string `json:"pytorchImage,omitempty"` // TerminationPolicy specifies the condition that the pytorchjob should be considered finished. TerminationPolicy *TerminationPolicySpec `json:"terminationPolicy,omitempty"` // SchedulerName specifies the name of scheduler which should handle the PyTorchJob SchedulerName string `json:"schedulerName,omitempty"` }
func (*PyTorchJobSpec) DeepCopy ¶
func (in *PyTorchJobSpec) DeepCopy() *PyTorchJobSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PyTorchJobSpec.
func (*PyTorchJobSpec) DeepCopyInto ¶
func (in *PyTorchJobSpec) DeepCopyInto(out *PyTorchJobSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PyTorchJobStatus ¶
type PyTorchJobStatus struct { // Phase is the PyTorchJob running phase Phase PyTorchJobPhase `json:"phase"` Reason string `json:"reason"` // State indicates the state of the job. State State `json:"state"` // ReplicaStatuses specifies the status of each PyTorch replica. ReplicaStatuses []*PyTorchReplicaStatus `json:"replicaStatuses"` }
func (*PyTorchJobStatus) DeepCopy ¶
func (in *PyTorchJobStatus) DeepCopy() *PyTorchJobStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PyTorchJobStatus.
func (*PyTorchJobStatus) DeepCopyInto ¶
func (in *PyTorchJobStatus) DeepCopyInto(out *PyTorchJobStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PyTorchReplicaSpec ¶
type PyTorchReplicaSpec 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"` // MasterPort is the port to use for PyTorch services. MasterPort *int32 `json:"masterPort,omitempty" protobuf:"varint,1,opt,name=masterPort"` PyTorchReplicaType `json:"replicaType"` }
TODO(jlewi): We probably want to add a name field. This would allow us to have more than 1 type of each worker. This might be useful if you wanted to have a separate set of workers to do eval.
func (*PyTorchReplicaSpec) DeepCopy ¶
func (in *PyTorchReplicaSpec) DeepCopy() *PyTorchReplicaSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PyTorchReplicaSpec.
func (*PyTorchReplicaSpec) DeepCopyInto ¶
func (in *PyTorchReplicaSpec) DeepCopyInto(out *PyTorchReplicaSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PyTorchReplicaStatus ¶
type PyTorchReplicaStatus struct { PyTorchReplicaType `json:"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 }
func (*PyTorchReplicaStatus) DeepCopy ¶
func (in *PyTorchReplicaStatus) DeepCopy() *PyTorchReplicaStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PyTorchReplicaStatus.
func (*PyTorchReplicaStatus) DeepCopyInto ¶
func (in *PyTorchReplicaStatus) DeepCopyInto(out *PyTorchReplicaStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PyTorchReplicaType ¶
type PyTorchReplicaType string
PyTorchReplicaType determines how a set of PyTorch processes are handled.
const ( MASTER PyTorchReplicaType = "MASTER" WORKER PyTorchReplicaType = "WORKER" )
type ReplicaState ¶
type ReplicaState string
const ( ReplicaStateUnknown ReplicaState = "Unknown" ReplicaStateRunning ReplicaState = "Running" ReplicaStateFailed ReplicaState = "Failed" ReplicaStateSucceeded ReplicaState = "Succeeded" )
type TerminationPolicySpec ¶
type TerminationPolicySpec struct { // Master policy waits for a particular process (which is the master) to exit. Master *MasterSpec `json:"master,omitempty"` }
func (*TerminationPolicySpec) DeepCopy ¶
func (in *TerminationPolicySpec) DeepCopy() *TerminationPolicySpec
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.