jobservice

package
v0.0.0-...-3511abf Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetDefaultService

func SetDefaultService(rm rm.ResourceManager)

SetDefaultService sets the package-level Default in this package and `jobmanager`.

Types

type Job

type Job interface {
	ToV1Job() (*jobv1.Job, error)
	SetJobPriority(priority int) error
	SetWeight(weight float64) error
	SetResourcePool(resourcePool string) error
}

Job is the interface for commands/experiments types that implement the job service.

type Service

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

Service manages the job service.

var DefaultService *Service

DefaultService is the global singleton job service.

func (*Service) GetJobSummary

func (s *Service) GetJobSummary(id model.JobID, resourcePool string) (*jobv1.JobSummary, error)

GetJobSummary returns a summary of the job given an id and resource pool.

func (*Service) GetJobs

func (s *Service) GetJobs(
	resourcePool string,
	desc bool,
	states []jobv1.State,
) ([]*jobv1.Job, error)

GetJobs returns a list of jobs for a resource pool.

func (*Service) RegisterJob

func (s *Service) RegisterJob(jobID model.JobID, j Job)

RegisterJob takes an experiment/command (of interface type Service) and registers it with the job manager's jobByID map.

func (*Service) UnregisterJob

func (s *Service) UnregisterJob(jobID model.JobID)

UnregisterJob deletes a job from the jobByID map.

func (*Service) UpdateJobQueue

func (s *Service) UpdateJobQueue(updates []*jobv1.QueueControl) error

UpdateJobQueue sends queue control updates to specific jobs.

Jump to

Keyboard shortcuts

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