Using Ray as replacement for Celery (generic task executor)

Hello! Thank you for joining the Ray community Charles and sharing your use case with us :smiley:

I’ve done some researched in the docs and I think I have the answers to your questions!

  1. As you can see we need some global vars, workers or task_manager but is it OK to have such global var in the API replica ?

Using global variables like task_manager or workers can work in simple setups, but as your system scales, it can become tricky. Globals can cause issues with state management, concurrency, and fault tolerance. Instead:

Your FastAPI setup seems correct though so I don’t think you necessarily need to change it.

  1. Is it a good way of using Ray workers, are we going to have so issues down the line ?

It seems like a good use case for Ray workers! Don’t really see any issues here :slight_smile: Just make sure to stay on top of resource management.

  1. Do you see things we could do better?

Try out some of the Ray debugging tools to help debug any potential issues that may arise. There’s also some nice user guides out there that might be helpful. I’ll link them here!