[serve] Is it possible to run backends with different python versions?

I known how to run backends with different dependencies by using conda envs. But the conda envs must have the same python version. Is it possible to run backends with different python versions?

Hi @cnliusen, Ray disallow two different python versions in the same environment as a pre-caution because it might leads to hard-to-debug errors. However, we are working on several ways to get around this in Ray Serve including using a version agnostic client interface.

I’m happy to learn more about your use case and share the roadmap with you! If you are interested, shoot an email to xmo@anyscale.com and we can set up a time to chat.

Sorry for reviving this old thread. Any update on this?

I’ve been using and largely enjoying Ray Serve for a short while, but having to match the Python version of cluster, all clients and all conda environments hosting deployables is stopping me from using it more widely and advertising it to other team members.

I also believe this requirement needs to be documented more visibly.

Unfortunately it is still a requirement of Ray that all nodes share the same Python version (e.g. 3.7.7). As far as I know there’s no update on a Ray Serve-specific workaround-- cc @simon-mo, do you know what the status is for this?

Right the best we could do in Ray is probably allow the minor version (e.g. 3.7.2 <-> 3.7.7). Talking across Python minor versions (3.6 <-> 3.8) will very likely lead to unintended breakages as Python serialization and libraries are not cross version compatible.

Thanks for the clarifications @architkulkarni and @simon-mo. I hope this will get solved at some point. The developer experience using Ray Serve is fantastic and I’d really like use it more.

Please consider making this limitation more clear in the documentation. Maybe it is noted somewhere, but I certainly didn’t spot it despite going through fairly thoroughly. I had to discover it from the error messages after setting up everything.