SWAMP Application Platform Distribution Package
This project provides an easy and practical way to instantiate the SWAMP Application Platform locally. The SWAMP Application Platform is composed by the following modules:
- SWAMP API (aka Content Provider)
- SWAMP Data Fusion
- SWAMP Weather Forecast Collection
- SWAMP Soil Moisture Forecast
- SWAMP Optimization Service
- SWAMP Root Size Estimation
- SWAMP Water Need Calculation
Install
To download the fill set of files, simply clone this repository:
$ git clone https://git.rnp.br/swamp-essentials/application-platform/application-distribution-package
$ cd application-distribution-package/
Docker and Docker Compose
All the services in this project use lightweight-virtualization in the form of Docker containers. To instantiated the one of the SWAMP subplatforms it is necessary to use Docker Compose - a tool for definign and running multi-container Docker applications. With Compose, we use a *.yaml
file to configure out application's services.
If you do not have Docker and Docker Compose installed yet, follow the instructions here .
You can check your current Docker and Docker Compose versions using the following commands:
$ docker-compose -v
$ docker version
Install
Before the installation and deployment of the Application Platform, there is the need to configure in which IP address is the Orion and QuantumLeap that the Application Platform modules will connect. Normally, both should be set to the IP where the SWAMP IoT Platform is running. For the SWAMP API, this configuration is in the ./installer file:
cat <<EOF > swamp-api/.env
NODE_PORT = 2019
API_VERSION = 'v0'
QL_ADDRESS = < QuantumLeap IP Address >
QL_PORT = 8668
ORION_ADDRESS = < Orion IP Address >
ORION_PORT = 1026
EOF
For the other modules, there is the need to manually change each configuration before running the docker-compose up command. In order to instanciate the containers run the following commands with admin privileges:
$ ./installer.sh
Then:
$ docker-compose up
In order to check if the installation was successful, run:
$ docker ps
The output should be something like this (i.e. 2 docker containers running):
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
bee5b4836d8f application-distribution-package_water-need-calculation "python -u WaterNeed…" About a minute ago Up 17 seconds 0.0.0.0:4040->4040/tcp water-need-calculation
d44b7459aac6 application-distribution-package_root-size-estimation "python -u root_size…" About a minute ago Up 18 seconds 0.0.0.0:5050->5050/tcp root-size-estimation
6ac0ab1c56ca application-distribution-package_swamp-api "node index.js" About a minute ago Up 16 seconds 0.0.0.0:2019->2019/tcp swamp-api
e5a6d484b784 application-distribution-package_soil-moisture-forecast "/tini -- python -u …" About a minute ago Up 19 seconds 0.0.0.0:5000->5000/tcp soil-moisture-forecast