Install Redis, and run the following commands:
$ make env # create a conda environment (need only once)
$ conda activate producer-consumer-fastapi-celery # activate the env
$ make setup # setup packages (need only once)
$
$ make broker # run redis broker
$ make worker # run celery worker
$ make api # run fastapi server
$ make dashboard # run dashboard that monitors celery
Install Docker & Docker Compose, and run the following command:
$ docker-compose up
You can start up additional workers on other devices.
$ export BROKER_URL=redis://redis-broker-ip:6379
$ export BACKEND_URL=redis://redis-backend-ip:6379
$ make worker
Sending a number of requests simultaneously.
$ python src/client.py --n-req [N_REQUSTS]
$ ulimit -n 1024
We recommend to use Linux server if you would like to run docker-compose up
.
$ make setup-dev # setup for developers
$ make format # format scripts
$ make lint # lints scripts
$ make utest # runs unit tests
$ make cov # opens unit test coverage information