-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add new documentation and fix existing docs
- Loading branch information
1 parent
8786382
commit 9288016
Showing
11 changed files
with
176 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
Ray Cluster Interaction | ||
======================= | ||
|
||
The CodeFlare SDK offers multiple ways to interact with Ray Clusters | ||
including the below methods. | ||
|
||
get_cluster() | ||
------------- | ||
|
||
The ``get_cluster()`` function is used to initialise a ``Cluster`` | ||
object from a pre-existing Ray Cluster/AppWrapper. Below is an example | ||
of it's usage: | ||
|
||
:: | ||
|
||
from codeflare_sdk import get_cluster | ||
cluster = get_cluster(cluster_name="raytest", namespace="example", is_appwrapper=False, write_to_file=False) | ||
-> output: Yaml resources loaded for raytest | ||
cluster.status() | ||
-> output: | ||
🚀 CodeFlare Cluster Status 🚀 | ||
╭─────────────────────────────────────────────────────────────────╮ | ||
│ Name │ | ||
│ raytest Active ✅ │ | ||
│ │ | ||
│ URI: ray://raytest-head-svc.example.svc:10001 │ | ||
│ │ | ||
│ Dashboard🔗 │ | ||
│ │ | ||
╰─────────────────────────────────────────────────────────────────╯ | ||
(<CodeFlareClusterStatus.READY: 1>, True) | ||
cluster.down() | ||
cluster.up() # This function will create an exact copy of the retrieved Ray Cluster only if the Ray Cluster has been previously deleted. | ||
|
||
| These are the parameters the ``get_cluster()`` function accepts: | ||
| ``cluster_name: str # Required`` -> The name of the Ray Cluster. | ||
| ``namespace: str # Default: "default"`` -> The namespace of the Ray Cluster. | ||
| ``is_appwrapper: bool # Default: False`` -> When set to | ||
| ``True`` the function will attempt to retrieve an AppWrapper instead of a Ray Cluster. | ||
| ``write_to_file: bool # Default: False`` -> When set to ``True`` the Ray Cluster/AppWrapper will be written to a file similar to how it is done in ``ClusterConfiguration``. | ||
list_all_queued() | ||
----------------- | ||
|
||
| The ``list_all_queued()`` function returns (and prints by default) a list of all currently queued-up Ray Clusters in a given namespace. | ||
| It accepts the following parameters: | ||
| ``namespace: str # Required`` -> The namespace you want to retrieve the list from. | ||
| ``print_to_console: bool # Default: True`` -> Allows the user to print the list to their console. | ||
| ``appwrapper: bool # Default: False`` -> When set to ``True`` allows the user to list queued AppWrappers. | ||
list_all_clusters() | ||
------------------- | ||
|
||
| The ``list_all_clusters()`` function will return a list of detailed descriptions of Ray Clusters to the console by default. | ||
| It accepts the following parameters: | ||
| ``namespace: str # Required`` -> The namespace you want to retrieve the list from. | ||
| ``print_to_console: bool # Default: True`` -> A boolean that allows the user to print the list to their console. | ||
.. note:: | ||
|
||
The following methods require a ``Cluster`` object to be | ||
initialized. See :doc:`./cluster-configuration` | ||
|
||
cluster.up() | ||
------------ | ||
|
||
| The ``cluster.up()`` function creates a Ray Cluster in the given namespace. | ||
cluster.down() | ||
-------------- | ||
|
||
| The ``cluster.down()`` function deletes the Ray Cluster in the given namespace. | ||
cluster.status() | ||
---------------- | ||
|
||
| The ``cluster.status()`` function prints out the status of the Ray Cluster's state with a link to the Ray Dashboard. | ||
cluster.details() | ||
----------------- | ||
|
||
| The ``cluster.details()`` function prints out a detailed description of the Ray Cluster's status, worker resources and a link to the Ray Dashboard. | ||
cluster.wait_ready() | ||
-------------------- | ||
|
||
| The ``cluster.wait_ready()`` function waits for the requested cluster to be ready, up to an optional timeout and checks every 5 seconds. | ||
| It accepts the following parameters: | ||
| ``timeout: Optional[int] # Default: None`` -> Allows the user to define a timeout for the ``wait_ready()`` function. | ||
| ``dashboard_check: bool # Default: True`` -> If enabled the ``wait_ready()`` function will wait until the Ray Dashboard is ready too. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
Jupyter UI Widgets | ||
================== | ||
|
||
Below are some examples of the Jupyter UI Widgets that are included in | ||
the CodeFlare SDK. | ||
|
||
.. note:: | ||
To use the widgets functionality you must be using the CodeFlare SDK in a Jupyter Notebook environment. | ||
|
||
Cluster Up/Down Buttons | ||
----------------------- | ||
|
||
The Cluster Up/Down buttons appear after successfully initialising your | ||
`ClusterConfiguration <cluster-configuration.md#ray-cluster-configuration>`__. | ||
There are two buttons and a checkbox ``Cluster Up``, ``Cluster Down`` | ||
and ``Wait for Cluster?`` which mimic the | ||
`cluster.up() <ray-cluster-interaction.md#clusterup>`__, | ||
`cluster.down() <ray-cluster-interaction.md#clusterdown>`__ and | ||
`cluster.wait_ready() <ray-cluster-interaction.md#clusterwait_ready>`__ | ||
functionality. | ||
|
||
After initialising their ``ClusterConfiguration`` a user can select the | ||
``Wait for Cluster?`` checkbox then click the ``Cluster Up`` button to | ||
create their Ray Cluster and wait until it is ready. The cluster can be | ||
deleted by clicking the ``Cluster Down`` button. | ||
|
||
.. image:: images/ui-buttons.png | ||
:alt: An image of the up/down ui buttons | ||
|
||
View Clusters UI Table | ||
---------------------- | ||
|
||
The View Clusters UI Table allows a user to see a list of Ray Clusters | ||
with information on their configuration including number of workers, CPU | ||
requests and limits along with the clusters status. | ||
|
||
.. image:: images/ui-view-clusters.png | ||
:alt: An image of the view clusters ui table | ||
|
||
Above is a list of two Ray Clusters ``raytest`` and ``raytest2`` each of | ||
those headings is clickable and will update the table to view the | ||
selected Cluster's information. There are three buttons under the table | ||
``Cluster Down``, ``View Jobs`` and ``Open Ray Dashboard``. \* The | ||
``Cluster Down`` button will delete the selected Cluster. \* The | ||
``View Jobs`` button will try to open the Ray Dashboard's Jobs view in a | ||
Web Browser. The link will also be printed to the console. \* The | ||
``Open Ray Dashboard`` button will try to open the Ray Dashboard view in | ||
a Web Browser. The link will also be printed to the console. | ||
|
||
The UI Table can be viewed by calling the following function. | ||
|
||
.. code:: python | ||
from codeflare_sdk import view_clusters | ||
view_clusters() # Accepts namespace parameter but will try to gather the namespace from the current context |