CloudML allows developers to model the provisioning and deployment of a multi-cloud application.
CloudML is also inspired by component-based approaches in order to facilitate separation of concerns and reusability. In this respect,
deployment models can be regarded as assemblies of components exposing ports, and bindings between these ports.
Objective
In this tutorial we will exploit the CloudML JSON syntax to specify a very simple deployment model. The objective is the following: specify the deployment of MongoDB on a small virtual machine.
Fill the blank parts in the code snippets below!
Introduction
A CloudMLModel consists of CloudMLElements,
which can be associated with Property and Resources. A Resource
represents an artefact (e.g., scripts, binaries, configuration files, etc.) adopted to manage
the deployment life-cycle (e.g., download, configure, install, start, and stop). The three main
types of CloudMLElements are Component, Communication,
and Hosting.
Provider
You can specify the set of cloud providers you have access to in the list of Providers. In order to get access to the provider's API
a file containing your credentials has to be defined and the path to this file specify in the credentials attribute. For specific cloud providers,
the API's endpoint must be specified as a property attached to the provider definition. This is for instance the case for private instances of Openstack.
A Component can be an ExternalComponent, meaning that it is managed by
an external Provider (typically a PaaS, e.g., an Amazon Beanstalk container),
or an InternalComponent, meaning that it is
managed by CloudML.
Internal Component, type and instance
The following code snippet is used to specify a type of internal component called mongoDB. This component requires and execution platform, which, in this case, is simply an operating system.
A resource is attached to this component type describing how to manage its life-cycle. A resource is typically composed of a set of commands, one for each state of the life cycle. Accordingly the possible commands are:
uploadCommand, downloadCommand, installCommand, configureCommand, startCommand, stopCommand.
External Component, type and instance
An ExternalComponent can be a VM (e.g., a VM running GNU-Linux) or a PaaS service.
The properties minCores, maxCores, minRam, maxRam, minStorage, and maxStorage
represent the lower and upper bounds of virtual compute cores, RAM, and storage, respectively, of the required VM
(e.g., minCores=1, minRam='
1024). The property sshKey represents the name of the SSH stored on the provider side
and that will be used when the VM is created to enable connections using the correspondig privateKey. The property privateKey
specifies the path to this privateKey.
A HostingPort represents a hosting interface of a component. A HostingPort can be a ProvidedHost,
meaning that it provides hosting facilities (i.e., it provides an execution environment) to another component,
or a RequiredHost, meaning that an internal component requires hosting from another component.