README.md 3.17 KB
Newer Older
Petyo's avatar
Petyo committed
1
[![Build Status](https://travis-ci.org/MontiSim/RMIModelServer.svg?branch=master)](https://travis-ci.org/MontiSim/RMIModelServer)
Evgeny Kusmenko's avatar
Evgeny Kusmenko committed
2
[![Maintainability](https://api.codeclimate.com/v1/badges/55c8774bfd4d37534691/maintainability)](https://codeclimate.com/github/MontiSim/RMIModelServer/maintainability)
Petyo's avatar
Petyo committed
3

Petyo's avatar
Petyo committed
4
# RMIModelServer
Petyo's avatar
Petyo committed
5

Jean Meurice's avatar
Jean Meurice committed
6
The RMIModelServer is used to remotely allocate a series of [_HardwareEmulators_](https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/simulators/hardware_emulator), which can load different autopilots generated with [_EMAM2CPP_](https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/generators/EMAM2Cpp).
Petyo's avatar
Petyo committed
7
8
9
10
11
12
13
14
15
16
17

## Requirements

In order the project to be built locally, the following software is required:

    Apache Maven
    Java Development Kit, Version 8+
    (optional) Git

To clone this github repository, one can use the following commands

Jean Meurice's avatar
Jean Meurice committed
18
19
    cd MontiSim
    git clone https://github.com/MontiSim/RMIModelServer.git
Petyo's avatar
Petyo committed
20
21
22
      
__NOTE:__ _MontiSim_ is the directory, in which MontiSim-belonging projects should be clonned. It has to be manually created.

Jean Meurice's avatar
Jean Meurice committed
23
## Compiling 
Petyo's avatar
Petyo committed
24

Jean Meurice's avatar
Jean Meurice committed
25
To just compile the `jar`, use
Petyo's avatar
Petyo committed
26

Jean Meurice's avatar
Jean Meurice committed
27
28
29
    mvn clean install -s settings.xml
    
To compile and copy the server to the local `install` folder, use the `scripts/compile_install` scripts.
30

Jean Meurice's avatar
Jean Meurice committed
31
__NOTE:__ New versions of the _HardwareEmulator_ must be copied into the `install` folder. This folder is used in a maven test to verify RMIModelServer/HardwareEmulator integration.
Petyo's avatar
Petyo committed
32

Jean Meurice's avatar
Jean Meurice committed
33
## Running the RMI server
34

Jean Meurice's avatar
Jean Meurice committed
35
36
37
The `install` folder contains a sample setup for running the RMIModelServer. 
The RMIModelServer jar must be in the same directory as the [HardwareEmulator](https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/simulators/hardware_emulator) library it will use (_HardwareEmulator.lib_ or _HardwareEmulator.so_ for Windows or Linux).
The `run` script starts an instance of the RMIModelServer. It uses the `config` script to provide a way of changing the port or the autopilot folder used. The port defaults to 10101, and can be changed to start multiple RMIModelServers.
Petyo's avatar
Petyo committed
38

Jean Meurice's avatar
Jean Meurice committed
39
40
41
The autopilot folder is a folder path (absolute or relative to the RMIModelServer) in which the RMI server will look for autopilot programs.
These programs are the EmbeddedMontiArc models compiled with EMAM2CPP (or a project using EMAM2CPP such as [EMAM-showcase](https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/simulators/EMAM-showcase) or [EMAStudio](https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/utilities/EMAStudioBuilder)).
The `autopilots` folder in the `install` folder contains the sample autopilot from `EMAM-Showcase`.
ham's avatar
ham committed
42
43
44

## Docker

45
46
47
48
49
50
51
Here is another possibility to run the RMI server without compiling the AutopilotAdapter.dll yourself.

First we build the docker image with 
```
$ ./docker/build.sh
```
This script only does 2 things:
ham's avatar
ham committed
52
53
54
55

1. Copy the latest rmi-model-server build into ./docker/ in order to prepare the build.
2. Then use ./docker/Dockerfile to build the rmi-model-server docker image.

56
57
58
59
60
After the docker image is built. Run following command to start the RMI server with port 10101:

```
$ docker run --name=rmi-server -p 10101:10101 --rm rmi-server
```
ham's avatar
ham committed
61

62
Or, for example with port 5000:
ham's avatar
ham committed
63
```
64
$ docker run --name=rmi-server -p 5000:10101 --rm rmi-server
ham's avatar
ham committed
65
66
```