How severe does this issue affect your experience of using Ray?
- Low: It annoys or frustrates me for a moment.
For some code I want to have different behaviors when run locally or on ray worker. Is there a standard API / recommended way to do that?
Something like this:
def is_on_ray_worker():
if "ray" in sys.modules:
import ray
if ray.is_initialized():
ctx = ray.get_runtime_context()
if ctx.worker.mode == ray.WORKER_MODE:
return True
return False