job

package
v0.42.1 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrInvalidJobKind           = "job.invalid_kind"
	ErrJobNotFound              = "job.not_found"
	ErrJobIsNotInProgress       = "job.job_is_not_in_progress"
	ErrJobHasAlreadyBeenStopped = "job.job_has_already_been_stopped"
	ErrConflictingFields        = "job.conflicting_fields"
	ErrSpecifyExactlyOneKey     = "job.specify_exactly_one_key"
)

Variables

This section is empty.

Functions

func DeleteAllInProgressFilesByAPI

func DeleteAllInProgressFilesByAPI(kind userconfig.Kind, apiName string) error

func DeleteInProgressFile

func DeleteInProgressFile(jobKey spec.JobKey) error

func ErrorConflictingFields

func ErrorConflictingFields(key string, keys ...string) error

func ErrorInvalidJobKind

func ErrorInvalidJobKind(kind userconfig.Kind) error

func ErrorJobHasAlreadyBeenStopped

func ErrorJobHasAlreadyBeenStopped(kind userconfig.Kind) error

func ErrorJobIsNotInProgress

func ErrorJobIsNotInProgress(kind userconfig.Kind) error

func ErrorJobNotFound

func ErrorJobNotFound(jobKey spec.JobKey) error

func ErrorSpecifyExactlyOneKey

func ErrorSpecifyExactlyOneKey(key string, keys ...string) error

func GetBatchStatusCode added in v0.35.0

func GetBatchStatusCode(lastUpdatedMap map[string]time.Time) status.JobCode

func GetTaskStatusCode added in v0.35.0

func GetTaskStatusCode(lastUpdatedMap map[string]time.Time) status.JobCode

Doesn't assume only status files are present. The order below matters.

func GetWorkerCountsForJob

func GetWorkerCountsForJob(k8sJob kbatch.Job, pods []kcore.Pod) status.WorkerCounts

func ListAllInProgressJobKeys

func ListAllInProgressJobKeys(kind userconfig.Kind) ([]spec.JobKey, error)

func ListAllInProgressJobKeysByAPI

func ListAllInProgressJobKeysByAPI(kind userconfig.Kind, apiName string) ([]spec.JobKey, error)

func LivenessFile

func LivenessFile() string

func SetCompletedWithFailuresStatus

func SetCompletedWithFailuresStatus(jobKey spec.JobKey) error

func SetEnqueueFailedStatus

func SetEnqueueFailedStatus(jobKey spec.JobKey) error

func SetEnqueuingStatus

func SetEnqueuingStatus(jobKey spec.JobKey) error

func SetFailedStatus

func SetFailedStatus(jobKey spec.JobKey) error

func SetRunningStatus

func SetRunningStatus(jobKey spec.JobKey) error

func SetStatusForJob

func SetStatusForJob(jobKey spec.JobKey, jobStatus status.JobCode) error

func SetStoppedStatus

func SetStoppedStatus(jobKey spec.JobKey) error

func SetSucceededStatus

func SetSucceededStatus(jobKey spec.JobKey) error

func SetTimedOutStatus

func SetTimedOutStatus(jobKey spec.JobKey) error

func SetUnexpectedErrorStatus

func SetUnexpectedErrorStatus(jobKey spec.JobKey) error

func SetWorkerErrorStatus

func SetWorkerErrorStatus(jobKey spec.JobKey) error

func SetWorkerOOMStatus

func SetWorkerOOMStatus(jobKey spec.JobKey) error

func UpdateLiveness

func UpdateLiveness(jobKey spec.JobKey) error

Types

type State

type State struct {
	spec.JobKey
	Status         status.JobCode
	LastUpdatedMap map[string]time.Time
	EndTime        *time.Time
}

func GetJobState

func GetJobState(jobKey spec.JobKey) (*State, error)

func GetMostRecentlySubmittedJobStates

func GetMostRecentlySubmittedJobStates(apiName string, count int, kind userconfig.Kind) ([]*State, error)

func (State) GetFirstCreated

func (j State) GetFirstCreated() time.Time

func (State) GetLastUpdated

func (j State) GetLastUpdated() time.Time

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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