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 @@ ...@@ -10,3 +10,5 @@
*.DS_Store *.DS_Store
*.iml *.iml
/restful/src/main/resources/resources /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 image: maven:3-jdk-8
...@@ -55,7 +61,15 @@ branchJobLinux: ...@@ -55,7 +61,15 @@ branchJobLinux:
tags: tags:
- docker - docker
stage: linux stage: linux
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
script: 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 - cd docker
- ./build.sh - ./build.sh
- ./run_test.sh - ./run_test.sh
...@@ -70,6 +84,8 @@ masterJobLinux: ...@@ -70,6 +84,8 @@ masterJobLinux:
before_script: before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
script: script:
# pull the latest RMIServer image
- docker pull registry.git.rwth-aachen.de/monticore/embeddedmontiarc/simulators/rmimodelserver:latest
- cd docker - cd docker
- ./build.sh - ./build.sh
- ./run_test.sh - ./run_test.sh
......
# (c) https://github.com/MontiCore/monticore
script: script:
- git checkout ${TRAVIS_BRANCH} - 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" - 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 # Server
![pipeline](https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/simulators/server/badges/master/build.svg) ![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) ![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 ...@@ -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. __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 cd MontiSim
git clone https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/simulators/RMIModelServer.git git clone https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/simulators/RMIModelServer.git
cd ./RMIModelServer 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. The RMIModelServer is exported to the `install` folder.
A pre-compiled version of the HardwareEmulator is contained in the `install` folder of the RMI server. 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.
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.
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: 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"?> <?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"> <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> <parent>
<artifactId>montisim</artifactId> <artifactId>montisim</artifactId>
......
...@@ -8,6 +8,4 @@ RUN apt-get update && \ ...@@ -8,6 +8,4 @@ RUN apt-get update && \
apt-get install -y --no-install-recommends metis && \ apt-get install -y --no-install-recommends metis && \
rm -rf /var/lib/apt/lists/* && \ rm -rf /var/lib/apt/lists/* && \
mvn install -s settings.xml -DskipTests && \ mvn install -s settings.xml -DskipTests && \
cp rpc/target/rpc-*-jar-with-dependencies.jar rpc/target/rpc.jar && \ 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
<!-- (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> <zone>
<name>World</name> <name>World</name>
<isCustomLogin>false</isCustomLogin> <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" version: "3"
services: services:
...@@ -18,16 +24,9 @@ services: ...@@ -18,16 +24,9 @@ services:
environment: environment:
ZOO_SERVERS: zoo1:2181 ZOO_SERVERS: zoo1:2181
entrypoint: entrypoint:
- java - bash
- -cp - -c
- rmi-model-server.jar - "source ~/.bashrc && java -Djava.rmi.server.useLocalHostname -jar rmi-model-server.jar port=10101 autopilots_folder=autopilots no_time os=windows"
- -Djava.rmi.server.codebase=file:rmi-model-server.jar
- -Djava.rmi.server.useLocalHostname
- rwth.rmi.model.server.RMIServer
- "10101"
- autopilots
- no_time
- os=linux
rpc-server: rpc-server:
image: registry.git.rwth-aachen.de/monticore/embeddedmontiarc/simulators/server:rpc 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 #!/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. # this script serves the purpose of running unitetests in gitlab-runner.
# It starts all dependent services needed before starting the tests. # It starts all dependent services needed before starting the tests.
...@@ -16,7 +22,7 @@ dockerCleanUp(){ ...@@ -16,7 +22,7 @@ dockerCleanUp(){
docker kill rpc-server docker kill rpc-server
docker rm rpc-server docker rm rpc-server
docker network rm simulation-network docker network rm $(docker network ls | grep "simulation-network" |awk '/ / { print $1 }')
} }
dockerCleanUp dockerCleanUp
...@@ -38,7 +44,7 @@ docker run \ ...@@ -38,7 +44,7 @@ docker run \
-d \ -d \
--name=zookeeper \ --name=zookeeper \
-e "ZOO_MAX_CLIENT_CNXNS=1024" \ -e "ZOO_MAX_CLIENT_CNXNS=1024" \
zookeeper:latest zookeeper:3.4
# start autopilot server(RMIServer) # start autopilot server(RMIServer)
docker run \ docker run \
...@@ -47,8 +53,9 @@ docker run \ ...@@ -47,8 +53,9 @@ docker run \
-d \ -d \
-e "ZOO_SERVERS=zookeeper" \ -e "ZOO_SERVERS=zookeeper" \
registry.git.rwth-aachen.de/monticore/embeddedmontiarc/simulators/rmimodelserver:latest \ 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 \ bash -c "source ~/.bashrc &&
-Djava.rmi.server.useLocalHostname rwth.rmi.model.server.RMIServer 10101 autopilots no_time os_linux java -Djava.rmi.server.useLocalHostname -jar rmi-model-server.jar \
port=10101 autopilots_folder=autopilots default_config no_time os=windows"
docker run \ docker run \
--network="simulation-network" \ --network="simulation-network" \
...@@ -57,6 +64,7 @@ docker run \ ...@@ -57,6 +64,7 @@ docker run \
--name=rpc-server \ --name=rpc-server \
rpc-server:latest rpc-server:latest
cd ${CURR_DIR} cd ${CURR_DIR}
#docker build -t server-test-runner -f ./docker/TestDockerfile . #docker build -t server-test-runner -f ./docker/TestDockerfile .
docker run \ docker run \
...@@ -65,6 +73,7 @@ docker run \ ...@@ -65,6 +73,7 @@ docker run \
montisim-server-builder sh -c "cd restful && mvn test -s ../settings.xml" \ montisim-server-builder sh -c "cd restful && mvn test -s ../settings.xml" \
2>&1 | tee result.txt 2>&1 | tee result.txt
dockerCleanUp dockerCleanUp
tail -10 result.txt | grep "BUILD SUCCESS" tail -10 result.txt | grep "BUILD SUCCESS"
...@@ -72,4 +81,3 @@ tail -10 result.txt | grep "BUILD SUCCESS" ...@@ -72,4 +81,3 @@ tail -10 result.txt | grep "BUILD SUCCESS"
code=$? code=$?
echo $code echo $code
exit $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" sqlite3 world.db ".read sqlite-world.sql"
#!/bin/bash #!/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" 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 ( CREATE TABLE area (
id integer NOT NULL PRIMARY KEY AUTOINCREMENT, id integer NOT NULL PRIMARY KEY AUTOINCREMENT,
minx double precision NOT NULL, 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 REM Batch script
SET CONFIG_DIR=main\resources SET CONFIG_DIR=main\resources
......
#!/bin/bash #!/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_DIR="main/resources"
CONFIG_FILE="config.properties" CONFIG_FILE="config.properties"
......
#!/usr/bin/env bash #!/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 # This script re-compile all *.fmu files in the current directory using
# current available c++ compiler. This makes the fmu files compatible with # 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 @@ ...@@ -17,7 +17,7 @@
<properties> <properties>
<revision>2.2.0</revision> <revision>2.2.1</revision>
<maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target> <maven.compiler.target>1.8</maven.compiler.target>
...@@ -100,74 +100,6 @@ ...@@ -100,74 +100,6 @@
</dependency> </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--> <!--Unit test-->
<dependency> <dependency>
<groupId>commons-pool</groupId> <groupId>commons-pool</groupId>
...@@ -190,125 +122,7 @@ ...@@ -190,125 +122,7 @@
<build> <build>
<plugins> <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>-->