When to use runtime_env?

I encountered this with Ray Train but I think it might be similar in Core.
In the docs, runtime_env is mentioned as an advanced feature somewhat obscurely. Advanced Usage — Ray v1.8.0.

I found that whenever I have more than a single python file and one of the files import functions or classes from the other, I need to include the directory in
ray.init(address=…,runtime_env={“working_dir”: “/code/my_project”})

Without it, the imports are not found. I’d think most applications have more than a single script file. Maybe there is a better way to deal with my case? If not, why is this considered advanced usage?

1 Like

I ran into the same issue where our python application requires more than a single python file. It would be nice if we could zip all the files (python module) and submit to the ray client since all the ray work nodes access to the code.