A way to share a job id between two python processes that run ray.init()?

  • High: It blocks me to complete my task – looking for a solution or a workaround.

Hello,

Is there a way to share job id between two python processes that run ray.init()?

Let’s say there’s p1.py that invokes ray.init(), runs some remote tasks and then executes p2.py via subprocess.run(). p2.py also invokes ray.init() and runs some remote tasks.
I’d like the tasks from the two processes to share the same job id - is that doable?

I tried setting RAY_JOB_ID in environment and in ray.init’s runtime_env["env_vars"] but to no success.

I am looking for a solution or a workaround.

Thanks

Hi, what’s the underlying reason you’d like to share RAY_JOB_ID? Can you simply import p2.py in p1.py and run it? Or, is submitting two jobs using Ray jobs API not an option?