How to get the session id?

When I run ray.init(), a new session is created under _temp_dir/. that looks like:


I’ve tried looking through the ray._private.worker.RayContext object returned by ray.init() but can’t seem to find this session id anywhere.

The motivation for this is that I need to clear the session temp files after a run to conserve storage space!

Ahh, according to this doc, its symlinked to session_latest, so you can just do: