Table of Contents
Overview
A cloud service is an abstraction of a compute service that corresponds to a cloud platform that provides access to virtualized compute resources, i.e., virtual machines (VMs). The cloud service provides all necessary abstractions to manage VMs, including creation, suspension, resume, etc. Compute jobs submitted to the cloud service run on previously created VM instances. If a VM that meets a job's requirements cannot be found, the service will throw an exception. In the cloud service, a VM instance behaves as a bare-metal service.
The main difference between a cloud service and a virtualized cluster service is that the latter does expose the underlying physical infrastructure (e.g., it is possible to instantiate a VM on a particular physical host, or to migrate a VM between two particular physical hosts).
Creating a cloud compute service
In WRENCH, a cloud service represents a compute service (wrench::ComputeService), which is defined by the wrench::CloudComputeService class. An instantiation of a cloud service requires the following parameters:
- A hostname on which to start the service (this is the entry point to the service)
- A list (
std::vector
) of hostnames (all cores and all RAM of each host is available to the cloud service) - A mount point (corresponding to a disk attached to the host) for the scratch space, i.e., storage local to the cloud service (used to store workflow files, as needed, during job executions)
- Maps (
std::map
) of configurable properties (wrench::CloudServiceProperty
) and configurable message payloads (wrench::CloudComputeServiceMessagePayload
).
The example below shows how to create an instance of a cloud service that runs on host "cloud_gateway", provides access to 4 execution hosts, and has a scratch space of 1TiB:
Cloud service properties
In addition to properties inherited from wrench::ComputeServiceProperty
, a cloud service supports the following properties:
wrench::CloudServiceProperty::VM_BOOT_OVERHEAD_IN_SECONDS
Managing a cloud compute service
The cloud service provides several mechanisms to manage the set of VMs instantiated on the execution hosts. Currently, it is possible to create, shutdown, start, suspend, and resume VMs (see a complete list of functions available in the wrench::CloudComputeService API documentation). The figure below shows the different states a VM can be:
Submitting Jobs to a cloud compute service
As expected, a cloud service provides implementations of the methods in the wrench::ComputeService
base class. The wrench::ComputeService::submitJob()
method takes as argument service-specific arguments as a std::map<std::string, std::string>
of key-value pairs. For a cloud service, these arguments are optional and to be specified as follows:
- key:
-vm
; value: a VM name (as returned by wrench::CloudComputeService::createVM) on which the job will be executed.
If no argument is specified, the cloud service will pick the VM on which to execute the job.
Here is an example job submission to the cloud service: