Documentation ¶
Index ¶
- Constants
- type AddJobRequest
- type JobExecutionLocation
- type Scheduler
- func (s Scheduler) ClientSet() *kubernetes.Clientset
- func (s Scheduler) DeleteJob(name string) error
- func (s Scheduler) FindJobByLabel(name, value string) (*batchv1.JobList, error)
- func (s Scheduler) FindJobByName(name string) (*batchv1.JobList, error)
- func (s Scheduler) ListJobs() (*batchv1.JobList, error)
- func (s Scheduler) ListJobsByLabel(name, value string) (*batchv1.JobList, error)
- func (s Scheduler) NewJob(request *AddJobRequest) (*batchv1.Job, error)
- func (s Scheduler) SearchJobs(jobName, labelName, labelValue string) (*batchv1.JobList, error)
- func (s Scheduler) SearchJobsByLabel(labelSelector string) (*batchv1.JobList, error)
Constants ¶
const AnnotationExecutionLocation = "execution_location"
AnnotationExecutionLocation defines the annotation containing the job execution location
const CreatedByLabelName = "created_by"
CreatedByLabelName defines the label name for jobs created by this api
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 ¶
NewScheduler creates a new Scheduler
func (Scheduler) ClientSet ¶
func (s Scheduler) ClientSet() *kubernetes.Clientset
ClientSet returns the client set
func (Scheduler) FindJobByLabel ¶
FindJobByLabel retrieves a job by name
func (Scheduler) FindJobByName ¶
FindJobByName retrieves a job by name
func (Scheduler) ListJobsByLabel ¶
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 ¶
SearchJobs retrieves the list of jobs according to a label and/or name