scheduler

package
v0.0.0-...-dd78f13 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

README

Scheduler

Scheduler is periodically called by Caspian. It first gets the info of spoke clusters and characjteristics of Appwrappers. It then calls the optimizer to find scheduling/placement for appwrappers. Finally, it updates target cluster and dispatching gates of appwrappers notifying MCAD about its decisions. The figure below shows the steps that the scheduler takes to update Appwrappers.

scheduler

Documentation

Overview

Note: the example only works with the code within the same release/branch.

Index

Constants

This section is empty.

Variables

View Source
var JobResource = schema.GroupVersionResource{Group: batchv1.GroupName,
	Version: batchv1.SchemeGroupVersion.Version, Resource: "jobs"}
View Source
var WLResource = schema.GroupVersionResource{Group: kueuev1beta1.GroupVersion.Group,
	Version: kueuev1beta1.GroupVersion.Version, Resource: "workloads"}

Functions

This section is empty.

Types

type Objective

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

type Scheduler

type Scheduler struct {
	N            int // number of  jobs (AWs) (to be scheduled/rescheduled)
	M            int // number of available clusters
	T            int // length of time horizon (number of timeslots)
	PeriodLength int
	Jobs         []core.Job     // list of jobs
	Clusters     []core.Cluster // spoke clusters
	// contains filtered or unexported fields
}

func NewScheduler

func NewScheduler(config *rest.Config, periodLength int) *Scheduler

NewDispatcher : create a new dispather instance and configure the clients with kube_config and hub-context

func (*Scheduler) AddNodeSelector

func (s *Scheduler) AddNodeSelector(JobName string, NameSpace string, targetNode string) error

Add target node to the spec of jobs

func (*Scheduler) GetClustersInfo

func (s *Scheduler) GetClustersInfo() error

get all clusterinfo

func (*Scheduler) GetJobs

func (s *Scheduler) GetJobs(count int)

retrive all Appwrappers in hub: running+ non-running AWs. Calculate requested resources of each AW. Save all AWs with their characteristics in Jobs array

func (*Scheduler) LPSolve

func (s *Scheduler) LPSolve(obj []float64) ([]SchedulingDecision, float64)

func (*Scheduler) Optimize

func (s *Scheduler) Optimize(sustainable bool) []int

func (*Scheduler) RandomOptimizer

func (s *Scheduler) RandomOptimizer()

randomOptimizer randomly assign jobs to the nodes

func (*Scheduler) Schedule

func (s *Scheduler) Schedule(optimizer string, count int)

func (*Scheduler) UpdateQueuePoloicy

func (s *Scheduler) UpdateQueuePoloicy(QueueName string, Policy kueuev1beta1.StopPolicy) error

put/release hold on a clusterqueue

type SchedulingDecision

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

Jump to

Keyboard shortcuts

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