A perspective powered, user editable ray dashboard via ray serve
Project description
raydar
A perspective powered, user editable ray dashboard via ray serve.
Ray offers powerful metrics visualizations powered by graphana and prometheus. Although useful, the setup can take time - and customizations can be challenging.
Raydar, enables out-of-the-box live cluster metrics and user visualizations for Ray workflows with just a simple pip install. It helps unlock distributed machine learning visualizations on Anyscale clusters, runs live and at scale, is easily customizable, and enables all the in-browser aggregations that perspective has to offer.
Features
- Convenience wrappers for the tracking and persistence of ray GCS task metdata. Can scale beyond the existing ray dashboard / GCS task tracking limitations.
- Serves a UI through ray serve for the vizualization of perspective tables.
- A python interface to create and update perspective tables from within ray tasks.
More information is available in our wiki
Installation
raydar
can be installed via pip or conda, the two primary package managers for the Python ecosystem.
To install raydar
via pip, run this command in your terminal:
pip install raydar
To install raydar
via conda, run this command in your terminal:
conda install raydar -c conda-forge
Launching The UI, Tracking Tasks, Creating/Updating Custom Tables
The raydar module provides an actor which can process collections of ray object references on your behalf, and can serve a perspective dashboard in which to visualize that data.
from raydar import RayTaskTracker
task_tracker = RayTaskTracker(enable_perspective_dashboard=True)
Passing collections of object references to this actor's process method causes those references to be tracked in an internal polars dataframe, as they finish running.
@ray.remote
def example_remote_function():
import time
import random
time.sleep(1)
if random.randint(1,100) > 90:
raise Exception("This task should sometimes fail!")
return True
refs = [example_remote_function.remote() for _ in range(100)]
task_tracker.process(refs)
The perspective UI is served on port 8000 by default.
Passing a name
and namespace
arguments allows the RayTaskTracker to skip construction when an actor already exists. This also means we can access the correct ray actor handle from arbitrary ray code, once the correct name and namespace are provided.
from raydar import RayTaskTracker
task_tracker = RayTaskTracker(
enable_perspective_dashboard=True,
name="my_actor_name",
namespace="my_actor_namespace”
)
task_tracker.create_table(
table_name="demo_table",
table_schema=dict(
worker_id="str",
metric_value="int",
other_metric_value="float",
timestamp="datetime”
)
)
Now, from an arbitrary remote function:
@ray.remote
def add_data_to_demo_table(i):
task_tracker = RayTaskTracker(name="my_actor_name", namespace="my_actor_namespace")
import datetime
import random
data = dict(
worker_id="worker_1",
metric_value=i,
other_metric_value=i * random.uniform(1.5, 1.8),
timestamp = datetime.datetime.now()
)
task_tracker.update_table("demo_table", [data])
FAQ
- Where is the perspective data stored?
Currently, in memory. There are plans to integrate alternatives to this configuration, but currently the data is stored in machine memory on the ray head.
- How can I save and restore my perspective layouts?
The Save Layout
button saves a json file containing layout information. Dragging and dropping this file into the UI browser window restores that layout.
License
This software is licensed under the Apache 2.0 license. See the LICENSE file for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file raydar-0.2.4.tar.gz
.
File metadata
- Download URL: raydar-0.2.4.tar.gz
- Upload date:
- Size: 2.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.11.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b63151e79c718c3e20ab6909d781e7097cb4f7a295094fb22205dcacd9742db |
|
MD5 | f701c8e06827bb140a31c439fdb3c094 |
|
BLAKE2b-256 | 141d0557cdd1ceaa100fa0e827b1e66d9689e66b65f4a66f00cc6d38f3e68677 |
File details
Details for the file raydar-0.2.4-py3-none-any.whl
.
File metadata
- Download URL: raydar-0.2.4-py3-none-any.whl
- Upload date:
- Size: 2.7 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.11.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76579d5fc5097f6104aa2a54c93c89a682dfd8aa0cdc817cb65de3bc8ec47d64 |
|
MD5 | 452499498e8695c7b22d68e6f39e15d5 |
|
BLAKE2b-256 | 1df87359c3c59276b5c37ff475bfd5e58b0a9b1fbb2bd0bc493238ad7b002776 |