updater

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultJobParser

type DefaultJobParser struct {
}

DefaultJobParser implement a basic JobParser.

func (*DefaultJobParser) NewTrainingJob

func (p *DefaultJobParser) NewTrainingJob(job *paddlev1.TrainingJob) (*paddlev1.TrainingJob, error)

NewTrainingJob generates a whole structure of TrainingJob

type Labels

type Labels map[string]string

Labels represents labels of k8s resources

func (Labels) LabelsParser

func (l Labels) LabelsParser() (string, error)

LabelsParser parse labels to selector

type TrainingJobUpdater

type TrainingJobUpdater struct {
	// contains filtered or unexported fields
}

TrainingJobUpdater is used to manage a specific TrainingJob

func NewUpdater

func NewUpdater(job *padv1.TrainingJob, kubeClient kubernetes.Interface, trainingJobClient trainingJobClient.Interface) (*TrainingJobUpdater,
	error)

NewUpdater creates a new TrainingJobUpdater and start a goroutine to control current job.

func (*TrainingJobUpdater) Convert

func (updater *TrainingJobUpdater) Convert()

Convert is main process to convert TrainingJob to desire status.

func (*TrainingJobUpdater) Delete

func (updater *TrainingJobUpdater) Delete()

Delete send a delete event to updater, updater will kill the trainingjob and clear all the resource of the trainingjob.

func (*TrainingJobUpdater) GetStatus

func (updater *TrainingJobUpdater) GetStatus() (*padv1.TrainingJobStatus, error)

GetStatus get TrainingJob status from trainers.

func (*TrainingJobUpdater) InitResource

func (updater *TrainingJobUpdater) InitResource()

InitResource is used to parse trainingJob and create trainingJob resources.

func (*TrainingJobUpdater) Modify

func (updater *TrainingJobUpdater) Modify(nj *padv1.TrainingJob)

Modify send a modify event to updater. updater will processing according to the situation.

Jump to

Keyboard shortcuts

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