Documentation ¶
Index ¶
- Constants
- Variables
- type DefaultJobParser
- func (p *DefaultJobParser) GetExtraEnv(job *paddlev1.TrainingJob, kube kubernetes.Interface) ([]corev1.EnvVar, error)
- func (p *DefaultJobParser) NewTrainingJob(job *paddlev1.TrainingJob) (*paddlev1.TrainingJob, error)
- func (p *DefaultJobParser) ParseToTrainingJob(job *paddlev1.TrainingJob, extraEnv []corev1.EnvVar) *paddlev1.TrainingJob
- func (p *DefaultJobParser) Validate(job *paddlev1.TrainingJob) error
- type JobUpdater
- func (j *JobUpdater) Delete() error
- func (j *JobUpdater) FullName() string
- func (j *JobUpdater) GetJob() *paddlev1.TrainingJob
- func (j *JobUpdater) GetStatus() (paddlev1.TrainingJobPhase, string, error)
- func (j *JobUpdater) IsReleased() bool
- func (j *JobUpdater) Reconcile() error
- func (j *JobUpdater) SetReleased(release bool)
- func (j *JobUpdater) UID() types.UID
- func (j *JobUpdater) Update(job *paddlev1.TrainingJob)
- type Labels
- type PodType
Constants ¶
View Source
const ( PSERVER PodType = "pserver" TRAINER PodType = "trainer" MASTER PodType = "master" TrainerLabel = "paddle-job" PserverLabel = "paddle-job-pserver" MasterLabel = "paddle-job-master" )
Variables ¶
View Source
var ( // ErrorUnkownResourceType not supported resource ErrorUnkownResourceType = errors.New("UnknownResourceType") )
Functions ¶
This section is empty.
Types ¶
type DefaultJobParser ¶
type DefaultJobParser struct { }
DefaultJobParser implement a basic JobParser.
func (*DefaultJobParser) GetExtraEnv ¶
func (p *DefaultJobParser) GetExtraEnv(job *paddlev1.TrainingJob, kube kubernetes.Interface) ([]corev1.EnvVar, error)
func (*DefaultJobParser) NewTrainingJob ¶
func (p *DefaultJobParser) NewTrainingJob(job *paddlev1.TrainingJob) (*paddlev1.TrainingJob, error)
NewTrainingJob generates a whole structure of TrainingJob
func (*DefaultJobParser) ParseToTrainingJob ¶
func (p *DefaultJobParser) ParseToTrainingJob(job *paddlev1.TrainingJob, extraEnv []corev1.EnvVar) *paddlev1.TrainingJob
func (*DefaultJobParser) Validate ¶
func (p *DefaultJobParser) Validate(job *paddlev1.TrainingJob) error
Validate updates default values for the added job and validates the fields.
type JobUpdater ¶
type JobUpdater struct { Job *paddlev1.TrainingJob Additional int32 // contains filtered or unexported fields }
JobUpdater controls the life circle of one TrainingJob instance
func NewJobUpdater ¶
func NewJobUpdater(job *paddlev1.TrainingJob, kubeCli kubernetes.Interface, jobCli trainingJobClient.Interface, auto bool, restartLimit int, outter bool) *JobUpdater
NewJobUpdater returns JobUpdater instance
func (*JobUpdater) FullName ¶
func (j *JobUpdater) FullName() string
FullName returns job's namespace and name
func (*JobUpdater) GetJob ¶
func (j *JobUpdater) GetJob() *paddlev1.TrainingJob
GetJob returns trainingjob instance
func (*JobUpdater) GetStatus ¶
func (j *JobUpdater) GetStatus() (paddlev1.TrainingJobPhase, string, error)
GetStatus get current status phase and reasion of job
func (*JobUpdater) IsReleased ¶
func (j *JobUpdater) IsReleased() bool
IsReleased returns if tj has released resource
func (*JobUpdater) Reconcile ¶
func (j *JobUpdater) Reconcile() error
Reconcile tries to get the job into the desired state
func (*JobUpdater) SetReleased ¶
func (j *JobUpdater) SetReleased(release bool)
SetReleased set resource of job released
func (*JobUpdater) Update ¶
func (j *JobUpdater) Update(job *paddlev1.TrainingJob)
Update updates jobupdater's job instance
Click to show internal directories.
Click to hide internal directories.