M2R Lab

Prerequisites

For this work, you need:

If you do NOT have a Linux system, you will be able to do everything EXCEPT the Docker part.


Installation

This section is about installing the Roboocnf DM and starting it.

# Both command should succeed
java -v
mvn -v


Building the first Application

This section is about preparing the first application you will deploy with Roboconf.

In the scope of another work, you will be asked to create a XText editor for some of these configuration files.

By default, the application is configured to be deployed on Docker.
This is not the initial deployment target. Update the graph/VM/target.properties file with the following content:

handler: in-memory
name: in-memory
description: To simulate deployments.

Compile the project with Maven.

# The command's output will be located under the project's "target" directory
mvn clean package

Verify you have a ZIP file under the target directory.


First Deployment

This section is about loading the previous application in the DM.

Go back to the DM’s console (Command Line Interface - CLI).
In the CLI, install the in-memory handler.

roboconf:target in-memory

This handler will simulate the deployment of your application.
It will help to understand the dependency resolution mechanism.

You can use the deploy & start all action. When everything is deployed and started, watch what happens when you stop the database. Which other parts of the application are impacted?

In the graph file of the application project, find the properties that explain this behavior.


Docker Deployment

This section is about deploying the previous application on Docker with Roboconf.

In the DM’s CLI, install the docker handler.

roboconf:target docker

This handler will enable the manipulation of Docker images and containers.
It will be used to deploy the application on your local machine.

In the web console, go into the deployment targets top menu.
Create a new target called docker and copy the following content.

# Common information to any target
handler = docker
name = Docker
description = A Docker installation with an image generated by Roboconf.

# Docker specific properties
docker.generate.image = true
docker.image = roboconf-docker-img

Roboconf will indeed generate a Docker image, install an agent on it, configure and start it.
It will then create containers from this image and install the application on it.

Once everything is deployed and started, find the IP address of the Apache load-balancer (e.g. 172.17.0.19). Then, open your web browser to http://172.17.0.19/roboconf-hello/.

Verify round-robin works.
What happens if you stop one Tomcat server? What happens if you stop the database?


Going Further - Cloud Deployment

This section does not require a cloud account, this is not about manipulating but about understanding how you would proceed.

Assuming you want to deploy this same application on a cloud infrastructure (e.g. Amazon Web Services, for public cloud), how would you do? And assuming you want to deploy the database on a first infrastructure, and the servers on another (hybrid cloud), how would you do?


Going Further - The DSL