This repository contains the sources of the Thinking application, which has been developed and employed as use case for (fault-aware) management protocols. If you wish to reuse this application, please cite the following paper:
@article{fault-aware-management-protocols,
title = {Fault-aware management protocols for multi-component applications},
journal = {Journal of Systems and Software},
volume = {139},
pages = {189 - 210},
year = {2018},
issn = {0164-1212},
doi = {10.1016/j.jss.2018.02.005},
author = {Antonio Brogi and Andrea Canciani and Jacopo Soldani}
}
Thinking is composed by three main components:
- An instance of MongoDB that is exploited to permanently store the collection of thoughts shared by end-users,
- a Dropwizard-based REST API that permits remotely accessing the collection of shared thoughts, and
- a web-based GUI that interacts with the REST API to permit retrieving and adding thoughts to the shared collection.
The MongoDB instance is obtained by instantiating a Mongo Docker container, while ThoughtsApi and ThoughtsGui are made concrete by hosting them on a Maven Docker container and on a Node Docker container.
The MongoDB instance is obtained by instantiating a mongo Docker container (called thinkingdb) which exposes a port p for connecting to it. For instance, if p is 27017:
docker run -name thinkingdb -p 27017:27017 -d mongo
The REST API is thought to run in a maven container. To set up the application please proceed as follows:
(a) Download the repository. (In the following we will assume to have downloaded it in $PWD/thoughts-api)
(b) Run a maven container (called thoughtsapi). The container should be run in interactive mode, by specifying the volume where to retrieve the API sources (e.g., $PWD/api, which has to be mapped to /thoughts-api) and the host's port where to map the container's port 8080 (e.g., 8282).
docker run -it -v "$PWD/thoughts-api":/thoughts-api -p 8282:8080 --name thinkingapi maven /bin/bash
(c) Install the REST API in the container.
thoughts-api/scripts/install.sh
(d) Configure the application to connect it to thinkingdb
thoughts-api/scripts/configure.sh 172.17.0.1 27017 thoughtsSharing thoughts
(e) Start the application offering the REST API.
thoughts-api/scripts/start.sh
The web-based GUI is thought to be offered through a node container. To set up the application please proceed as follows:
(a) Download the repository. (In the following we will assume to have downloaded it in $PWD/thoughts-gui)
(b) Run a node container (called thoughtsgui) in interactive mode, by also indicating the host's port where to map the container's port 3000.
docker run -it -v "$PWD/gui":/thoughts-gui -p 3000:3000 --name thinkinggui node /bin/bash
(c) Install the web-based GUI in the container.
thoughts-gui/scripts/install.sh
(d) Configure the web-based GUI to connect it to the running instance of the REST API:
thoughts-gui/scripts/configure.sh localhost 8282 thoughts
(e) Start the NodeJS server offering the web-based GUI.
thoughts-gui/scripts/start.sh
Once started, the web-based GUI can be accessed by connecting to https://localhost:3000/thoughts.html
A MongoDB instance can be managed as follows.
- Run ->
docker run -name thinkingdb -p 27017:27017 -d mongo - Start ->
docker start thinkingdb - Stop ->
docker stop thinkingdb - Delete ->
docker rm thinkingdb
To install, configure, start, stop or uninstall an instance of the REST API, please use the corresponding bash script (available in the api/scripts sub-folder) in a running instance of a maven container.
To install, configure, start, stop or uninstall an instance of the web-based GUI, please use the corresponding bash script (available in the gui/scripts sub-folder) in a running instance of a node container.