This is the source code to run api-services server
- api-services
- celery-worker
- flower
- FastAPI: web framework for developing RESTfullAPIs
- Uvicorn: ASGI web server
- Background Tasks: it is a function (or services of fastapi) used for the task that has consumer long time
- AsyncIO function (Task producer)
Some document:
- https://fastapi.tiangolo.com/tutorial/background-tasks/
- https://leimao.github.io/blog/Python-Concurrency-High-Level/
- Celery: The framework that support asynchronous task queue or job queue
- Pool-config
- Logger in celery
- Task consumer
- Flower: web tools which monitoring Celery Tasks / Events (Manage Tasks or Events)
- Redis broker
- Redis database
- Logging file
Run to follow the code
docker compose up -d --build
- API docs
xxxx.xxxx.xxxx.xxxx:8081/api/docs
- Tasks Management
xxxx.xxxx.xxxx.xxxx:5555
- APIs logs: See at folder system_logs/api-services-logs/
- Worker logs: See at folder system_logs/celery-logs/
Please see at: /system_storages/
- Replace Redis_broker to RabbitMQ
- Display CPU consumer with task or event
- Deloy OCR model
- Combine Flower with Prometheus metrics
- Combine Prometheus metrics to Grafana monitoring
License Copyright (c) [2022] [Nguyễn Thái Học nguyenthaihoc1996@outllok.com]