You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.
A scheduler in heiko is the part that chooses which node to run a given task on. Tasks are sent over a task channel. The scheduler receives tasks over this channel and runs that task on a node (in a new goroutine).
Currently (as of fb8b464) heiko has just one scheduler - a random scheduler that selects a node at random.
A few ideas for new schedulers:
Cyclic scheduler: cycle through the list of nodes. For example, if a task runs on node 1, the next task will run on node 2 and so on until it wraps around to node 1 and continues.
Least loaded scheduler: run on the node which is running the least number of tasks. Will need to keep track of tasks running per node. Maybe a priority queue too.
The heiko scheduler: this was the scheduler used in the python implementation of heiko (TODO: update link once it's moved). It uses a bunch of information from the nodes such as number of CPUs, amount of memory, amount of free memory, current load, etc. and prioritizes nodes based on them. Doesn't require keeping track of number of running tasks, but will need to run a set of commands repeatedly on the nodes to get all of this information on a regular basis.
Tasks to complete before (or along with) implementing a new scheduler:
Refactor scheduler code to be modular - to reduce boilerplate. Maybe using interfaces, nameless fields (composition), a combination of them or something else.
Add a flag in the CLI (under cmd/, uses cobra) to select a scheduler
Map strings to scheduler functions/structs for the above
The text was updated successfully, but these errors were encountered:
A scheduler in heiko is the part that chooses which node to run a given task on. Tasks are sent over a task channel. The scheduler receives tasks over this channel and runs that task on a node (in a new goroutine).
Currently (as of fb8b464) heiko has just one scheduler - a random scheduler that selects a node at random.
A few ideas for new schedulers:
Before implementing new schedulers it would be a good idea to have an interface for a scheduler. If you look at the random scheduler, only one line of it actually does the job of choosing a node to run the task on: https://github.com/psiayn/heiko/blob/fb8b464ec2d4308fde9a4d6cfbcc2762d2851783/internal/scheduler/scheduler.go#L41
Everything else is boilerplate that will have to be repeated if a new scheduler is added with the current code structure.
Tasks to complete before (or along with) implementing a new scheduler:
cmd/
, uses cobra) to select a schedulerThe text was updated successfully, but these errors were encountered: