scheduler

package
v0.0.0-...-afb19b5 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const AnnotationExecutionLocation = "execution_location"

AnnotationExecutionLocation defines the annotation containing the job execution location

View Source
const CreatedByLabelName = "created_by"

CreatedByLabelName defines the label name for jobs created by this api

View Source
const CreatedByLabelValue = "aksscheduler"

CreatedByLabelValue defines the label value for jobs created by this api

Variables

This section is empty.

Functions

This section is empty.

Types

type AddJobRequest

type AddJobRequest struct {
	JobID              string
	JobName            string
	Annotations        map[string]string
	Labels             map[string]string
	ImageName          string
	Image              string
	ImagePullSecrets   string
	ImageOS            string
	Parallelism        int
	Completions        int
	ExecutionLocation  JobExecutionLocation
	Commands           []string
	Memory             string
	CPU                string
	GpuQuantity        int
	GpuType            string
	Env                []apiv1.EnvVar
	ServiceAccountName string
}

AddJobRequest defines properties for new job

func (*AddJobRequest) AddEnv

func (n *AddJobRequest) AddEnv(name, value string) *AddJobRequest

AddEnv adds an environment variable to the job detail

type JobExecutionLocation

type JobExecutionLocation string

JobExecutionLocation defines the locations where a job can be executed

const JobExecutionInACI JobExecutionLocation = "aci"

JobExecutionInACI defines job execution in ACI/Virtual Kubelet

const JobExecutionInAzureBatch JobExecutionLocation = "azurebatch"

JobExecutionInAzureBatch defines executing in Azure Batch

const JobExecutionInCluster JobExecutionLocation = "cluster"

JobExecutionInCluster defines job execution in cluster nodes

type Scheduler

type Scheduler struct {
	BackoffLimit int32
	Namespace    string
	// contains filtered or unexported fields
}

Scheduler facilitates the work with K8s jobs

func NewScheduler

func NewScheduler(kubeconfig string) (*Scheduler, error)

NewScheduler creates a new Scheduler

func (Scheduler) ClientSet

func (s Scheduler) ClientSet() *kubernetes.Clientset

ClientSet returns the client set

func (Scheduler) DeleteJob

func (s Scheduler) DeleteJob(name string) error

DeleteJob removes a job

func (Scheduler) FindJobByLabel

func (s Scheduler) FindJobByLabel(name, value string) (*batchv1.JobList, error)

FindJobByLabel retrieves a job by name

func (Scheduler) FindJobByName

func (s Scheduler) FindJobByName(name string) (*batchv1.JobList, error)

FindJobByName retrieves a job by name

func (Scheduler) ListJobs

func (s Scheduler) ListJobs() (*batchv1.JobList, error)

ListJobs retrieves the list of jobs

func (Scheduler) ListJobsByLabel

func (s Scheduler) ListJobsByLabel(name, value string) (*batchv1.JobList, error)

ListJobsByLabel retrieves the list of jobs according to a label

func (Scheduler) NewJob

func (s Scheduler) NewJob(request *AddJobRequest) (*batchv1.Job, error)

NewJob creates a new job

func (Scheduler) SearchJobs

func (s Scheduler) SearchJobs(jobName, labelName, labelValue string) (*batchv1.JobList, error)

SearchJobs retrieves the list of jobs according to a label and/or name

func (Scheduler) SearchJobsByLabel

func (s Scheduler) SearchJobsByLabel(labelSelector string) (*batchv1.JobList, error)

SearchJobsByLabel retrieves the list of jobs according to labels

Jump to

Keyboard shortcuts

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