Skip to content

maestro-server/analytics-maestro

Repository files navigation

Codacy Badge Build Status Maintainability Test Coverage

Maestro Server

Maestro Server is an open source software platform for management and discovery servers, apps and system for Hybrid IT. Can manage small and large environments, be able to visualize the latest multi-cloud environment state.

Demo

To test out the demo, Demo Online

Documentation

Maestro Server - Analytics API

Accountant to get and create a application dependency tree and build diagrams:

  • Create business graphs
  • Drawing diagrams

arch

Core API:

  • Create grids
  • Create bussiness graph
  • Create network graph
  • Create infra graph
  • Drawing
  • SVGs

TechStack

  • Python 3.6
  • Flask 1.0.2
  • SvgWrite
  • NetworkX

Service dependencies

  • Maestro Data
  • Maestro Analytics Front

Setup

Installation by docker

docker run -p 5020
    -e "MAESTRO_DATA_URI=http://localhost:5010"
    -e "CELERY_BROKER_URL=amqp://rabbitmq:5672"
    -e 'MAESTRO_MONGO_URI=localhost'
    maestroserver/analytics-maestro

docker run
    -e "MAESTRO_DATA_URI=http://localhost:5010"
    -e "MAESTRO_ANALYTICS_FRONT_URI=http://localhost:9999"
    -e "CELERY_BROKER_URL=amqp://rabbitmq:5672"
    maestroserver/analytics-maestro-celery

Or by docker-compose

version: '2'

services:
    analytics:
        image: maestroserver/analytics-maestro
        ports:
        - "5020:5020"
        environment:
        - "CELERY_BROKER_URL=amqp://rabbitmq:5672"
        - "MAESTRO_DATA_URI=http://data:5010"

    analytics_worker:
        image: maestroserver/analytics-maestro-celery
        environment:
        - "MAESTRO_DATA_URI=http://data:5010"
        - "MAESTRO_ANALYTICS_FRONT_URI=http://analytics_front:9999"
        - "CELERY_BROKER_URL=amqp://rabbitmq:5672"
        - "CELERYD_MAX_TASKS_PER_CHILD=2"

Dev Env

Run python and celery.

cd devtools/

docker-compose up -d

Configure rabbitmq service in .env file

CELERY_BROKER_URL="amqp://localhost:5672"
CELERYD_TASK_TIME_LIMIT=30

Install pip dependences

pip install -r requeriments.txt

Run server

python -m flask run.py

or

FLASK_APP=run.py FLASK_DEBUG=1 flask run

or 

npm run server

Run workers

celery -A app.celery worker -E -Q discovery --hostname=discovery@%h --loglevel=info

or 

npm run celery

Run all tests

python -m unittest discover

Create doc

npm install
apidoc -i app/controller/ -o docs/

or 

npm run docs

Important notes

  • Controller used only graph to start all tasks:

  • The drawer process is compound by:

    • entry: First task, figure out all entry applications accordingly system endpoint parameters, our any direct application if avalaible.

    • graphlookup: Request for Data App a aggregate query using MongoDB $graphLookup.

    • network bussiness: Construct Grid Map, and send to enrichment and info bussines.

    • enrichment: Request for Data App all servers used on grid.

    • info bussiness: Calculate histogram, counts, density and connections.

    • network client: Request for Data App all clients used in grid.

    • draw bussiness: Create svgs based of grid.

    • notification: Send updates for Data App.

    • send front app: Send svgs to Analytics Front app.

  • Each step have unique task.

    • Config is managed by env variables, need to be, because in production env like k8s is easier to manager the pods.

    • Repository it's pymongo objects.

Env variables

Env Variables Example Description
MAESTRO_PORT 5020 API Port
MAESTRO_DATA_URI http://localhost:5010 Data Layer API URL
MAESTRO_ANALYTICS_FRONT_URI http://localhost:9999 Analytics Front URL
MAESTRO_WEBSOCKET_URI http://localhost:8000 Webosocket App - API URL
MAESTRO_WEBSOCKET_SECRET XXXX Secret Key - JWT Websocket connections
MAESTRO_SECRETJWT_PRIVATE XXX Secret Key - JWT private connections
MAESTRO_NOAUTH XXX Secret Pass to validate private connections
MAESTRO_GWORKERS 2 Prefetch used in translate worker
CELERY_BROKER_URL amqp://rabbitmq:5672 Rabbitmq URL
CELERYD_TASK_TIME_LIMIT 10 Timeout - worker

Contribute

Are you interested in developing Maestro Server, creating new features or extending them?

We created a set of documentation, explaining how to set up your development environment, coding styles, standards, learn about the architecture and more. Welcome to the team and contribute with us.

See our developer guide

Contact

We may be able to resolve support queries via email. Please send me a message here

Donate

I have made Maestro Server with my heart, think to solve a real operation IT problem. Its not easy, take time and resources.

The donation will be user to:

  • Create new features, implement new providers.
  • Maintenance libs, securities flaws, and technical points.

Buy Me A Coffee

Sponsor