Commit 7783aad2 authored by ham's avatar ham
Browse files

Dockernize

parent d6fddae6
Pipeline #66937 passed with stages
in 55 seconds
......@@ -45,3 +45,19 @@ The last command `main.bat` will compile the model and run it in a server contai
__NOTE:__ Autopilot EMAM model works only in _Windows 64 bit_ environment.
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:
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.
After the docker image is built. Run following command to start the RMI server:
```
docker run --name=rmi-server -p 10101:10101 --rm rmi-server
```
#
#
# ******************************************************************************
# MontiCAR Modeling Family, www.se-rwth.de
# Copyright (c) 2017, Software Engineering Group at RWTH Aachen,
# All rights reserved.
#
# This project is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 3.0 of the License, or (at your option) any later version.
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this project. If not, see <http://www.gnu.org/licenses/>.
# *******************************************************************************
#
FROM openjdk:8
ENV RMI_VERSION=1.0.1-SNAPSHOT
ENV RMI_JAR=rmi-model-server-${RMI_VERSION}.jar
WORKDIR /app
COPY AutopilotAdapter.dll /usr/lib/
COPY AutopilotAdapter.dll ./
COPY rmi-model-server-$RMI_VERSION.jar ./rmi-model-server.jar
CMD exec java -cp rmi-model-server.jar -Djava.rmi.server.codebase=file:rmi-model-server.jar -Djava.rmi.server.hostname=rmi-server rwth.rmi.model.server.RMIServer
#!/bin/bash
#
#
# ******************************************************************************
# MontiCAR Modeling Family, www.se-rwth.de
# Copyright (c) 2017, Software Engineering Group at RWTH Aachen,
# All rights reserved.
#
# This project is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 3.0 of the License, or (at your option) any later version.
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this project. If not, see <http://www.gnu.org/licenses/>.
# *******************************************************************************
#
rm rmi-model-server-*.jar
cp ../target/rmi-model-server-*.jar ./
docker build -t 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