Documentation ¶
Overview ¶
Package controller provides a Kubernetes controller for a PyTorchJob resource.
Package controller provides a Kubernetes controller for a PyTorchJob resource.
Package controller provides a Kubernetes controller for a PyTorchJob resource.
Package controller provides a Kubernetes controller for a PyTorchJob resource.
Index ¶
- Variables
- func AddInitContainerForWorkerPod(podTemplate *v1.PodTemplateSpec, param InitContainerParam) error
- func ContainMasterSpec(job *pyv1.PyTorchJob) bool
- func GetInitContainer(containerTemplate string, param InitContainerParam) ([]v1.Container, error)
- func GetPortFromPyTorchJob(job *pyv1.PyTorchJob, rtype pyv1.PyTorchReplicaType) (int32, error)
- func NewUnstructuredPyTorchJobInformer(restConfig *restclientset.Config, namespace string) jobinformersv1.PyTorchJobInformer
- type InitContainerParam
- type PyTorchController
- func (pc *PyTorchController) ControllerName() string
- func (pc *PyTorchController) GetAPIGroupVersion() schema.GroupVersion
- func (pc *PyTorchController) GetAPIGroupVersionKind() schema.GroupVersionKind
- func (pc *PyTorchController) GetGroupNameLabelKey() string
- func (pc *PyTorchController) GetGroupNameLabelValue() string
- func (pc *PyTorchController) GetJobFromAPIClient(namespace, name string) (metav1.Object, error)
- func (pc *PyTorchController) GetJobFromInformerCache(namespace, name string) (metav1.Object, error)
- func (pc *PyTorchController) GetJobNameLabelKey() string
- func (pc *PyTorchController) GetReplicaIndexLabelKey() string
- func (pc *PyTorchController) GetReplicaTypeLabelKey() string
- func (pc *PyTorchController) NewPyTorchJobInformer(jobInformerFactory jobinformers.SharedInformerFactory) jobinformersv1.PyTorchJobInformer
- func (pc *PyTorchController) Run(threadiness int, stopCh <-chan struct{}) error
Constants ¶
This section is empty.
Variables ¶
var ( // KeyFunc is the short name to DeletionHandlingMetaNamespaceKeyFunc. // IndexerInformer uses a delta queue, therefore for deletes we have to use this // key function but it should be just fine for non delete events. KeyFunc = cache.DeletionHandlingMetaNamespaceKeyFunc )
Functions ¶
func AddInitContainerForWorkerPod ¶ added in v0.7.0
func AddInitContainerForWorkerPod(podTemplate *v1.PodTemplateSpec, param InitContainerParam) error
func ContainMasterSpec ¶
func ContainMasterSpec(job *pyv1.PyTorchJob) bool
func GetInitContainer ¶ added in v0.7.0
func GetInitContainer(containerTemplate string, param InitContainerParam) ([]v1.Container, error)
func GetPortFromPyTorchJob ¶
func GetPortFromPyTorchJob(job *pyv1.PyTorchJob, rtype pyv1.PyTorchReplicaType) (int32, error)
GetPortFromPyTorchJob gets the port of pytorch container.
func NewUnstructuredPyTorchJobInformer ¶
func NewUnstructuredPyTorchJobInformer(restConfig *restclientset.Config, namespace string) jobinformersv1.PyTorchJobInformer
Types ¶
type InitContainerParam ¶ added in v0.7.0
type PyTorchController ¶
type PyTorchController struct { jobcontroller.JobController // contains filtered or unexported fields }
PyTorchController is the type for PyTorchJob Controller, which manages the lifecycle of PyTorchJobs.
func NewPyTorchController ¶
func NewPyTorchController( jobInformer jobinformersv1.PyTorchJobInformer, kubeClientSet kubeclientset.Interface, kubeBatchClientSet kubebatchclient.Interface, jobClientSet jobclientset.Interface, kubeInformerFactory kubeinformers.SharedInformerFactory, jobInformerFactory jobinformers.SharedInformerFactory, option options.ServerOption) *PyTorchController
NewPyTorchController returns a new PyTorchJob controller.
func (*PyTorchController) ControllerName ¶
func (pc *PyTorchController) ControllerName() string
func (*PyTorchController) GetAPIGroupVersion ¶
func (pc *PyTorchController) GetAPIGroupVersion() schema.GroupVersion
func (*PyTorchController) GetAPIGroupVersionKind ¶
func (pc *PyTorchController) GetAPIGroupVersionKind() schema.GroupVersionKind
func (*PyTorchController) GetGroupNameLabelKey ¶
func (pc *PyTorchController) GetGroupNameLabelKey() string
func (*PyTorchController) GetGroupNameLabelValue ¶
func (pc *PyTorchController) GetGroupNameLabelValue() string
func (*PyTorchController) GetJobFromAPIClient ¶
func (pc *PyTorchController) GetJobFromAPIClient(namespace, name string) (metav1.Object, error)
func (*PyTorchController) GetJobFromInformerCache ¶
func (pc *PyTorchController) GetJobFromInformerCache(namespace, name string) (metav1.Object, error)
func (*PyTorchController) GetJobNameLabelKey ¶
func (pc *PyTorchController) GetJobNameLabelKey() string
Deprecated function for backwards compatibility. Has to be removed later
func (*PyTorchController) GetReplicaIndexLabelKey ¶
func (pc *PyTorchController) GetReplicaIndexLabelKey() string
func (*PyTorchController) GetReplicaTypeLabelKey ¶
func (pc *PyTorchController) GetReplicaTypeLabelKey() string
func (*PyTorchController) NewPyTorchJobInformer ¶
func (pc *PyTorchController) NewPyTorchJobInformer(jobInformerFactory jobinformers.SharedInformerFactory) jobinformersv1.PyTorchJobInformer
NewPyTorchJobInformer returns PyTorchJobInformer from the given factory.
func (*PyTorchController) Run ¶
func (pc *PyTorchController) Run(threadiness int, stopCh <-chan struct{}) error
Run will set up the event handlers for types we are interested in, as well as syncing informer caches and starting workers. It will block until stopCh is closed, at which point it will shutdown the workqueue and wait for workers to finish processing their current work items.