This repository aims to provide the cloud backend for the Elastic-AI implementation. It uses MQTT as the backend for the pub-sub-based messaging protocol and is build to be used in combination with the Elastic-AI Node v5.
For compiling the project, the required tools are:
-
Java Development Kit (JDK) version 22
-
Docker (Container Runtime)
💡
|
You can check if your local machine satisfies the required dependencies by executing test script in the root folder. |
We recommend using pre-commit to check that the commit messages align with the conventional commit message standard enforced by the merge workflows!
❗
|
HOST_IP
The # MacOS
export HOST_IP=$(ipconfig getifaddr en0)
# Linux
export HOST_IP=$(hostname -I) before starting the monitor (with docker or locally). |
Unit tests and integration tests can be executed independently.
Both use jacoco to finalize the tests with a report that shows the test results and the code coverage.
The reports can be found in the location build/reports/
relative to the corresponding build file.
Command | Task |
---|---|
|
Run all unit tests |
|
Run unit tests from specific subproject |
|
Run all Integration test |
|
Run integration tests from specific subproject |
The runtime is meant to provide the necessary functions to implement a backend for the elastic-ai ecosystem. It provides the functionality to operate the ecosystem, like the implementation of the Twin concept or the MQTT Client implementation together with the necessary functions to handle the interactions with the MQTT Broker.
The Elastic-AI ecosystem provides two applications.
-
Monitor (General purpose to monitor all clients)
-
BallChallenge (Specific implementation for the Ball Challenge example)
To start a application locally via Gradle run
./gradlew :applications:<target>:run
The monitor is used to provide an external interface for the user to interact with the Elastic-AI ecosystem. This interface is provided via a SpringBoot web application, which can be accessed with your default browser like
-
Google Chrome
-
Firefox
-
Safari
-
…
for example. To start the monitor locally via Gradle with the default parameter, execute
./gradlew :monitor:run
if you want to change the parameter for the broker ip and port you can pass these arguments by appending --args"-b <broker_ip> -p <broker_port>"
to the run command.
The monitor can then be accessed from your local machine at http://localhost:80.
🔥
|
If you want to access the monitor from external devices, you have redirected your local endpoint to a port accessible through your firewall! |
A docker container for a subproject can be created with:
./gradlew :<subproject>:jibDockerBuild
This container can then be used in a docker-compose file or started manually.
A Container should be run with:
docker run \
--rm \ #(1)
--network=runtime-network \ #(2)
--publish 8081:80 \ #(3)
--name <subproject> \ #(4)
<subproject:tag>
-
Remove the container after shutdown
-
Required to communicate with the docker container running the MQTT broker
-
Port mapping for the webserver port, which allows the webinterface to be accessible from your browser (host:container)
-
Specify the name of the container
❗
|
Monitor
The Monitor requires the additional flag |