xgboostjob

package
v0.2.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: 40 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FailedDeleteJobReason     = "FailedDeleteJob"
	SuccessfulDeleteJobReason = "SuccessfulDeleteJob"
)

Reasons for job events.

View Source
const RecommendedKubeConfigPathEnv = "KUBECONFIG"

Variables

This section is empty.

Functions

func Add

func Add(mgr manager.Manager) error

Add creates a new XGBoostJob Controller and adds it to the Manager with default RBAC. The Manager will set fields on the Controller and Start it when the Manager is Started.

func GetPortFromXGBoostJob

func GetPortFromXGBoostJob(job *v1xgboost.XGBoostJob, rtype v1xgboost.XGBoostJobReplicaType) (int32, error)

GetPortFromXGBoostJob gets the port of xgboost container.

func SetPodEnv

func SetPodEnv(job interface{}, podTemplate *corev1.PodTemplateSpec, rtype, index string) error

SetPodEnv sets the pod env set for: - XGBoost Rabit Tracker and worker - LightGBM master and workers

Types

type FakeWorkQueue

type FakeWorkQueue struct{}

FakeWorkQueue implements RateLimitingInterface but actually does nothing.

func (*FakeWorkQueue) Add

func (f *FakeWorkQueue) Add(item interface{})

Add WorkQueue Add method

func (*FakeWorkQueue) AddAfter

func (f *FakeWorkQueue) AddAfter(item interface{}, duration time.Duration)

AddAfter WorkQueue AddAfter method

func (*FakeWorkQueue) AddRateLimited

func (f *FakeWorkQueue) AddRateLimited(item interface{})

AddRateLimited WorkQueue AddRateLimited method

func (*FakeWorkQueue) Done

func (f *FakeWorkQueue) Done(item interface{})

Done WorkQueue Done method

func (*FakeWorkQueue) Forget

func (f *FakeWorkQueue) Forget(item interface{})

Forget WorkQueue Forget method

func (*FakeWorkQueue) Get

func (f *FakeWorkQueue) Get() (item interface{}, shutdown bool)

Get WorkQueue Get method

func (*FakeWorkQueue) Len

func (f *FakeWorkQueue) Len() int

Len WorkQueue Len method

func (*FakeWorkQueue) NumRequeues

func (f *FakeWorkQueue) NumRequeues(item interface{}) int

NumRequeues WorkQueue NumRequeues method

func (*FakeWorkQueue) ShutDown

func (f *FakeWorkQueue) ShutDown()

ShutDown WorkQueue ShutDown method

func (*FakeWorkQueue) ShuttingDown

func (f *FakeWorkQueue) ShuttingDown() bool

ShuttingDown WorkQueue ShuttingDown method

type ReconcileXGBoostJob

type ReconcileXGBoostJob struct {
	common.JobController
	client.Client
	// contains filtered or unexported fields
}

ReconcileXGBoostJob reconciles a XGBoostJob object

func (*ReconcileXGBoostJob) ControllerName

func (r *ReconcileXGBoostJob) ControllerName() string

func (*ReconcileXGBoostJob) DeleteJob

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

DeleteJob deletes the job

func (*ReconcileXGBoostJob) GetAPIGroupVersion

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

func (*ReconcileXGBoostJob) GetAPIGroupVersionKind

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

func (*ReconcileXGBoostJob) GetDefaultContainerName

func (r *ReconcileXGBoostJob) GetDefaultContainerName() string

func (*ReconcileXGBoostJob) GetDefaultContainerPortName

func (r *ReconcileXGBoostJob) GetDefaultContainerPortName() string

func (*ReconcileXGBoostJob) GetGroupNameLabelValue

func (r *ReconcileXGBoostJob) GetGroupNameLabelValue() string

func (*ReconcileXGBoostJob) GetJobFromAPIClient

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

GetJobFromAPIClient returns the Job from API server

func (*ReconcileXGBoostJob) GetJobFromInformerCache

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

GetJobFromInformerCache returns the Job from Informer Cache

func (*ReconcileXGBoostJob) GetJobRoleKey

func (r *ReconcileXGBoostJob) GetJobRoleKey() string

func (*ReconcileXGBoostJob) GetPodsForJob

func (r *ReconcileXGBoostJob) 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 (*ReconcileXGBoostJob) GetServicesForJob

func (r *ReconcileXGBoostJob) 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 (*ReconcileXGBoostJob) IsMasterRole

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

func (*ReconcileXGBoostJob) Reconcile

func (r *ReconcileXGBoostJob) Reconcile(request reconcile.Request) (reconcile.Result, error)

Reconcile reads that state of the cluster for a XGBoostJob object and makes changes based on the state read and what is in the XGBoostJob.Spec a Deployment as an example Automatically generate RBAC rules to allow the Controller to read and write Deployments +kubebuilder:rbac:groups=apps,resources=deployments,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=apps,resources=deployments/status,verbs=get;update;patch +kubebuilder:rbac:groups=xgboostjob.kubeflow.org,resources=xgboostjobs,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=xgboostjob.kubeflow.org,resources=xgboostjobs/status,verbs=get;update;patch

func (*ReconcileXGBoostJob) SetClusterSpec

func (r *ReconcileXGBoostJob) SetClusterSpec(job interface{}, podTemplate *corev1.PodTemplateSpec, rtype, index string) error

SetClusterSpec sets the cluster spec for the pod

func (*ReconcileXGBoostJob) UpdateJobStatus

func (r *ReconcileXGBoostJob) UpdateJobStatus(job interface{}, replicas map[commonv1.ReplicaType]*commonv1.ReplicaSpec, jobStatus *commonv1.JobStatus) error

UpdateJobStatus updates the job status and job conditions

func (*ReconcileXGBoostJob) UpdateJobStatusInApiServer

func (r *ReconcileXGBoostJob) UpdateJobStatusInApiServer(job interface{}, jobStatus *commonv1.JobStatus) error

UpdateJobStatusInApiServer updates the job status in to cluster.

Jump to

Keyboard shortcuts

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