pytorch

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2021 License: Apache-2.0 Imports: 42 Imported by: 0

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

Constants

This section is empty.

Variables

View Source
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 InitContainerParam struct {
	MasterAddr         string
	InitContainerImage string
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL