Commit 2d887778 authored by Evgeny Kusmenko's avatar Evgeny Kusmenko

Merge branch 'e/e-infrastructure' into 'master'

ee infrastructure

See merge request !27
parents af41c827 fefcc0c2
Pipeline #191312 passed with stages
in 13 minutes and 47 seconds
......@@ -10,3 +10,5 @@
*.DS_Store
*.iml
/restful/src/main/resources/resources
*.jar
/bin/
# (c) https://github.com/MontiCore/monticore
#
# (c) https://github.com/MontiCore/monticore
#
# The license generally applicable for this project
# can be found under https://github.com/MontiCore/monticore.
#
image: maven:3-jdk-8
......@@ -55,7 +61,15 @@ branchJobLinux:
tags:
- docker
stage: linux
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
script:
# clean up
- docker rmi montisim-server-builder
- docker rmi rpc-server
- docker rmi restful-server
# pull the latest RMIServer image
- docker pull registry.git.rwth-aachen.de/monticore/embeddedmontiarc/simulators/rmimodelserver:latest
- cd docker
- ./build.sh
- ./run_test.sh
......@@ -70,6 +84,8 @@ masterJobLinux:
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
script:
# pull the latest RMIServer image
- docker pull registry.git.rwth-aachen.de/monticore/embeddedmontiarc/simulators/rmimodelserver:latest
- cd docker
- ./build.sh
- ./run_test.sh
......
# (c) https://github.com/MontiCore/monticore
script:
- git checkout ${TRAVIS_BRANCH}
- mvn -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -B clean install cobertura:cobertura org.eluder.coveralls:coveralls-maven-plugin:report --settings "settings.xml"
......
<!-- (c) https://github.com/MontiCore/monticore -->
# Server
![pipeline](https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/simulators/server/badges/master/build.svg)
![coverage](https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/simulators/server/badges/master/coverage.svg)
......@@ -69,17 +68,15 @@ or download the project as a [.zip file](https://github.com/MontiSim/server/arch
__NOTE:__ _MontiSim_ is the directory, in which MontiSim-belonging projects should be clonned. It has to be manually created.
Additionally [RMIModelServer](https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/simulators/RMIModelServer) repository has to be cloned, in order to be used and to allow integration of external vehicle autopilot models. This can be done via the following commands:
The [RMIModelServer repository](https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/simulators/RMIModelServer) has to be cloned and compiled to allow the integration of external vehicle autopilot models (*EMADL models*). This can be done via the following commands:
cd MontiSim
git clone https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/simulators/RMIModelServer.git
cd ./RMIModelServer
./scripts/compile_install.bat or ./scripts/compile_install.sh
mvn clean install -s settings.xml
The RMIModelServer uses the [HardwareEmulator](https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/simulators/hardware_emulator) project to run the autopilots.
A pre-compiled version of the HardwareEmulator is contained in the `install` folder of the RMI server.
The install folder also contains a `run.bat` / `run.sh` script that starts the RMI server within the install folder and uses the `autopilots` folder it contains to load autopilots.
The install folder has to be updated if a new version of the _HardwareEmulator_ is used.
The RMIModelServer is exported to the `install` folder.
It contains a `run.bat` / `run.sh` script that starts the RMI server within the install folder and uses the `autopilots` folder it contains to load autopilots.
To use an external vehicle autopilot, one has to clone the corresponding repository. For the _Autopilot emam_ vehicle model, located in [Autopilot emam repository](https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/simulators/EMAM-showcase), the following commands have to be executed:
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- (c) https://github.com/MontiCore/monticore -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>montisim</artifactId>
......
......@@ -8,6 +8,4 @@ RUN apt-get update && \
apt-get install -y --no-install-recommends metis && \
rm -rf /var/lib/apt/lists/* && \
mvn install -s settings.xml -DskipTests && \
cp rpc/target/rpc-*-jar-with-dependencies.jar rpc/target/rpc.jar && \
find restful/target -regex '.*restful-[0-9.]+\.jar' | \
xargs -i cp {} restful/target/restful.jar
cp rpc/target/rpc-jar-with-dependencies.jar rpc/target/rpc.jar
<!-- (c) https://github.com/MontiCore/monticore -->
<!--
(c) https://github.com/MontiCore/monticore
The license generally applicable for this project
can be found under https://github.com/MontiCore/monticore.
-->
<zone>
<name>World</name>
<isCustomLogin>false</isCustomLogin>
......
# (c) https://github.com/MontiCore/monticore
#
# (c) https://github.com/MontiCore/monticore
#
# The license generally applicable for this project
# can be found under https://github.com/MontiCore/monticore.
#
version: "3"
services:
......@@ -18,16 +24,9 @@ services:
environment:
ZOO_SERVERS: zoo1:2181
entrypoint:
- java
- -cp
- rmi-model-server.jar
- -Djava.rmi.server.codebase=file:rmi-model-server.jar
- -Djava.rmi.server.useLocalHostname
- rwth.rmi.model.server.RMIServer
- "10101"
- autopilots
- no_time
- os=linux
- bash
- -c
- "source ~/.bashrc && java -Djava.rmi.server.useLocalHostname -jar rmi-model-server.jar port=10101 autopilots_folder=autopilots no_time os=windows"
rpc-server:
image: registry.git.rwth-aachen.de/monticore/embeddedmontiarc/simulators/server:rpc
......
#
# (c) https://github.com/MontiCore/monticore
#
# The license generally applicable for this project
# can be found under https://github.com/MontiCore/monticore.
#
FROM postgres:latest
COPY ./db-create-script.sql /docker-entrypoint-initdb.d/
\ No newline at end of file
This diff is collapsed.
#!/usr/bin/env bash
# (c) https://github.com/MontiCore/monticore
#
# (c) https://github.com/MontiCore/monticore
#
# The license generally applicable for this project
# can be found under https://github.com/MontiCore/monticore.
#
# this script serves the purpose of running unitetests in gitlab-runner.
# It starts all dependent services needed before starting the tests.
......@@ -16,7 +22,7 @@ dockerCleanUp(){
docker kill rpc-server
docker rm rpc-server
docker network rm simulation-network
docker network rm $(docker network ls | grep "simulation-network" |awk '/ / { print $1 }')
}
dockerCleanUp
......@@ -38,7 +44,7 @@ docker run \
-d \
--name=zookeeper \
-e "ZOO_MAX_CLIENT_CNXNS=1024" \
zookeeper:latest
zookeeper:3.4
# start autopilot server(RMIServer)
docker run \
......@@ -47,8 +53,9 @@ docker run \
-d \
-e "ZOO_SERVERS=zookeeper" \
registry.git.rwth-aachen.de/monticore/embeddedmontiarc/simulators/rmimodelserver:latest \
java -cp rmi-model-server.jar -Djava.rmi.server.codebase=file:rmi-model-server.jar \
-Djava.rmi.server.useLocalHostname rwth.rmi.model.server.RMIServer 10101 autopilots no_time os_linux
bash -c "source ~/.bashrc &&
java -Djava.rmi.server.useLocalHostname -jar rmi-model-server.jar \
port=10101 autopilots_folder=autopilots default_config no_time os=windows"
docker run \
--network="simulation-network" \
......@@ -57,6 +64,7 @@ docker run \
--name=rpc-server \
rpc-server:latest
cd ${CURR_DIR}
#docker build -t server-test-runner -f ./docker/TestDockerfile .
docker run \
......@@ -65,6 +73,7 @@ docker run \
montisim-server-builder sh -c "cd restful && mvn test -s ../settings.xml" \
2>&1 | tee result.txt
dockerCleanUp
tail -10 result.txt | grep "BUILD SUCCESS"
......@@ -72,4 +81,3 @@ tail -10 result.txt | grep "BUILD SUCCESS"
code=$?
echo $code
exit $code
@rem (c) https://github.com/MontiCore/monticore
@REM
@REM (c) https://github.com/MontiCore/monticore
@REM
@REM The license generally applicable for this project
@REM can be found under https://github.com/MontiCore/monticore.
@REM
sqlite3 world.db ".read sqlite-world.sql"
#!/bin/bash
# (c) https://github.com/MontiCore/monticore
#
# (c) https://github.com/MontiCore/monticore
#
# The license generally applicable for this project
# can be found under https://github.com/MontiCore/monticore.
#
sqlite3 world_linux.db ".read sqlite-world.sql"
--
-- (c) https://github.com/MontiCore/monticore
--
-- The license generally applicable for this project
-- can be found under https://github.com/MontiCore/monticore.
--
CREATE TABLE area (
id integer NOT NULL PRIMARY KEY AUTOINCREMENT,
minx double precision NOT NULL,
......
--
-- (c) https://github.com/MontiCore/monticore
--
-- The license generally applicable for this project
-- can be found under https://github.com/MontiCore/monticore.
--
@rem (c) https://github.com/MontiCore/monticore
@REM
@REM (c) https://github.com/MontiCore/monticore
@REM
@REM The license generally applicable for this project
@REM can be found under https://github.com/MontiCore/monticore.
@REM
REM Batch script
SET CONFIG_DIR=main\resources
......
#!/bin/bash
# (c) https://github.com/MontiCore/monticore
#
# (c) https://github.com/MontiCore/monticore
#
# The license generally applicable for this project
# can be found under https://github.com/MontiCore/monticore.
#
CONFIG_DIR="main/resources"
CONFIG_FILE="config.properties"
......
#!/usr/bin/env bash
# (c) https://github.com/MontiCore/monticore
#
# (c) https://github.com/MontiCore/monticore
#
# The license generally applicable for this project
# can be found under https://github.com/MontiCore/monticore.
#
# This script re-compile all *.fmu files in the current directory using
# current available c++ compiler. This makes the fmu files compatible with
......
sim Aachen {
sim_duration 4h;
time 12:00;
map_name Aachen.osm;
car1(150.0,120.0,0.0)->(212.0,296.0,0.0);
}
sim Aachen {
sim_duration 4h;
time 12:00;
map_name Aachen.osm;
car1(150.0,120.0,0.0)->(212.0,296.0,0.0);
car2(212.0,296.0,0.0)->(150.0,120.0,0.0)
}
#
# (c) https://github.com/MontiCore/monticore
#
# The license generally applicable for this project
# can be found under https://github.com/MontiCore/monticore.
#
map=/extensions/AllInOne/aachen.osm
mapName=Aachen2
flat_map=true
map_overlap=210
map_sector_width=1000
map_sector_length=1000
max_sector_users=20
weather_rain=0
frame_loop_frequency=30
cache_buffer=8500
rmi_host=127.0.0.1
rmi_port=10101
v_model=AutopilotAdapter
......@@ -17,7 +17,7 @@
<properties>
<revision>2.2.0</revision>
<revision>2.2.1</revision>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
......@@ -100,74 +100,6 @@
</dependency>
<!-- MontiSim -->
<!-- <dependency>-->
<!-- <groupId>montisim</groupId>-->
<!-- <artifactId>commons</artifactId>-->
<!-- <version>1.0.6</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>montisim-controller</groupId>-->
<!-- <artifactId>library</artifactId>-->
<!-- <version>${montisim.version}</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>montisim-controller</groupId>-->
<!-- <artifactId>control</artifactId>-->
<!-- <version>${montisim.version}</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>montisim-controller</groupId>-->
<!-- <artifactId>navigation</artifactId>-->
<!-- <version>${montisim.version}</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>montisim-simulation</groupId>-->
<!-- <artifactId>environment</artifactId>-->
<!-- <version>2.0.0</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>montisim-simulation</groupId>-->
<!-- <artifactId>vehicle</artifactId>-->
<!-- <version>2.0.0</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>montisim-simulation</groupId>-->
<!-- <artifactId>sensors</artifactId>-->
<!-- <version>2.0.0</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>montisim-simulation</groupId>-->
<!-- <artifactId>network</artifactId>-->
<!-- <version>2.0.0</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>montisim-simulation</groupId>-->
<!-- <artifactId>simulator</artifactId>-->
<!-- <version>2.0.0</version>-->
<!-- </dependency>-->
<!-- &lt;!&ndash; Autopilot &ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>montisim</groupId>-->
<!-- <artifactId>example-autopilot-ema</artifactId>-->
<!-- <version>0.0.5</version>-->
<!-- </dependency>-->
<!-- &lt;!&ndash; SimLong &ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>de.monticore.lang.montisim</groupId>-->
<!-- <artifactId>SimLang</artifactId>-->
<!-- <version>1.0.1</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>de.monticore.lang.montisim</groupId>-->
<!-- <artifactId>Util</artifactId>-->
<!-- <version>1.0.1</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>de.monticore.lang.montisim</groupId>-->
<!-- <artifactId>Weather</artifactId>-->
<!-- <version>1.0.1</version>-->
<!-- </dependency>-->
<!--Unit test-->
<dependency>
<groupId>commons-pool</groupId>
......@@ -190,125 +122,7 @@
<build>
<plugins>
<!-- <plugin>-->
<!-- <artifactId>maven-deploy-plugin</artifactId>-->
<!-- <version>2.8.1</version>-->
<!-- </plugin>-->
<!-- Other Configuration -->
<!-- <plugin>-->
<!-- <artifactId>maven-compiler-plugin</artifactId>-->
<!-- <version>${compiler.plugin}</version>-->
<!-- <configuration>-->
<!-- <useIncrementalCompilation>true</useIncrementalCompilation>-->
<!-- <source>${java.version}</source>-->
<!-- <target>${java.version}</target>-->
<!-- </configuration>-->
<!-- </plugin>-->
<!--<plugin>-->
<!--<groupId>org.codehaus.mojo</groupId>-->
<!--<artifactId>exec-maven-plugin</artifactId>-->
<!--<version>1.6.0</version>-->
<!--<executions>-->
<!--<execution>-->
<!--<id>Deploy</id>-->
<!--<phase>package</phase>-->
<!--<goals>-->
<!--<goal>exec</goal>-->
<!--</goals>-->
<!--</execution>-->
<!--</executions>-->
<!--<configuration>-->
<!--<executable>${project.basedir}/docs/scripts/deploy${script.extension}</executable>-->
<!--</configuration>-->
<!--</plugin>-->
<!-- <plugin>-->
<!-- <groupId>org.apache.maven.plugins</groupId>-->
<!-- <artifactId>maven-shade-plugin</artifactId>-->
<!-- <version>2.4.3</version>-->
<!-- <executions>-->
<!-- <execution>-->
<!-- <phase>package</phase>-->
<!-- <goals>-->
<!-- <goal>shade</goal>-->
<!-- </goals>-->
<!-- <configuration>-->
<!-- &lt;!&ndash; Exclude signatures &ndash;&gt;-->
<!-- <filters>-->
<!-- <filter>-->
<!-- <artifact>*:*</artifact>-->
<!-- <excludes>-->
<!-- <exclude>META-INF/*.SF</exclude>-->
<!-- <exclude>META-INF/*.DSA</exclude>-->
<!-- <exclude>META-INF/*.RSA</exclude>-->
<!-- </excludes>-->
<!-- </filter>-->
<!-- </filters>-->
<!-- <transformers>-->
<!-- <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">-->
<!-- <mainClass>package rwth.server.extensions.ZoneExt</mainClass>-->
<!-- </transformer>-->
<!-- </transformers>-->
<!-- <outputFile>${sfs.extensions}/${project.name}.jar</outputFile>-->
<!-- </configuration>-->
<!-- </execution>-->
<!-- </executions>-->
<!-- </plugin>-->
<!-- Source Jar Configuration -->
<!-- <plugin>-->
<!-- <groupId>org.apache.maven.plugins</groupId>-->
<!-- <artifactId>maven-source-plugin</artifactId>-->
<!-- <version>${source.plugin}</version>-->
<!-- <executions>-->
<!-- <execution>-->
<!-- <id>create source jar</id>-->
<!-- <phase>package</phase>-->
<!-- <goals>-->
<!-- <goal>jar-no-fork</goal>-->
<!-- </goals>-->
<!-- <configuration>-->
<!-- <excludeResources>false</excludeResources>-->
<!-- <includes>-->
<!-- <include>**/*.java</include>-->
<!-- <include>**/*.ftl</include>-->
<!-- </includes>-->
<!-- </configuration>-->
<!-- </execution>-->
<!-- </executions>-->
<!-- </plugin>-->
<!-- to add copyright information automatically-->
<!--
<plugin>
<groupId>com.mycila</groupId>
<artifactId>license-maven-plugin</artifactId>
<version>3.0</version>
<configuration>
<header>${project.baseUri}/src/license/se/license.txt</header>
<properties>
<owner>Michael von Wenckstern</owner>
<email>vonwenckstern@se-rwth.de</email>
</properties>
<excludes>
<exclude>**/README</exclude>
<exclude>src/test/resources/**</exclude>
<exclude>src/main/resources/**</exclude>
<exclude>src/license/**</exclude>
</excludes>
</configuration>
<executions>
<execution>
<goals>
<goal>format</goal>
</goals>
<phase>process-sources</phase>
</execution>
</executions>
</plugin>
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
......@@ -323,17 +137,6 @@
<configuration>
</configuration>
</plugin>
<!-- <plugin>-->
<!-- <groupId>org.codehaus.mojo</groupId>-->
<!-- <artifactId>cobertura-maven-plugin</artifactId>-->
<!-- <version>2.7</version>-->
<!-- <configuration>-->
<!-- <format>xml</format>-->
<!-- <maxmem>256m</maxmem>-->
<!-- &lt;!&ndash; aggregated reports for multi-module projects &ndash;&gt;-->
<!-- <aggregate>true</aggregate>-->
<!-- </configuration>-->
<!-- </plugin>-->
<!-- Test coverage -->
<plugin>
......
#
# (c) https://github.com/MontiCore/monticore
#
# The license generally applicable for this project
# can be found under https://github.com/MontiCore/monticore.
#
FROM openjdk:8-jdk
WORKDIR /app
......
<!-- (c) https://github.com/MontiCore/monticore -->
This is the simulation server module. It provides a set of RESTful APIs for setting up, running simulation and also
retrieving the results.
......
#!/usr/bin/env bash
# (c) https://github.com/MontiCore/monticore
#
# (c) https://github.com/MontiCore/monticore
#
# The license generally applicable for this project
# can be found under https://github.com/MontiCore/monticore.
#
docker build -t restful-server .