Experimental: Models for designing provider independent cloud applications

As part of the EU FP7 project MODAClouds, we have been experimenting with modelling support for provider independent cloud applications within Modelio. In this tutorial you’ll discover the MODAClouds modelling approach for designing cloud applications in a provider independent way.

MODAClouds is a research project started at September 2012 and funded by the European Commission. Leaded by the Italian university POLIMI and under the scientific steering of the Norwegian research institute SINTEF, it aims at using a model driven approach to mitigate the problem of vendor lock-in when building cloud applications. The project provides methods, a decision support system, an open source IDE and a runtime environment for high-level design, deployment and management of cloud provider independent applications.

The open source IDE is a module developed by SOFTEAM for Modelio 3.1 called Creator 4Clouds. It implements the model driven development approach developed during the MODAClouds project. The approach is first of all a methodology, in which it demands developers to define models at three levels of abstraction:

  • The Cloud Computing Independent Model (CCIM) is a service oriented model of the cloud application, describing it as a set of services connected by means of interfaces.
  • The Cloud Provider Independent Model (CPIM) is a deployment model defined in terms of services, nodes and components to be deployed in the cloud.
  • The Cloud Provider Specific Model (CPSM) is a more detailed deployment model which associates CPIM level elements to specific cloud providers.

During the MODAClouds project, SOFTEAM developed a proof-of-concept modelling environment based on this approach, and integrated with other research demonstrators provided by project partners. This tutorial will show you the MODAClouds methodology in practice and will show how Creator 4Clouds enacts it.

If you need more information on the MODAClouds approach an tools, please refer to the videos and training sections of MODAClouds website. In particular, we recommend watching our presentation at the Multi-Cloud Tutorial, available at the videos section.

Prerequisites

For this tutorial, you need:

  • Modelio 3.1.2 open source, which can be found here.
  • Creator 4Clouds 1.0.816, which can be found here.
  • The CloudResources_2.0.0.ramc, which can be found here.

In this tutorial, we are not going to present the basics of Modelio usage, for that, refer to our Modelio specific documentation.

Youtube Video

The content of this tutorial can also be found in the following video:

Install Creator 4Clouds into Modelio

Creator 4Clouds is a Modelio module. Let us start by installing it into your Modelio 3.1 open source.

  1. Open the Configuration / Modules catalogue command.
  2. In the Modules catalogue window, click on Add a module to the catalog and use the file browser to select the modules (*.jmdac files).
  3. Click on the Close button when your catalogue is up-to-date.

Create a new project

Create a new project that is going to contain the cloud application model.

Creating a project in Modelio

  1. Click on File\Create a project...
  2. Enter the name of the project.
  3. Enter the description of the project.
  4. Uncheck the Java project checkbox.
  5. Click on Create to create and open the project.

Once the project has been created and opened, add the Creator4Clouds module to it.

Adding a module to a Modelio project

  1. Open the Module Configuration page in the Configuration menu and click on the Open modules catalog button to expand the Modules catalog.
  2. In the Modules catalog, select the following modules: Creator 4Clouds, and PersistentProfile.
  3. Click on the Add module to project button to install the modules in the project.

A model, called Cloud Resources Model was developed by MODAClouds. It contains information on the services and resources provided by different cloud providers. You need to add this model to your project.

Adding the Resource model to a project

  1. Open the Configuration \ Libraries menu option.
  2. Click on the Add button on the Local libraries tab.
  3. Select the CloudResources_2.0.0.ramc file.
  4. Click on the Add to project button.

Define the CCIM level model of the application

At CCIM level, you need to model the application following a services oriented approach. The model consists then of a set of services connected by provided and required interfaces.

In this tutorial, let us use a simple example of application composed of two services A and B.

  1. Create two services A and B. To do so, right-click on the CCIM model, then select : Creator 4Clouds > Elements > Create Service

  2. Define interface IA provided by A. To do so, right-click on the Provided interfaces element in A, then select : Creator4 Clouds > Elements > Create provided interface

  3. Define interface IA required by B. To do so, right-click on the Required interfaces element in B, then select : Creator4 Clouds > Elements > Create required interface

Once both services have been created, the explorer view should look like this:

Explorer view

The next step consists in defining how these services connect when assembled at runtime. For this, use the Service assembly model.

  1. On the Service assembly model, under Orchestration, open the Service assembly diagram.
  2. Use the Quick service instance to create instances of A and B, and then connect them.

The final assembly diagram should look as follows:

Service assembly diagram

Define the CPIM level model of the application

At CPIM level, you should define:

  1. If each service is going to be implemented by you or be implemented a PaaS provided service
  2. If each service is going to be deployed on IaaS nodes, or on PaaS application containers
  3. The scripts one would need to manage the lifecycle of each component (install, deploy, start, stop, etc) given it will be deployed on a given known environment (i.e. a specific OS version and computing architecture). *
  4. How your nodes, services and application components are connected.

