Distibuted ML-based service prototype.
Web: FastAPI
ML: scikit-learn
Task Management: Celery
Tasks Queue: RabbitMQ
Results backend: Redis
Make sure a have a Docker CLI and docker-compose executable on your machine:
docker --version
docker-compose --version
Create a folder named env
on project root
and put values-dev.env
file on that folder:
mkdir env
touch env/values-dev.env
Fill the values-dev.env
file with values:
APP_REDIS_HOST="redis"
APP_REDIS_PORT=6379
APP_REDIS_DB=0
APP_RABBITMQ_HOST='rabbitmq'
APP_RABBITMQ_PORT=5672
APP_RABBITMQ_USERNAME="user"
APP_RABBITMQ_PASSWORD="pwd"
APP_ML_N_ESTIMATORS=100
APP_ML_MAX_DEPTH=10
APP_ML_MIN_SAMPLES_ON_LEAF=2
APP_ML_CRITERION="entropy"
APP_ML_TEST_SIZE=0.05
Finally build / pull all needed images and run the deployment
docker-compose build
docker-compose up -d
You`ll see a message that Uvicorn instance is running on localhost:8080
You can see API docs at http://0.0.0.0:8080/docs endpoint.