raydar


Nameraydar JSON
Version 0.2.1 PyPI version JSON
download
home_pageNone
SummaryA perspective powered, user editable ray dashboard via ray serve
upload_time2024-04-17 01:44:40
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseApache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright 2024 Point72, L.P. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
keywords cluster cluster visualization dashboard data visualization dataviz perspective ray
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <!--
<a href="https://github.com/point72/raydar">
  <img src="https://github.com/point72/raydar/raw/main/docs/img/logo.png?raw=true" alt="raydar" width="400"></a>
</a>
<br/>
<br/>
-->

# raydar

A [perspective](https://perspective.finos.org/) powered, user editable ray dashboard via ray serve.

[![PyPI](https://img.shields.io/pypi/v/raydar.svg?style=flat)](https://pypi.python.org/pypi/raydar)
[![License](https://img.shields.io/badge/license-Apache--2.0-green)](https://github.com/Point72/raydar/LICENSE)
[![Build Status](https://github.com/Point72/raydar/actions/workflows/build.yml/badge.svg)](https://github.com/Point72/raydar/actions/workflows/build.yml)
[![Python Versions](https://img.shields.io/badge/python-3.8_%7C_3.9_%7C_3.10_%7C_3.11-blue)](https://github.com/Point72/raydar/blob/main/pyproject.toml)

<br/>


## Features

The `raydar` module provides an actor which can process collections of ray object references on your behalf, and can serve a [perspective](https://github.com/finos/perspective) dashboard in which to visualize that data.

```python
from raydar import RayTaskTracker
task_tracker = RayTaskTracker()
```

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.

```python
@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)
```

This internal dataframe can be accessed via the `.get_df()` method.

```raw
┌────────────────────────┬────────────────────────┬────────────────┬────────────────────────┬───┬───────────────────┬───────────────────┬───────────────────────┬───────────────┐

│ task_id                ┆ user_defined_metadata  ┆ attempt_number ┆ name                   ┆ … ┆ start_time_ms     ┆ end_time_ms       ┆ task_log_info         ┆ error_message │

│ ---                    ┆ ---                    ┆ ---            ┆ ---                    ┆   ┆ ---               ┆ ---               ┆ ---                   ┆ ---           │

│ str                    ┆ f32                    ┆ i64            ┆ str                    ┆   ┆ datetime[ms,      ┆ datetime[ms,      ┆ struct[6]             ┆ str           │

│                        ┆                        ┆                ┆                        ┆   ┆ America/New_York] ┆ America/New_York] ┆                       ┆               │

╞════════════════════════╪════════════════════════╪════════════════╪════════════════════════╪═══╪═══════════════════╪═══════════════════╪═══════════════════════╪═══════════════╡

│ 16310a0f0a45af5cffffff ┆ null                   ┆ 0              ┆ example_remote_functio ┆ … ┆ 2024-01-29        ┆ 2024-01-29        ┆ {"/tmp/ray/session_20 ┆ null          │

│ ffffffffff…            ┆                        ┆                ┆ n                      ┆   ┆ 07:17:09.340 EST  ┆ 07:17:12.115 EST  ┆ 24-01-29_07…          ┆               │

│ c2668a65bda616c1ffffff ┆ null                   ┆ 0              ┆ example_remote_functio ┆ … ┆ 2024-01-29        ┆ 2024-01-29        ┆ {"/tmp/ray/session_20 ┆ null          │

│ ffffffffff…            ┆                        ┆                ┆ n                      ┆   ┆ 07:17:09.341 EST  ┆ 07:17:12.107 EST  ┆ 24-01-29_07…          ┆               │

│ 32d950ec0ccf9d2affffff ┆ null                   ┆ 0              ┆ example_remote_functio ┆ … ┆ 2024-01-29        ┆ 2024-01-29        ┆ {"/tmp/ray/session_20 ┆ null          │

│ ffffffffff…            ┆                        ┆                ┆ n                      ┆   ┆ 07:17:09.342 EST  ┆ 07:17:12.115 EST  ┆ 24-01-29_07…          ┆               │

│ e0dc174c83599034ffffff ┆ null                   ┆ 0              ┆ example_remote_functio ┆ … ┆ 2024-01-29        ┆ 2024-01-29        ┆ {"/tmp/ray/session_20 ┆ null          │

│ ffffffffff…            ┆                        ┆                ┆ n                      ┆   ┆ 07:17:09.343 EST  ┆ 07:17:12.115 EST  ┆ 24-01-29_07…          ┆               │

│ f4402ec78d3a2607ffffff ┆ null                   ┆ 0              ┆ example_remote_functio ┆ … ┆ 2024-01-29        ┆ 2024-01-29        ┆ {"/tmp/ray/session_20 ┆ null          │

│ ffffffffff…            ┆                        ┆                ┆ n                      ┆   ┆ 07:17:09.343 EST  ┆ 07:17:12.115 EST  ┆ 24-01-29_07…          ┆               │

└────────────────────────┴────────────────────────┴────────────────┴────────────────────────┴───┴───────────────────┴───────────────────┴───────────────────────┴───────────────┘
```

Additionally, setting the `enable_perspective_dashboard` flag to `True` in the `RayTaskTracker`'s construction serves a perspective dashboard with live views of your completed references.

```python
task_tracker = RayTaskTracker(enable_perspective_dashboard=True)
```

![Example](docs/img/example_perspective_dashboard.gif)

## Create/Store Custom Views
From the developer console, save your workspace layout locally.

```javascript
let workspace = document.getElementById('perspective-workspace');

// Save the current layout
workspace.save().then(config => {
    // Convert the configuration object to a JSON string
    let json = JSON.stringify(config);

    // Create a Blob object from the JSON string
    let blob = new Blob([json], {type: "application/json"});

    // Create a download link
    let link = document.createElement('a');
    link.href = URL.createObjectURL(blob);
    link.download = 'workspace.json';

    // Append the link to the document body and click it to start the download
    document.body.appendChild(link);
    link.click();
    document.body.removeChild(link);
});
```

Then, move this json file to `js/src/layouts/default.json`.

![Example](docs/img/example_perspective_dashboard_layouts.gif)

## Expose Ray GCS Information
The data available to you includes much of what Ray's GCS tracks, and also allows for user defined metadata per task.

Specifically, tracked fields include:
 * `task_id`
 * `user_defined_metadata`
 * `attempt_number`
 * `name`
 * `state`
 * `job_id`
 * `actor_id`
 * `type`
 * `func_or_class_name`
 * `parent_task_id`
 * `node_id`
 * `worker_id`
 * `error_type`
 * `language`
 * `required_resources`
 * `runtime_env_info`
 * `placement_group_id`
 * `events`
 * `profiling_data`
 * `creation_time_ms`
 * `start_time_ms`
 * `end_time_ms`
 * `task_log_info`
 * `error_message`

![Example](docs/img/example_task_metadata.gif)

## Custom Sources / Update Logic

The proxy server helpd by the `RayTaskTracker` is exposed via the `.proxy_server()` property, meaning we can create new tables as follows:


```python
task_tracker = RayTaskTracker(enable_perspective_dashboard=True)
proxy_server = task_tracker.proxy_server()
proxy_server.remote(
    "new",
    "metrics_table",
    {
        "node_id": "str",
        "metric_name": "str",
        "value": "float",
        "timestamp": "datetime",
    },
)
```

### Example: Live Per-Node Training Loss Metrics

If a user were to then update this table with data coming from, for example, a pytorch model training loop with metrics:

```python
def my_model_training_loop()

	for epoch in range(num_epochs):
        # ... my training code here ...

		data = dict(
			node_id=ray.get_runtime_context().get_node_id(),
			metric_name="loss",
			value=loss.item(),
			timestamp=time.time(),
		)
		proxy_server.remote("update", "metrics_table", [data])
```

Then they can expose a live view at per-node loss metrics across our model training process:

![Example](docs/img/example_custom_metrics.gif)

## Installation
`raydar` can be installed via [pip](https://pip.pypa.io) or [conda](https://docs.conda.io/en/latest/), the two primary package managers for the Python ecosystem.

To install `raydar` via **pip**, run this command in your terminal:

```bash
pip install raydar
```

To install `raydar` via **conda**, run this command in your terminal:

```bash
conda install raydar -c conda-forge
```

## License
This software is licensed under the Apache 2.0 license. See the [LICENSE](LICENSE) file for details.


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "raydar",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "cluster, cluster visualization, dashboard, data visualization, dataviz, perspective, ray",
    "author": null,
    "author_email": "Point72 <OpenSource@Point72.com>",
    "download_url": "https://files.pythonhosted.org/packages/7a/8d/2f7bb6b77e0be39e5e61dd2ea1dbc08d916f437bb66ff190b8589a18d9ac/raydar-0.2.1.tar.gz",
    "platform": null,
    "description": "<!--\n<a href=\"https://github.com/point72/raydar\">\n  <img src=\"https://github.com/point72/raydar/raw/main/docs/img/logo.png?raw=true\" alt=\"raydar\" width=\"400\"></a>\n</a>\n<br/>\n<br/>\n-->\n\n# raydar\n\nA [perspective](https://perspective.finos.org/) powered, user editable ray dashboard via ray serve.\n\n[![PyPI](https://img.shields.io/pypi/v/raydar.svg?style=flat)](https://pypi.python.org/pypi/raydar)\n[![License](https://img.shields.io/badge/license-Apache--2.0-green)](https://github.com/Point72/raydar/LICENSE)\n[![Build Status](https://github.com/Point72/raydar/actions/workflows/build.yml/badge.svg)](https://github.com/Point72/raydar/actions/workflows/build.yml)\n[![Python Versions](https://img.shields.io/badge/python-3.8_%7C_3.9_%7C_3.10_%7C_3.11-blue)](https://github.com/Point72/raydar/blob/main/pyproject.toml)\n\n<br/>\n\n\n## Features\n\nThe `raydar` module provides an actor which can process collections of ray object references on your behalf, and can serve a [perspective](https://github.com/finos/perspective) dashboard in which to visualize that data.\n\n```python\nfrom raydar import RayTaskTracker\ntask_tracker = RayTaskTracker()\n```\n\nPassing 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.\n\n```python\n@ray.remote\ndef example_remote_function():\n    import time\n    import random\n    time.sleep(1)\n    if random.randint(1,100) > 90:\n        raise Exception(\"This task should sometimes fail!\")\n    return True\n\nrefs = [example_remote_function.remote() for _ in range(100)]\ntask_tracker.process(refs)\n```\n\nThis internal dataframe can be accessed via the `.get_df()` method.\n\n```raw\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\n\u2502 task_id                \u2506 user_defined_metadata  \u2506 attempt_number \u2506 name                   \u2506 \u2026 \u2506 start_time_ms     \u2506 end_time_ms       \u2506 task_log_info         \u2506 error_message \u2502\n\n\u2502 ---                    \u2506 ---                    \u2506 ---            \u2506 ---                    \u2506   \u2506 ---               \u2506 ---               \u2506 ---                   \u2506 ---           \u2502\n\n\u2502 str                    \u2506 f32                    \u2506 i64            \u2506 str                    \u2506   \u2506 datetime[ms,      \u2506 datetime[ms,      \u2506 struct[6]             \u2506 str           \u2502\n\n\u2502                        \u2506                        \u2506                \u2506                        \u2506   \u2506 America/New_York] \u2506 America/New_York] \u2506                       \u2506               \u2502\n\n\u255e\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2561\n\n\u2502 16310a0f0a45af5cffffff \u2506 null                   \u2506 0              \u2506 example_remote_functio \u2506 \u2026 \u2506 2024-01-29        \u2506 2024-01-29        \u2506 {\"/tmp/ray/session_20 \u2506 null          \u2502\n\n\u2502 ffffffffff\u2026            \u2506                        \u2506                \u2506 n                      \u2506   \u2506 07:17:09.340 EST  \u2506 07:17:12.115 EST  \u2506 24-01-29_07\u2026          \u2506               \u2502\n\n\u2502 c2668a65bda616c1ffffff \u2506 null                   \u2506 0              \u2506 example_remote_functio \u2506 \u2026 \u2506 2024-01-29        \u2506 2024-01-29        \u2506 {\"/tmp/ray/session_20 \u2506 null          \u2502\n\n\u2502 ffffffffff\u2026            \u2506                        \u2506                \u2506 n                      \u2506   \u2506 07:17:09.341 EST  \u2506 07:17:12.107 EST  \u2506 24-01-29_07\u2026          \u2506               \u2502\n\n\u2502 32d950ec0ccf9d2affffff \u2506 null                   \u2506 0              \u2506 example_remote_functio \u2506 \u2026 \u2506 2024-01-29        \u2506 2024-01-29        \u2506 {\"/tmp/ray/session_20 \u2506 null          \u2502\n\n\u2502 ffffffffff\u2026            \u2506                        \u2506                \u2506 n                      \u2506   \u2506 07:17:09.342 EST  \u2506 07:17:12.115 EST  \u2506 24-01-29_07\u2026          \u2506               \u2502\n\n\u2502 e0dc174c83599034ffffff \u2506 null                   \u2506 0              \u2506 example_remote_functio \u2506 \u2026 \u2506 2024-01-29        \u2506 2024-01-29        \u2506 {\"/tmp/ray/session_20 \u2506 null          \u2502\n\n\u2502 ffffffffff\u2026            \u2506                        \u2506                \u2506 n                      \u2506   \u2506 07:17:09.343 EST  \u2506 07:17:12.115 EST  \u2506 24-01-29_07\u2026          \u2506               \u2502\n\n\u2502 f4402ec78d3a2607ffffff \u2506 null                   \u2506 0              \u2506 example_remote_functio \u2506 \u2026 \u2506 2024-01-29        \u2506 2024-01-29        \u2506 {\"/tmp/ray/session_20 \u2506 null          \u2502\n\n\u2502 ffffffffff\u2026            \u2506                        \u2506                \u2506 n                      \u2506   \u2506 07:17:09.343 EST  \u2506 07:17:12.115 EST  \u2506 24-01-29_07\u2026          \u2506               \u2502\n\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\nAdditionally, setting the `enable_perspective_dashboard` flag to `True` in the `RayTaskTracker`'s construction serves a perspective dashboard with live views of your completed references.\n\n```python\ntask_tracker = RayTaskTracker(enable_perspective_dashboard=True)\n```\n\n![Example](docs/img/example_perspective_dashboard.gif)\n\n## Create/Store Custom Views\nFrom the developer console, save your workspace layout locally.\n\n```javascript\nlet workspace = document.getElementById('perspective-workspace');\n\n// Save the current layout\nworkspace.save().then(config => {\n    // Convert the configuration object to a JSON string\n    let json = JSON.stringify(config);\n\n    // Create a Blob object from the JSON string\n    let blob = new Blob([json], {type: \"application/json\"});\n\n    // Create a download link\n    let link = document.createElement('a');\n    link.href = URL.createObjectURL(blob);\n    link.download = 'workspace.json';\n\n    // Append the link to the document body and click it to start the download\n    document.body.appendChild(link);\n    link.click();\n    document.body.removeChild(link);\n});\n```\n\nThen, move this json file to `js/src/layouts/default.json`.\n\n![Example](docs/img/example_perspective_dashboard_layouts.gif)\n\n## Expose Ray GCS Information\nThe data available to you includes much of what Ray's GCS tracks, and also allows for user defined metadata per task.\n\nSpecifically, tracked fields include:\n * `task_id`\n * `user_defined_metadata`\n * `attempt_number`\n * `name`\n * `state`\n * `job_id`\n * `actor_id`\n * `type`\n * `func_or_class_name`\n * `parent_task_id`\n * `node_id`\n * `worker_id`\n * `error_type`\n * `language`\n * `required_resources`\n * `runtime_env_info`\n * `placement_group_id`\n * `events`\n * `profiling_data`\n * `creation_time_ms`\n * `start_time_ms`\n * `end_time_ms`\n * `task_log_info`\n * `error_message`\n\n![Example](docs/img/example_task_metadata.gif)\n\n## Custom Sources / Update Logic\n\nThe proxy server helpd by the `RayTaskTracker` is exposed via the `.proxy_server()` property, meaning we can create new tables as follows:\n\n\n```python\ntask_tracker = RayTaskTracker(enable_perspective_dashboard=True)\nproxy_server = task_tracker.proxy_server()\nproxy_server.remote(\n    \"new\",\n    \"metrics_table\",\n    {\n        \"node_id\": \"str\",\n        \"metric_name\": \"str\",\n        \"value\": \"float\",\n        \"timestamp\": \"datetime\",\n    },\n)\n```\n\n### Example: Live Per-Node Training Loss Metrics\n\nIf a user were to then update this table with data coming from, for example, a pytorch model training loop with metrics:\n\n```python\ndef my_model_training_loop()\n\n\tfor epoch in range(num_epochs):\n        # ... my training code here ...\n\n\t\tdata = dict(\n\t\t\tnode_id=ray.get_runtime_context().get_node_id(),\n\t\t\tmetric_name=\"loss\",\n\t\t\tvalue=loss.item(),\n\t\t\ttimestamp=time.time(),\n\t\t)\n\t\tproxy_server.remote(\"update\", \"metrics_table\", [data])\n```\n\nThen they can expose a live view at per-node loss metrics across our model training process:\n\n![Example](docs/img/example_custom_metrics.gif)\n\n## Installation\n`raydar` can be installed via [pip](https://pip.pypa.io) or [conda](https://docs.conda.io/en/latest/), the two primary package managers for the Python ecosystem.\n\nTo install `raydar` via **pip**, run this command in your terminal:\n\n```bash\npip install raydar\n```\n\nTo install `raydar` via **conda**, run this command in your terminal:\n\n```bash\nconda install raydar -c conda-forge\n```\n\n## License\nThis software is licensed under the Apache 2.0 license. See the [LICENSE](LICENSE) file for details.\n\n",
    "bugtrack_url": null,
    "license": "Apache License Version 2.0, January 2004 http://www.apache.org/licenses/  TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION  1. Definitions.  \"License\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.  \"Licensor\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.  \"Legal Entity\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.  \"You\" (or \"Your\") shall mean an individual or Legal Entity exercising permissions granted by this License.  \"Source\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.  \"Object\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.  \"Work\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).  \"Derivative Works\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.  \"Contribution\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \"Not a Contribution.\"  \"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.  2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.  3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.  4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:  (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and  (b) You must cause any modified files to carry prominent notices stating that You changed the files; and  (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and  (d) If the Work includes a \"NOTICE\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.  You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.  5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.  6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.  7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.  8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.  9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.  END OF TERMS AND CONDITIONS  APPENDIX: How to apply the Apache License to your work.  To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets \"[]\" replaced with your own identifying information. (Don't include the brackets!)  The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same \"printed page\" as the copyright notice for easier identification within third-party archives.  Copyright 2024 Point72, L.P.  Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at  http://www.apache.org/licenses/LICENSE-2.0  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.",
    "summary": "A perspective powered, user editable ray dashboard via ray serve",
    "version": "0.2.1",
    "project_urls": {
        "Homepage": "https://github.com/point72/raydar",
        "Repository": "https://github.com/point72/raydar"
    },
    "split_keywords": [
        "cluster",
        " cluster visualization",
        " dashboard",
        " data visualization",
        " dataviz",
        " perspective",
        " ray"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "68e1183bc72d2306d0c8792f8513ecbbee85fb2b6deacfbaa5f2196b07a61241",
                "md5": "eddc6cb98a9b3c3281b307dd81563a88",
                "sha256": "970fdd962814b6603f73b5e6f050cd5138922bbeb05ce8ef1508ff5f7437aa73"
            },
            "downloads": -1,
            "filename": "raydar-0.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "eddc6cb98a9b3c3281b307dd81563a88",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 2701476,
            "upload_time": "2024-04-17T01:44:38",
            "upload_time_iso_8601": "2024-04-17T01:44:38.889904Z",
            "url": "https://files.pythonhosted.org/packages/68/e1/183bc72d2306d0c8792f8513ecbbee85fb2b6deacfbaa5f2196b07a61241/raydar-0.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7a8d2f7bb6b77e0be39e5e61dd2ea1dbc08d916f437bb66ff190b8589a18d9ac",
                "md5": "eff194c6a95095e0abb295341080f8b8",
                "sha256": "dc298d9bd41351cf031640d2c50bf004dbe7a9bcd04e0e746a190ad4a4763887"
            },
            "downloads": -1,
            "filename": "raydar-0.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "eff194c6a95095e0abb295341080f8b8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 2745229,
            "upload_time": "2024-04-17T01:44:40",
            "upload_time_iso_8601": "2024-04-17T01:44:40.867718Z",
            "url": "https://files.pythonhosted.org/packages/7a/8d/2f7bb6b77e0be39e5e61dd2ea1dbc08d916f437bb66ff190b8589a18d9ac/raydar-0.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-17 01:44:40",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "point72",
    "github_project": "raydar",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "raydar"
}
        
Elapsed time: 0.24349s