wrench::ServerlessComputeService

class ServerlessComputeService : public wrench::ComputeService

A serverless compute service that manages a set of compute nodes and controls access to their resource via function registration/invocation operations.

Public Functions

ServerlessComputeService(const std::string &hostname, const std::string &head_node_storage_mount_point, const std::vector<std::string> &compute_nodes, const std::shared_ptr<ServerlessScheduler> &scheduler, const WRENCH_PROPERTY_COLLECTION_TYPE &property_list = {}, const WRENCH_MESSAGE_PAYLOAD_COLLECTION_TYPE &messagepayload_list = {})

Constructor.

Parameters:
  • hostname – name of the head host on which the service runs

  • head_node_storage_mount_point – the mount point of storage at the head host (where images will be stored)

  • compute_nodes – list of (homogeneous) compute node hostnames

  • scheduler – the scheduler used to decide which invocations should be executed and when

  • property_list – a property list ({} means “use all defaults”)

  • messagepayload_list – a message payload list ({} means “use all defaults”)

std::shared_ptr<Function> addRegisteredFunction(const std::string &name, const std::function<std::shared_ptr<FunctionOutput>(const std::shared_ptr<FunctionInput>&, const std::shared_ptr<StorageService>&)> &code, const std::shared_ptr<Image> &image, double time_limit_in_seconds, sg_size_t disk_space_limit_in_bytes, sg_size_t RAM_limit_in_bytes, sg_size_t ingress_in_bytes, sg_size_t egress_in_bytes)

Method to add (outside the simulation, in zero time) a new registered function to a serverless compute service. Typically used before the simulation launch.

Parameters:
  • name – the name of the function to register

  • code – the function’s code

  • image – the function’s image

  • time_limit_in_seconds – the time limit for execution

  • disk_space_limit_in_bytes – the disk space limit for the function

  • RAM_limit_in_bytes – the RAM limit for the function

  • ingress_in_bytes – the ingress data limit

  • egress_in_bytes – the egress data limit

Returns:

The Function object that was registered

std::shared_ptr<ServerlessScheduler> getScheduler() const

Get the service’s scheduler.

Returns:

a scheduler

virtual bool supportsCompoundJobs() override

Returns true if the service supports compound jobs.

Returns:

true or false

virtual bool supportsFunctions() override

Returns true if the service supports functions.

Returns:

true or false

virtual bool supportsPilotJobs() override

Returns true if the service supports pilot jobs.

Returns:

true or false

virtual bool supportsStandardJobs() override

Returns true if the service supports standard jobs.

Returns:

true or false

Public Static Attributes

static unsigned long _sequence_number = 0

A unique sequence counter.