Skip to content

Building DMASON from source

Flavio Serrapica edited this page Jul 14, 2016 · 23 revisions

The following tutorial will guide you through the download and setup of the D-MASON project into Eclipse. Of course you can use any IDE of your choice, or no one at all.

Prerequisites

Downloading DMASON as Eclipse Project

  1. Open menu "File" > "Import" and select "Projects from Git" under "Git" folder
  2. Select "Clone URI" and press the "Next" button
  3. In the "URI" field insert "/~https://github.com/isislab-unisa/dmason.git"
  4. Fill all fields in "Authentication" with your GitHub credentials. Than press the "Next" button
  5. In "Branch Selection" view, select the branch on which you want work (master is the main branch), alternatively you can select all of them. Than press the "Next" button.
  6. Press the "Next" button in the "Local Destination" view.
  7. Wait until the download ends, than select "Import as general project" in "Wizard for project import" and press the "Next" button
  8. Fille the "Project name" field in "Import Project" section and press "Fisish" button
  9. Right-click on project > "Configure" > "Convert to Maven Project"

Now you can use DMASON.

Build DMASON with Maven

To install DMASON you need download Apache Maven and the DMASON project from git repository. Now you have to run the following command in the main directory of DMason project

$ path_to_apache-maven/bin/mvn -Dmaven.test.skip=true clean package

This command builds project and creates a folder called target in which you can find the executable jar for DMASON

Note: To generate build without runs test suite:

$ mvn -Dmaven.test.skip=true clean package 

Launching DMASON (from jar file)

DMASON is built upon Three components: an ActiveMQ server, one or more Workers and a Master which include a Web Server.

In this tutorial, we’ll setup a DMASON simulation using two workers. Also, we will run all of the component on a single machine, but in a real simulation environment you may want to run the server and every worker on different hosts.

Launching the Master

Using the jar file DMASON-X.X.jar available under the target folder it's possible to run Master and Worker(s).

For launching the Master use the follow command:

   java -jar DMASON-X.X.jar -m master

In this way, it's available the ActiveMQ server and the Web System Management.

Launching the Worker(s)

Using the jar file DMASON-X.X.jar available under the target folder run the follow command:

$ java -jar DMASON-X.X.jar -m worker -ip <ipactivemq> -p <portactivemq> -h ipslave1 ipslave2 ... ipslaveN -ns <M>
  • M is the max number of available LPs that the slave nodes can execute
  • ipslave{1-N} is the ip of the machines on which runs DMASON as Worker (Optional)

Launching DMASON (from Eclipse)

It's possible to run each component from Eclipse for a local test

Launching the ActiveMQ server

We include the ActiveMQ library using the maven repository (see pom.xml file). The actual version is the 5.13.3.

From Eclipse run the class ActiveMQStarter.java under it/isislab/dmason/experimentals/systemmanagement/utils/activemq/ package for running the ActiveMQ.

Launching the Master

From Eclipse run as Java application the class MasterServerMain.java under it/isislab/dmason/experimentals/systemmanagement/master/ package for running the Master component.

Launching the Worker(s)

From Eclipse run as Java application the class WorkerMain.java under it/isislab/dmason/experimentals/systemmanagement/master/ package for running the Master component.

Note: the class requires some arguments, them are the following:

  • masterIP (default 127.0.0.1)
  • ActiveMQ listening port (default 61616)
  • number of LPs to simulate (default 1)

DMASON on cluster

To run DMASON on cluster, you can follow these steps

Configure Java Development Kit 8 as default on all cluster's nodes

Download Java SE Development Kit 8 from oracle site. You can follow this instructions /~https://github.com/serfla/jdk-cluster-installer to set JDK 8 as default. Repeat this operation for all nodes of clusters.

Generate DMASON's jar

Run maven install of DMASON project. Under target folder you can find the following files:

  • DMASON-X.X.jar
  • resources folder

You can create a folder called DMASON with these files. Now you copy this folder on all nodes of cluster.

Configure Activemq

On master node editing Apache ActivemQ configuration file 'resources/systemmanagement/master/conf/config.properties' in order to set ip and port of Apache ActivemQ:

  • set ip (default is 127.0.0.1), the same ip of master node
  • set port (default is 61616)

Run DMASON on cluster

On master node open a terminal e launch this command to start the master node

$ java -jar DMASON-X.X.jar -m master

In your web browser enter the address http://127.0.0.1:8080 to start a Web UI of system management, if master node is on 127.0.0.1. You have to use latest version of Google Chrome or Firefox as web browser.

Now, to start the slaves node you can open a new terminal on the master node and launch this command

#M is the max number of available cells that the slave nodes can execute
$ java -jar DMASON-X.X.jar -m worker -ip <ipactivemq> -p <portactivemq> -h <ipslave1 ipslave2 ... ipslaveN> -ns <M>

or you can launch this command on each slave node

#M is the max number of available cells that the slave node can execute
$ java -jar DMASON-X.X.jar -m worker -ip <ipactivemQ> -p <portActivemq> -ns M

where M is the max number of available LPs that the slave nodes can execute.

Exporting and running own simulation

To export your simulation:

  1. "Right-click" > "Export" on simulation package
  2. Select "Jar File" under "Java" folder in "Export" view, than press the "Next" button
  3. Select the export destination and press the "Finish" button
  4. For how to run own simulation from System Management, read here