This repository contains the Prometeo solution application for determining thresholds in toxin exposure measured by the sensor device and sent to the cloud from the Samsung smartphone carried by the firefighters.
This service wakes up every minute and calculates time weighted average exposures for all fire fighters and compares them to the configured limits.
You can run this solution locally in docker as follows
- Set up environment variables in the
src/.env
file - Install mariadb locally
- pull mariadb from dockerhub
docker pull mariadb
- run the image
docker run -p 3306:3306 --name prometeo-mariadb -e MYSQL_ROOT_PASSWORD='' -d mariadb
- Test the image - TBD
- Create python virtual environment
python3 -m venv python3
- Activate virtual environment
source python3/bin/activate
- Run the application
python src/core_decision_flask_app.py 8080
- You should see the following output
starting application * Serving Flask app "core_decision_flask_app" (lazy loading) * Environment: production WARNING: Do not use the development server in a production environment. Use a production WSGI server instead. * Debug mode: off
- Running on http://0.0.0.0:8080/ (Press CTRL+C to quit)
- Build the image
docker build . -t rulesdecision
- Run the image
docker run -p8080:8080 -t rulesdecision
- You should see the application logs
starting application * Serving Flask app "core_decision_flask_app" (lazy loading) * Environment: production WARNING: Do not use the development server in a production environment. Use a production WSGI server instead. * Debug mode: off * Running on http://0.0.0.0:8080/ (Press CTRL+C to quit)
You can run this application on Kubernetes. The skaffold.yaml file let's you quickly run the application on the cluster by using Skaffold. There are two profiles provided. To run the solution on the test
namespace use:
skaffold dev -p test
- Database does not connect
- ensure
.env
file has the correct values for database connection
- ensure
- Change the db password
- Docker
- MariaDB
- Flask
- IBM Kubernetes Service
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting Prometeo pull requests.
This project is licensed under the Apache 2 License - see the LICENSE file for details.