wrench::ServerlessSchedulingState

class ServerlessSchedulingState

A class to encode a “scheduling state”, that is a clone of the system state that a scheduler can work with and modify at will for planning purposes.

Public Functions

explicit ServerlessSchedulingState(const ServerlessStateOfTheSystem *state, const std::vector<std::shared_ptr<Invocation>> &schedulable_invocations)

Constructor.

Parameters:
  • state – current system state

  • schedulable_invocations – the schedulable invocations

bool areAllImageLayersInRAM(const std::shared_ptr<Image> &image, const std::shared_ptr<ServerlessComputeNode> &node) const

Are all layers of an image in RAM at a compute node?

Parameters:
  • image – an image

  • node – the compute node

Returns:

True if all necessary layers are in RAM

bool areAllImageLayersInRAMOrOnTheirWayToRAM(const std::shared_ptr<Image> &image, const std::shared_ptr<ServerlessComputeNode> &node) const

Are all layers either in ram or on their way to ram at a compute node?

Parameters:
  • image – an image

  • node – the compute node

Returns:

True or false

bool areAllImageLayersOnDisk(const std::shared_ptr<Image> &image, const std::shared_ptr<ServerlessComputeNode> &node) const

Are all layers either on disk or on their way to ram at a compute node?

Parameters:
  • image – an image

  • node – the compute node

Returns:

True or false

bool areAllImageLayersOnDiskOrOnTheirWayToDisk(const std::shared_ptr<Image> &image, const std::shared_ptr<ServerlessComputeNode> &node) const

Are all layers either on disk or on their way to ram at a compute node?

Parameters:
  • image – an image

  • node – the compute node

Returns:

True or false

bool areAllImageLayersOnDiskOrOnTheirWayToRAM(const std::shared_ptr<Image> &image, const std::shared_ptr<ServerlessComputeNode> &node) const

Are all layers either on disk or on their way to ram at a compute node?

Parameters:
  • image – an image

  • node – the compute node

Returns:

True or false

Public Members

std::map<std::shared_ptr<ServerlessComputeNode>, std::set<std::shared_ptr<Container>>> _busy_containers

Map of running containers.

std::vector<std::shared_ptr<ServerlessComputeNode>> _compute_nodes

The compute nodes.

std::map<std::shared_ptr<ServerlessComputeNode>, unsigned int> _cores_available

Map of core availability.

std::map<std::shared_ptr<ServerlessComputeNode>, sg_size_t> _disk_available

Map of disk availability.

std::map<std::shared_ptr<ServerlessComputeNode>, std::set<std::shared_ptr<Container>>> _idle_containers

Map of idle containers.

std::map<std::shared_ptr<ServerlessComputeNode>, std::set<std::shared_ptr<ImageLayer>>> _image_layers_in_ram

Map of in-RAM image layers.

std::map<std::shared_ptr<ServerlessComputeNode>, std::set<std::shared_ptr<ImageLayer>>> _image_layers_on_disk

Map of on-disk image layers.

std::map<std::shared_ptr<ServerlessComputeNode>, std::set<std::shared_ptr<ImageLayer>>> _image_layers_on_their_way_to_disk

Map of soon-to-be-on-disk image layers.

std::map<std::shared_ptr<ServerlessComputeNode>, std::set<std::shared_ptr<ImageLayer>>> _image_layers_on_their_way_to_ram

Map of soon-to-be-in-RAM image layers.

std::map<std::shared_ptr<ServerlessComputeNode>, std::set<std::shared_ptr<ImageLayer>>> _protected_layers

Map of layers that should not be evicted, due to previous scheduling decisions.

std::map<std::shared_ptr<ServerlessComputeNode>, sg_size_t> _ram_available

Map of RAM availability.