- License
- Requirements
- Install dependencies
- Run
- Run with docker-compose
- Test
- Deployment
- Deployment with docker
- Maintainers
findCPcli is released under GPLv3 license.
pip install -r requirements.txt
or
python3 -m pip install -r requirements.txt
- Change Redis and MySQL params on
.env
. - Run celery worker
celery -A src.restapi.celery_app.celery_app worker --loglevel=debug
- Run flower
celery flower -A src.restapi.celery_app.celery_app -port=5555
- Run Flask application
python -m src.restapi.app
See:
-
Swagger-UI API interface
-
Flower management page
First setup variables on .docker.env
.
Assuming you have Docker and docker-compose installed, run on terminal:
docker-compose up
In order to bring it down run:
docker-compose down
pytest -v
- Python>=3.7
- Redis
- MySQL
- GLPK (recommended)
- Gunicorn (recommended).
- Nginx (recommended).
- Supervisor (optional, recommended)
- Change Redis and MySQL params on
.env
. - Run celery worker
celery -A src.restapi.celery_app.celery_app worker --loglevel=info --concurrency=1 &> logs/celery.out
- Run flower
celery flower -A src.restapi.celery_app.celery_app -port=5555
- Run Gunicorn app with unix socket bind and eventlet workers (See Flask-socketIO Deploy)
gunicorn --worker-class eventlet -w 1 --bind unix:/tmp/gunicorn.sock src.restapi.wsgi:app
- Setup and run Nginx according to:
"Supervisor is a client/server system that allows its users to monitor and control a number of processes on UNIX-like operating systems."
"The server piece of supervisor is named supervisord. It is responsible for starting child programs at its own invocation, responding to commands from clients, restarting crashed or exited subprocesseses, logging its subprocess stdout and stderr output, and generating and handling 'events' ". [Source]
To run findCP-webservice with Supervisor:
- Change Redis and MySQL params on
.env
.- Note: Redis can also be run with Supervisor.
- Change the parameters on
supervisor/dev/*
config files accordingly. - Run celery, flower and Gunicorn with supervisor:
cd supervisor/dev/ supervisord -c supervisor.conf
supervisorctl
can be executed with:supervisorctl -s unix:///tmp/supervisor.sock
- Setup and run Nginx as described previously.
For more info see:
See section Run with docker-compose