mirror of
https://github.com/wassname/ray.git
synced 2026-07-18 12:40:56 +08:00
[doc] Add documentation for Ray debugger (#11815)
Co-authored-by: Richard Liaw <rliaw@berkeley.edu>
This commit is contained in:
co-authored by
Richard Liaw
parent
27c810a97e
commit
28e7439cf0
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user