scheduler

package
v0.32.1 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2023 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	log15.Logger
	// contains filtered or unexported fields
}

Controller struct stores everything the controller needs in order to function. It contains the functions needed to populate and operate on the work queue. It also provides the relevant helper functions to resource and pod alive requests from the k8s scheduleri implementation. A controller is an active reconsiliation process that attempts operates on items in it's work queue.

func NewController

func NewController(
	kubeclientset kubernetes.Interface,
	restconfig *rest.Config,
	libclient *client.Kubernetesp,
	kubeInformerFactory kubeinformers.SharedInformerFactory,
	opts ScheduleOpts,
) *Controller

NewController returns a new scheduler controller.

func (*Controller) Run

func (c *Controller) Run(ctx context.Context, threadiness int, stopCh <-chan struct{}) error

Run sets up event handlers, syncs informer caches and starts workers. It blocks until stopCh is closed, at which point it'll shut down workqueue and wait for workers to finish processing. Threadiness determines how many workers, pod alive and req check handlers to run.

type PodAlive

type PodAlive struct {
	Pod     *corev1.Pod
	ErrChan chan error
	Done    bool
}

PodAlive contains a pod, and a chan error that is notified when the pod terminates.

type Request

type Request struct {
	RAM    resource.Quantity
	Time   time.Duration
	Cores  resource.Quantity
	Disk   resource.Quantity
	Other  map[string]string
	CbChan chan Response
}

Request contains relevant information for processing a request from reqCheck().

type Response

type Response struct {
	Error     error
	Ephemeral bool // indicate if ephemeral storage is enabled
}

Response contains relevant information for responding to a Request from reqCheck().

type ScheduleOpts

type ScheduleOpts struct {
	Files        []client.FilePair  // Files to copy to each spawned runner. Potentially listen on a channel later.
	CbChan       chan string        // Channel to send errors on
	BadCbChan    chan *cloud.Server // Send bad 'servers' back to wr.
	ReqChan      chan *Request      // Channel to send requests about resource availability to
	PodAliveChan chan *PodAlive     // Channel to send PodAlive requests
	ManagerDir   string             // Directory to store logs in
	Logger       log15.Logger
}

ScheduleOpts stores options for the scheduler.

Jump to

Keyboard shortcuts

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