How to add adhoc custom modules to cluster path?

How severe does this issue affect your experience of using Ray?

  • Medium: It contributes to significant difficulty to complete my task, but I can work around it.

Hi, I’m using Ray Clusters on Kubernetes (newbie) and would like to be able to run custom classes as actors on the workers, but in an adhoc way. The models I’m running come from external packages (not always known in advance), and I’d like to be able to run them without having to refactor all the classes and/or functions by adding the @ray.remote annotation. Is there a way to copy the codebase for custom modules to the cluster workers on demand (or something similar that would help)?

Does Ray runtime environments help? Environment Dependencies — Ray 2.0.0

The working_dir option sounds like it would be relevant if you just want to copy code to cluster workers. This is not K8s-specific.

As for how to avoid adding @ray.remote everywhere, I’m not sure what the best approach would be. Writing ray.remote(my_class) is equivalent to using the decorator and might be helpful.

Runtime environments worked like a charm for this - thanks!