scheduler

package
v0.0.0-...-00dc8c7 Latest Latest
Warning

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

Go to latest
Published: May 28, 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 AWResource = schema.GroupVersionResource{Group: mcadv1beta1.GroupVersion.Group,
	Version: mcadv1beta1.GroupVersion.Version, Resource: "appwrappers"}

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) DeleteAppWrapper

func (s *Scheduler) DeleteAppWrapper(Name string) error

delete an AW

func (*Scheduler) GetAppWrappers

func (s *Scheduler) GetAppWrappers()

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) GetClustersInfo

func (s *Scheduler) GetClustersInfo()

get all clusterinfos in hub

func (*Scheduler) IsValidAppWrapper

func (s *Scheduler) IsValidAppWrapper(Job core.Job) error

find an AW

func (*Scheduler) LPSolve

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

func (*Scheduler) Optimize

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

func (*Scheduler) PutHoldOnAppWrapper

func (s *Scheduler) PutHoldOnAppWrapper(Job core.Job) error

add sustainability gate from the appwrapper

func (*Scheduler) RemoveGateFromAW

func (s *Scheduler) RemoveGateFromAW(Job core.Job, TargetCluster string) error

delete sustainability gate from the appwrapper and set the targetCluster

func (*Scheduler) Schedule

func (s *Scheduler) Schedule(optimizer string)

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