xdljob

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2022 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OnOwnerDeleteAndDeletionExpectationFunc added in v0.4.1

func OnOwnerDeleteAndDeletionExpectationFunc(jc job_controller.JobController) func(e event.DeleteEvent) bool

Types

type ClusterSpec

type ClusterSpec map[string][]string

ClusterSpec represents a cluster XDL specification. It is a map from job names to network addresses.

type TaskSpec

type TaskSpec struct {
	Type  string `json:"type"`
	Index int    `json:"index"`
}

TaskSpec is the specification for a task (PS or worker) of the XDLJob.

type XDLConfig

type XDLConfig struct {
	// Cluster represents a XDL ClusterSpec.
	Cluster ClusterSpec `json:"cluster"`
	Task    TaskSpec    `json:"task"`
}

XDLConfig is a struct representing the distributed XDL config. This struct is turned into an environment variable XDL_CONFIG which is used by XDL processes to configure themselves.

type XDLJobReconciler

type XDLJobReconciler struct {
	client.Client

	utilruntime.EmptyScaleImpl
	// contains filtered or unexported fields
}

XDLJobReconciler reconciles a XDLJob object

func NewReconciler

newReconciler returns a new reconcile.Reconciler

func (*XDLJobReconciler) ControllerName

func (r *XDLJobReconciler) ControllerName() string

ControllerName returns the Controller name

func (*XDLJobReconciler) DeleteJob

func (r *XDLJobReconciler) DeleteJob(job interface{}) error

DeleteJob deletes the job

func (*XDLJobReconciler) GetAPIGroupVersion

func (r *XDLJobReconciler) GetAPIGroupVersion() schema.GroupVersion

GetAPIGroupVersion returns the GroupVersion of the API

func (*XDLJobReconciler) GetAPIGroupVersionKind

func (r *XDLJobReconciler) GetAPIGroupVersionKind() schema.GroupVersionKind

GetAPIGroupVersionKind returns the GroupVersionKind of the API

func (*XDLJobReconciler) GetDefaultContainerName

func (r *XDLJobReconciler) GetDefaultContainerName() string

GetDefaultContainerName returns the default container name in pod

func (*XDLJobReconciler) GetDefaultContainerPortName

func (r *XDLJobReconciler) GetDefaultContainerPortName() string

GetDefaultContainerPortName Get the default container port name

func (*XDLJobReconciler) GetDefaultContainerPortNumber

func (r *XDLJobReconciler) GetDefaultContainerPortNumber() int32

GetDefaultContainerPortNumber get the default container port number

func (*XDLJobReconciler) GetGroupNameLabelValue

func (r *XDLJobReconciler) GetGroupNameLabelValue() string

GetGroupNameLabelValue returns the Group Name(value) in the labels of the job

func (*XDLJobReconciler) GetJobFromAPIClient

func (r *XDLJobReconciler) GetJobFromAPIClient(namespace, name string) (metav1.Object, error)

GetJobFromAPIClient returns the Job from API server

func (*XDLJobReconciler) GetJobFromInformerCache

func (r *XDLJobReconciler) GetJobFromInformerCache(namespace, name string) (metav1.Object, error)

GetJobFromInformerCache returns the Job from Informer Cache

func (*XDLJobReconciler) GetNodeForModelOutput added in v0.4.0

func (r *XDLJobReconciler) GetNodeForModelOutput(pods []*corev1.Pod) (nodeName string)

func (*XDLJobReconciler) GetPodsForJob

func (r *XDLJobReconciler) GetPodsForJob(obj interface{}) ([]*corev1.Pod, error)

GetPodsForJob returns the pods managed by the job. This can be achieved by selecting pods using label key "job-name" i.e. all pods created by the job will come with label "job-name" = <this_job_name>

func (*XDLJobReconciler) GetReconcileOrders

func (r *XDLJobReconciler) GetReconcileOrders() []v1.ReplicaType

func (*XDLJobReconciler) GetServicesForJob

func (r *XDLJobReconciler) GetServicesForJob(obj interface{}) ([]*corev1.Service, error)

GetServicesForJob returns the services managed by the job. This can be achieved by selecting services using label key "job-name" i.e. all services created by the job will come with label "job-name" = <this_job_name>

func (*XDLJobReconciler) IsMasterRole

func (r *XDLJobReconciler) IsMasterRole(replicas map[v1.ReplicaType]*v1.ReplicaSpec, rtype v1.ReplicaType, index int) bool

IsMasterRole returns if this replica type with index specified is a master role. MasterRole pod will have "job-role=master" set in its label

func (*XDLJobReconciler) Reconcile

func (r *XDLJobReconciler) Reconcile(_ context.Context, request reconcile.Request) (reconcile.Result, error)

func (*XDLJobReconciler) SetClusterSpec

func (r *XDLJobReconciler) SetClusterSpec(ctx context.Context, job interface{}, podTemplate *corev1.PodTemplateSpec, rtype, index string) error

SetClusterSpec sets the cluster spec for the pod

func (*XDLJobReconciler) SetupWithManager

func (r *XDLJobReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager setup reconciler to the Manager with default RBAC. The Manager will set fields on the Controller and Start it when the Manager is Started.

func (*XDLJobReconciler) UpdateJobStatus

func (r *XDLJobReconciler) UpdateJobStatus(job interface{}, replicas map[v1.ReplicaType]*v1.ReplicaSpec, jobStatus *v1.JobStatus, restart bool) error

UpdateJobStatus updates the job status and job conditions

func (*XDLJobReconciler) UpdateJobStatusInApiServer

func (r *XDLJobReconciler) UpdateJobStatusInApiServer(job interface{}, jobStatus *v1.JobStatus) error

UpdateJobStatusInApiServer updates the job status in API server

Jump to

Keyboard shortcuts

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