Documentation ¶
Overview ¶
Package controller provides a Kubernetes controller for a MXJob resource.
Package controller provides a Kubernetes controller for a MXJob resource.
Package controller provides a Kubernetes controller for a MXJob resource.
Package controller provides a Kubernetes controller for a MXJob resource.
Package controller provides a Kubernetes controller for a MXJob resource.
Index ¶
- Variables
- func ContainSchedulerSpec(mxJob *mxv1beta1.MXJob) bool
- func GetPortFromMXJob(mxJob *mxv1beta1.MXJob, rtype mxv1beta1.MXReplicaType) (int32, error)
- func NewUnstructuredMXJobInformer(restConfig *restclientset.Config, namespace string) mxjobinformersv1beta1.MXJobInformer
- type ClusterSpec
- type LabelsSpec
- type MXConfig
- type MXController
- func (tc *MXController) ControllerName() string
- func (tc *MXController) GetAPIGroupVersion() schema.GroupVersion
- func (tc *MXController) GetAPIGroupVersionKind() schema.GroupVersionKind
- func (tc *MXController) GetGroupNameLabelKey() string
- func (tc *MXController) GetGroupNameLabelValue() string
- func (tc *MXController) GetJobFromAPIClient(namespace, name string) (metav1.Object, error)
- func (tc *MXController) GetJobFromInformerCache(namespace, name string) (metav1.Object, error)
- func (tc *MXController) GetJobNameLabelKey() string
- func (tc *MXController) GetJobRoleKey() string
- func (tc *MXController) GetReplicaIndexLabelKey() string
- func (tc *MXController) GetReplicaTypeLabelKey() string
- func (tc *MXController) NewMXJobInformer(mxJobInformerFactory mxjobinformers.SharedInformerFactory) mxjobinformersv1beta1.MXJobInformer
- func (tc *MXController) Run(threadiness int, stopCh <-chan struct{}) error
- type TaskSpec
- type Url_Port
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 // DefaultMXControllerConfiguration is the suggested mxnet-operator configuration for production. DefaultMXControllerConfiguration = jobcontroller.JobControllerConfiguration{ ReconcilerSyncLoopPeriod: metav1.Duration{Duration: 15 * time.Second}, EnableGangScheduling: false, } )
Functions ¶
func ContainSchedulerSpec ¶
func GetPortFromMXJob ¶
GetPortFromMXJob gets the port of mxnet container.
func NewUnstructuredMXJobInformer ¶
func NewUnstructuredMXJobInformer(restConfig *restclientset.Config, namespace string) mxjobinformersv1beta1.MXJobInformer
Types ¶
type ClusterSpec ¶
ClusterSpec represents a cluster Mxnet specification.
type MXConfig ¶
type MXConfig struct { // Cluster represents a Mxnet ClusterSpec. Cluster ClusterSpec `json:"cluster"` // Labels include all label of task. Labels LabelsSpec `json:"labels"` // Task include information of current node. Task TaskSpec `json:"task"` }
MXConfig is a struct representing the distributed Mxnet config. This struct is turned into an environment variable MX_CONFIG which is used by Mxnet processes to configure themselves.
type MXController ¶
type MXController struct { jobcontroller.JobController // contains filtered or unexported fields }
MXController is the type for MXJob Controller, which manages the lifecycle of MXJobs.
func NewMXController ¶
func NewMXController( mxJobInformer mxjobinformersv1beta1.MXJobInformer, kubeClientSet kubeclientset.Interface, mxJobClientSet mxjobclientset.Interface, kubeBatchClientSet kubebatchclient.Interface, kubeInformerFactory kubeinformers.SharedInformerFactory, mxJobInformerFactory mxjobinformers.SharedInformerFactory, option options.ServerOption) *MXController
NewMXController returns a new MXJob controller.
func (*MXController) ControllerName ¶
func (tc *MXController) ControllerName() string
func (*MXController) GetAPIGroupVersion ¶
func (tc *MXController) GetAPIGroupVersion() schema.GroupVersion
func (*MXController) GetAPIGroupVersionKind ¶
func (tc *MXController) GetAPIGroupVersionKind() schema.GroupVersionKind
func (*MXController) GetGroupNameLabelKey ¶
func (tc *MXController) GetGroupNameLabelKey() string
func (*MXController) GetGroupNameLabelValue ¶
func (tc *MXController) GetGroupNameLabelValue() string
func (*MXController) GetJobFromAPIClient ¶
func (tc *MXController) GetJobFromAPIClient(namespace, name string) (metav1.Object, error)
func (*MXController) GetJobFromInformerCache ¶
func (tc *MXController) GetJobFromInformerCache(namespace, name string) (metav1.Object, error)
func (*MXController) GetJobNameLabelKey ¶
func (tc *MXController) GetJobNameLabelKey() string
func (*MXController) GetJobRoleKey ¶
func (tc *MXController) GetJobRoleKey() string
func (*MXController) GetReplicaIndexLabelKey ¶
func (tc *MXController) GetReplicaIndexLabelKey() string
func (*MXController) GetReplicaTypeLabelKey ¶
func (tc *MXController) GetReplicaTypeLabelKey() string
func (*MXController) NewMXJobInformer ¶
func (tc *MXController) NewMXJobInformer(mxJobInformerFactory mxjobinformers.SharedInformerFactory) mxjobinformersv1beta1.MXJobInformer
NewMXJobInformer returns MXJobInformer from the given factory.
func (*MXController) Run ¶
func (tc *MXController) 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.