🚧🚧🚧 Work in progress 🚧🚧🚧
Asynchronous Tasks with FastAPI, MongoDB, Redis and Celery with React front end.
Full stack solution incroporating an open source long running solver optimization suite.
Gunicorn is used for managing the Uvicorn workers (ASGI servers). Redis acts as our broker to our celeryworkers, and finally MongoDB to persist data.
A full optimization loop looks like this:
- Client sends Problem data and Solver parameters via POST request. The data will be validated against the the Problem schema and Solver schema, thanks to Pydantic.
- The server will respond with a unique ID back to the client and asynchronously:
- Inserts problem data, solver params into MongoDB under the unique ID
- Send the unique ID to our Celery workers via the Redis broker
- Celery workers pick up the unique ID from the redis broker and pulls the problem data and solver parameters from MongoDB. The worker builds the Solver model instance and starts the opitmization process using the SCIP suite.
- Our Celery worker constantly stores the state of the task in our Redis broker which can be polled.
- A successful optimization updates the record in MongoDB by the unique ID.
- The client can then fetch the results by sending a GET request with the unique ID as a parameter.