Commit a0744ba1 authored by ham's avatar ham
Browse files

Update instructions for Mac/Linux users and docker

parent 2181a46a
......@@ -25,11 +25,26 @@ __NOTE:__ _MontiSim_ is the directory, in which MontiSim-belonging projects shou
To run the server one can has to run the corresponding script file from the __scripts__ directory in _RMIModelServer_ project.
* For Windows the `run.bat` file has to be executed
* For Linux the `run.sh` file has to be exeuted __*(irrelevant, due to dependency on Windows platform)__
By default, the RMI server will start with port 10101, you can change this if you need to. For example if you want to start multiple RMI server on different ports.
## External models
* For Windows users, edit the variable PORT and DLL in `run.bat` before you execute it.
* For Linux users, edit the variable DLL in `run.sh`, then execute the script with:
```
$ ./run.sh [port]
```
for example, to start RMI server with default port(10101):
```
$ ./run.sh
```
to start it with custom port:
```
$ ./run.sh 5000
```
## External models
### Windows
To use an external vehicle model, one has to clone the corresponding repository. For the _Autopilot emam_ vehicle model, located in [Autopilot emam repository](https://github.com/MontiSim/EMAM-showcase), the following commands have to be executed:
cd MontiSim
......@@ -42,22 +57,44 @@ To use an external vehicle model, one has to clone the corresponding repository.
The last command `main.bat` will compile the model and run it in a server container to test it.
__NOTE:__ Autopilot EMAM model works only in _Windows 64 bit_ environment.
### Linux
First you need to edit the JAVA_HOME variable in scripts/linux/variables.sh
Then generate the cpp code:
```$xslt
$ ./generate.sh
```
Then compile the AutopilotAdapter.dll:
```$xslt
$ ./compile.sh
```
The scripts in `script` directory are already adjusted to use _Autopilot_ model. If a new model has to be integrated to the RMI Model server, an implementation of _VehicleModel_ has to be created and adjusted with the _ModelManager_. Additionally, all dependencies of the new model have to be declared in the _library_ or _class-path_ of the RMI Model server.
## Docker
To run the RMI server in docker, first you need to build the docker image with `./docker/build.sh`. This script only does 2 things:
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:
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.
You can simply replace the `./docker/rmi-model-server-1.0.1-SNAPSHOT.jar` with latest maven build if there are any updates, just remember to update `RMI_VERSION` in the Dockerfile. But if you want to update the `AutopilotAdapter.dll`, you shoudld rebuild it under a linux 64-bit environment by using scripts in `./EMAM-showcase/scripts/linux`. A build from Mac or Windows environment won't work.
If there is a new version of rmi-model-server, the `RMI_VERSION` in the Dockerfile needs to be updated accordingly.
After the docker image is built. Run following command to start the RMI server:
If you need to update the `AutopilotAdapter.dll`, it has to be recompiled under a linux 64-bit environment by using scripts in `./EMAM-showcase/scripts/linux`.
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
```
Or, for example with port 5000:
```
docker run --name=rmi-server -p 10101:10101 --rm rmi-server
$ docker run --name=rmi-server -p 5000:10101 --rm rmi-server
```
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment