Giter VIP home page Giter VIP logo

quantphile / prometeo-rules-decision Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pyrrha-platform/pyrrha-rules-decision

0.0 0.0 0.0 194 KB

WORK IN PROGRESS - 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 smartphone carried by the firefighters.

License: Apache License 2.0

Dockerfile 0.32% Python 78.88% Shell 20.80%

prometeo-rules-decision's Introduction

Prometeo rules and decision engine

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.

License Slack

Contents

Prerequisites

  1. Docker
  2. IBM CLI
  3. Kubectl
  4. Helm
  5. Skaffold

Run locally with Python

You can run this solution locally in docker as follows

  1. Set up environment variables in the src/.env file
  2. Install mariadb locally
    1. pull mariadb from dockerhub
        docker pull mariadb
    
    1. run the image
        docker run -p 3306:3306 --name prometeo-mariadb -e MYSQL_ROOT_PASSWORD='' -d mariadb
    
    1. Test the image - TBD
  3. Create python virtual environment
         python3 -m venv python3
    
  4. Activate virtual environment
         source python3/bin/activate
    
  5. Run the application
         python src/core_decision_flask_app.py 8080
    
  6. 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
    

Run locally with Docker

  1. Build the image
        docker build . -t rulesdecision
    
  2. Run the image
         docker run -p8080:8080 -t rulesdecision
    
  3. 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)
    

Run on Kubernetes

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

Troubleshooting

  1. Database does not connect
    1. ensure .env file has the correct values for database connection
  2. Change the db password

Built with

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting Prometeo pull requests.

License

This project is licensed under the Apache 2 License - see the LICENSE file for details.

prometeo-rules-decision's People

Contributors

jsegrave-ibm avatar upkarlidder avatar krook avatar narengan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.