Commit 62bfe4a4 authored by Evgeny Kusmenko's avatar Evgeny Kusmenko

Merge branch 'prototype' into 'master'

Prototype

See merge request !23
parents fcdc9002 1d1c9ba3
Pipeline #147398 passed with stage
in 1 minute and 18 seconds
......@@ -10,7 +10,7 @@ $ mvn clean install -settings=../settings.xml
```
Run the server:
```
$ java -jar ./target/restful.jar
$ java -jar ./target/restful-2.0.0.jar
```
It is also fine to start the server using your IDE, the main class is located at `src/main/java/server/restful/Server.java`.
......@@ -31,6 +31,18 @@ with arbitrary maps and scenarios.
Checkout the installation guide [here](https://zookeeper.apache.org/doc/r3.1.2/zookeeperStarted.html#ch_GettingStarted) and
[here](https://medium.com/@shaaslam/installing-apache-zookeeper-on-windows-45eda303e835).
After installation, start the ZooKeeper server. By default, it should be listening at **localhost:2181**.
Linux users can install and start the ZooKeeper server with:
```bash
$ apt-get install zookeeper
$ sudo bash /usr/share/zookeeper/bin/zkServer.sh start
```
Mac users:
```bash
$ brew install zookeeper
$ brew services start zookeeper
```
Windows users should install the ZooKeeper server manually, which takes a few more steps. Please checkout
the installation guide above.
### RMIModelServer
Please refer to [RMIModelServer](https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/simulators/RMIModelServer) for installation guide.
......@@ -128,7 +140,7 @@ To enable visualization, put the static files under `restful/src/main/resources/
Aa an example, to use the visualization provided in [visualization repo](https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/simulators/visualization),
copy everything from [webapp directory](https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/simulators/visualization/tree/master/src/main/webapp) into
`restful/src/main/resources/resources`.
Start the restful server, the visualization client will be available at [http://localhost:8080/index.html](http://localhost:8080/index.html)
Start the restful server, the visualization client will be available at [http://127.0.0.1:8090/index.html](http://127.0.0.1:8090/index.html)
## Simulation via RESTful API
......@@ -145,4 +157,4 @@ The sequence should be:
## API Documentation
The APIs are defined using OpenAPI2.0 in `openapi.yml`.
However, the restful server also provides an auto generated API documentation page at
[http://localhost:8080/swagger-ui.html](http://localhost:8080/swagger-ui.html).
[http://127.0.0.1:8090/swagger-ui.html](http://127.0.0.1:8090/swagger-ui.html).
#!/usr/bin/env bash
cp ./target/classes/app.db app.db
cp ./target/restful.jar app.jar
cp ./target/restful-2.0.0.jar app.jar
docker build -t restful-server .
......
......@@ -33,7 +33,7 @@ services:
- zoo1
ports:
- 8787:8787
- 8080:8080
- 8090:8090
restart: always
environment:
ZOO_SERVERS: zoo1:2181
......
......@@ -224,7 +224,7 @@
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
<finalName>restful</finalName>
<!--<finalName>restful</finalName>-->
</build>
<distributionManagement>
......
......@@ -4,4 +4,4 @@ spring.resources.chain.cache=true
# file upload size limit
spring.servlet.multipart.max-file-size=10MB
spring.servlet.multipart.max-request-size=10MB
server.port=8080
\ No newline at end of file
server.port=8090
\ No newline at end of file
sim Aachen {
sim_duration 4h;
time 12:00;
map_name Aachen.osm;
car1(6.055010, 50.778225, 0)->(6.055965, 50.779303, 0.0);
}
sim LowFriction {
sim_duration 4h;
time 12:00;
map_name straight.osm;
pedestrian_density 0;
car1(5.88133850,50.8354390,0)->(5.8813333,50.8355156,0);
car2(5.881250,50.835874,0)->(5.881180,50.836050,0);
}
sim LowFriction {
sim_duration 4h;
time 12:00;
map_name straight.osm;
pedestrian_density 0;
car1(5.88133850,50.8354390,0)->(5.8801073,50.8394046,0);
}
......@@ -7,7 +7,7 @@ $ mvn clean install -settings=../settings.xml
```
Run the rpc server at **localhost:6000**:
```
$ java -cp "target/rpc.jar" server.rpc.RpcServer 6000
$ java -cp "target/rpc-2.0.0-jar-with-dependencies.jarr" server.rpc.RpcServer 6000
```
Or use IDE to start the main class at `/Users/ham/Projects/MontiSim/server/rpc/src/main/java/server/rpc/RpcServer.java`.
Don't forget to set the program argument telling rpc server on which port it should listen.
......
#!/usr/bin/env bash
cp ../libs/fmu_for_linux/* ./
cp ./target/rpc.jar ./simulator-rpc.jar
cp ./target/rpc-2.0.0-jar-with-dependencies.jar ./simulator-rpc.jar
docker build -t rpc-server .
......
......@@ -225,7 +225,7 @@
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<appendAssemblyId>false</appendAssemblyId>
<!--<appendAssemblyId>false</appendAssemblyId>-->
</configuration>
<executions>
<execution>
......@@ -238,7 +238,7 @@
</executions>
</plugin>
</plugins>
<finalName>rpc</finalName>
<!--<finalName>rpc</finalName>-->
</build>
</project>
\ No newline at end of file
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