Skip to content

Commit

Permalink
[Doc][Core][State Observability] Adding Python SDK doc and docstring (r…
Browse files Browse the repository at this point in the history
…ay-project#26997)

1. Add doc for python SDK and docstrings on public SDK
2. Rename list -> ray_list and get -> ray_get for better naming 
3. Fix some typos 
4. Auto translate address to api server url.

Co-authored-by: SangBin Cho <rkooo567@gmail.com>
  • Loading branch information
rickyyx and rkooo567 authored Aug 2, 2022
1 parent d527c7b commit 82a24f9
Show file tree
Hide file tree
Showing 8 changed files with 956 additions and 294 deletions.
3 changes: 1 addition & 2 deletions dashboard/tests/test_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
)
from ray.dashboard import dashboard
from ray.dashboard.head import DashboardHead
from ray.dashboard.modules.dashboard_sdk import DEFAULT_DASHBOARD_ADDRESS
from ray.experimental.state.api import StateApiClient
from ray.experimental.state.common import ListApiOptions, StateResource
from ray.experimental.state.exception import ServerUnavailable
Expand Down Expand Up @@ -964,7 +963,7 @@ def test_dashboard_requests_fail_on_missing_deps(ray_start_with_dashboard):
response = None

with pytest.raises(ServerUnavailable):
client = StateApiClient(address=DEFAULT_DASHBOARD_ADDRESS)
client = StateApiClient()
response = client.list(
StateResource.NODES, options=ListApiOptions(), raise_on_missing_output=False
)
Expand Down
42 changes: 40 additions & 2 deletions doc/source/ray-observability/state/ray-state-api-reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ State CLI allows users to access the state of various resources (e.g., actor, ta
.. click:: ray.experimental.state.state_cli:object_summary
:prog: ray summary objects

.. click:: ray.experimental.state.state_cli:list
.. click:: ray.experimental.state.state_cli:ray_list
:prog: ray list

.. click:: ray.experimental.state.state_cli:get
.. click:: ray.experimental.state.state_cli:ray_get
:prog: ray get

.. _ray-logs-api-doc:
Expand All @@ -36,6 +36,44 @@ Note that only the logs from alive nodes are available through this API.
.. click:: ray.scripts.scripts:ray_logs
:prog: ray logs

State Python SDK
-----------------

State APIs are also exported as functions.

Summary APIs
~~~~~~~~~~~~
.. autofunction:: ray.experimental.state.api.summarize_actors
.. autofunction:: ray.experimental.state.api.summarize_objects
.. autofunction:: ray.experimental.state.api.summarize_tasks

List APIs
~~~~~~~~~~

.. autofunction:: ray.experimental.state.api.list_actors
.. autofunction:: ray.experimental.state.api.list_placement_groups
.. autofunction:: ray.experimental.state.api.list_nodes
.. autofunction:: ray.experimental.state.api.list_jobs
.. autofunction:: ray.experimental.state.api.list_workers
.. autofunction:: ray.experimental.state.api.list_tasks
.. autofunction:: ray.experimental.state.api.list_objects
.. autofunction:: ray.experimental.state.api.list_runtime_envs

Get APIs
~~~~~~~~~

.. autofunction:: ray.experimental.state.api.get_actor
.. autofunction:: ray.experimental.state.api.get_placement_group
.. autofunction:: ray.experimental.state.api.get_node
.. autofunction:: ray.experimental.state.api.get_worker
.. autofunction:: ray.experimental.state.api.get_task
.. autofunction:: ray.experimental.state.api.get_objects

Log APIs
~~~~~~~~
.. autofunction:: ray.experimental.state.api.list_logs
.. autofunction:: ray.experimental.state.api.get_log

.. _state-api-schema:

State APIs Schema
Expand Down
Loading

0 comments on commit 82a24f9

Please sign in to comment.