[doc] Add documentation for Ray debugger (#11815)

Co-authored-by: Richard Liaw <rliaw@berkeley.edu>
This commit is contained in:
Philipp Moritz
2020-11-05 16:25:27 -08:00
committed by GitHub
co-authored by Richard Liaw
parent 27c810a97e
commit 28e7439cf0
5 changed files with 214 additions and 5 deletions
+1 -1
View File
@@ -157,7 +157,7 @@ def dashboard(cluster_config_file, cluster_name, port, remote_port):
type=str,
help="Override the address to connect to.")
def debug(address):
"""Debug Ray program."""
"""Show all active breakpoints and exceptions in the Ray debugger."""
from telnetlib import Telnet
if not address:
address = services.find_redis_address_or_die()
+8 -4
View File
@@ -170,12 +170,16 @@ def connect_ray_pdb(host=None, port=None, patch_stdstreams=False, quiet=None):
return rdb
def set_trace(host=None, port=None, patch_stdstreams=False, quiet=None):
def set_trace():
"""Interrupt the flow of the program and drop into the Ray debugger.
Can be used within a Ray task or actor.
"""
frame = sys._getframe().f_back
rdb = connect_ray_pdb(host, port, patch_stdstreams, quiet)
rdb = connect_ray_pdb(None, None, False, None)
rdb.set_trace(frame=frame)
def post_mortem(host=None, port=None, patch_stdstreams=False, quiet=None):
rdb = connect_ray_pdb(host, port, patch_stdstreams, quiet)
def post_mortem():
rdb = connect_ray_pdb(None, None, False, None)
rdb.post_mortem()