In MODAClouds, CPIM models are defined in both type and instance levels. At type level, you should define the types of nodes, external services and application components your application is composed of (items 1-3); at instance level, you should define how these elements are instantiated at runtime (item 4).

  1. First of all, Generate a CPIM model from the CCIM model. To do so, right-click on the CCIM model, then select: Creator4 Clouds > Model transformations > Generate CPIM deployment model

The generated deployment model should include a type level model only, and should look as follows :

CPIM type level in explorer view

  1. Click on each element in the explorer and then use the element view to edit its properties (illustrated below). There you can define the high level aspects of your deployment (ports, connections, OS) and generic deployment scripts to be used during deployment. *

CPIM instance level in element view

  1. When you are done, generate a instance level CPIM model. To do so, right-click on the deployment alternative, then select: Creator4 Clouds > Model transformations > Generate new instance level model from type level model.

  2. The instance level model should follow the same structure as the Service assembly model at CCIM level. Use the Explore view and the Diagram view to define the actual deployment architecture. Define in which cloud resources components will be deployed. You can also use the element view to define low level information on your instances (see below). *

CPIM instance level in explorer view

Element view at CPIM instance level

`* As this point is specific to the deployment of components, it will not be explained in details in the present tutorial.

Define the CPSM level model of the application

At CPSM level, you should define the specific cloud resource of a specific provider you need to deploy each component of your application. For example, in PaaS deployments, you need to choose the service on the cloud provider you are going to reuse to implement a service on your application architecture; in IaaS deployments, you need to choose the kind of cloud VM you want to create (memory and disk size, CPU capacity).

  1. Start by generating a CPSM level model from the CPIM level model. To do so, right-click on the deployment alternative, then select: Creator4 Clouds > Model transformations > Generate CPSM deployment alternative

  2. For each cloud provider you need to use, define a Cloud account for it. To do so, right-click on the Cloud account element under the CPSM deployment model, then select: * Creator4 Clouds > Elements > Create provider account

  3. You can also use the element view to define the properties of each provider account (illustrated below). In order to fill these fields, consult CloudML documentation. Element View for cloud provider accounts

  4. For each provider account, in the elements view, set its Base property, to be the Cloud service from the provider it refers to. Services can be found in the cloud resources model (see below). * Resources model and cloud services

  5. On the CPSM models, you should define in which specific kind of cloud resource you want to deploy each node or external component of your application. To do so, open the Instance level deployment diagram, move each element to the diagram and then create a ProviderWorkloadSpecfiicationarrow between them. To final result should look like this: Final instance level deployment diagram.

`* As this point is specific to the deployment of components, it will not be explained in details in the present tutorial.

Beyond models

As explained in the introduction, during MODAClouds, Creator 4Clouds has been integrated to other design and runtime tools, so that models defined in it can be used to deploy the application, monitor and manage it at runtime.

As an example, let us take CloudML, which is a mult-cloud deployment engine developed by SINTEF. Creator 4Clouds is able to generate deployment scripts for CloudML. In order to do that, right-click on the CPSM deployment model, then select: Creator 4Clouds > CloudML 4Clouds > Export JSON file...

The follow screen will show the deployment script generated by Creator 4Clouds. CloudML Output

elementViewAtCPIMInstanceLevel.png (19.2 KB) Marcos Almeida, 29 September 2015 15:24

elementViewAtCPIMTypeLevel.png (18.8 KB) Marcos Almeida, 29 September 2015 15:24

elementViewForCloudProviderAccounts.png (13.8 KB) Marcos Almeida, 29 September 2015 15:24

explorerView.png (12.3 KB) Marcos Almeida, 29 September 2015 15:24

serviceAssemblyDiagram.png (2.71 KB) Marcos Almeida, 29 September 2015 15:24

typeLevelDiagram.png (7.52 KB) Marcos Almeida, 29 September 2015 15:24

CloudResources_2.0.0.ramc (12.8 MB) Marcos Almeida, 29 September 2015 16:27

resourcesModelAndCloudServices.PNG (24 KB) Marcos Almeida, 29 September 2015 16:27

cloudMLOutput.PNG (21.4 KB) Marcos Almeida, 29 September 2015 16:45

instanceLevelCPIMDiagram.PNG (8.15 KB) Marcos Almeida, 29 September 2015 17:42

finalInstanceLevelDeploymentDiagram.png (6.46 KB) Marcos Almeida, 29 September 2015 17:50

Creator4Clouds_1.0.816.jmdac (99.9 MB) Marcos Almeida, 07 October 2015 14:49