Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/designs/History/CodeFlareSDK_Design_Doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Users can customize their AppWrapper by passing their desired parameters to `Clu

Our aim is to simplify the process of generating valid AppWrappers for RayClusters, so we will strive to find the appropriate balance between ease of use and exposing all possible AppWrapper parameters. And we will find this balance through user feedback.

With a valid AppWrapper, we will use the Kubernetes python client to apply the AppWrapper to our Kubernetes cluster via a call to `cluster.up()`
With a valid AppWrapper, we will use the Kubernetes python client to apply the AppWrapper to our Kubernetes cluster via a call to `cluster.apply()`

We will also use the Kubernetes python client to get information about both the RayCluster and AppWrapper custom resources to monitor the status of our Framework Cluster via `cluster.status()` and `cluster.details()`.

Expand Down
2 changes: 1 addition & 1 deletion docs/sphinx/user-docs/cluster-configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ This will automatically set the ``RAY_USAGE_STATS_ENABLED`` environment variable
The ``labels={"exampleLabel": "example"}`` parameter can be used to
apply additional labels to the RayCluster resource.

After creating their ``cluster``, a user can call ``cluster.up()`` and
After creating their ``cluster``, a user can call ``cluster.apply()`` and
``cluster.down()`` to respectively create or remove the Ray Cluster.

Custom Volumes/Volume Mounts
Expand Down
7 changes: 1 addition & 6 deletions docs/sphinx/user-docs/ray-cluster-interaction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ of it's usage:
╰─────────────────────────────────────────────────────────────────╯
(<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.
cluster.apply() # 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.
Expand Down Expand Up @@ -61,11 +61,6 @@ list_all_clusters()
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.apply()
------------

Expand Down
2 changes: 1 addition & 1 deletion docs/sphinx/user-docs/ui-widgets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ 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.apply() <ray-cluster-interaction.md#clusterapply>`__,
`cluster.down() <ray-cluster-interaction.md#clusterdown>`__ and
`cluster.wait_ready() <ray-cluster-interaction.md#clusterwait_ready>`__
functionality.
Expand Down
8 changes: 5 additions & 3 deletions src/codeflare_sdk/ray/cluster/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,9 @@ def apply(self, force=False):
except AttributeError as e:
raise RuntimeError(f"Failed to initialize DynamicClient: {e}")
except Exception as e: # pragma: no cover
if e.status == 422:
if (
hasattr(e, "status") and e.status == 422
): # adding status check to avoid returning false positive
print(
"WARNING: RayCluster creation rejected due to invalid Kueue configuration. Please contact your administrator."
)
Expand Down Expand Up @@ -426,7 +428,7 @@ def wait_ready(self, timeout: Optional[int] = None, dashboard_check: bool = True
status, ready = self.status(print_to_console=False)
if status == CodeFlareClusterStatus.UNKNOWN:
print(
"WARNING: Current cluster status is unknown, have you run cluster.up yet?"
"WARNING: Current cluster status is unknown, have you run cluster.apply() yet? Run cluster.details() to check if it's ready."
)
if ready:
break
Expand Down Expand Up @@ -518,7 +520,7 @@ def cluster_dashboard_uri(self) -> str:
elif "route.openshift.io/termination" in annotations:
protocol = "https"
return f"{protocol}://{ingress.spec.rules[0].host}"
return "Dashboard not available yet, have you run cluster.up()?"
return "Dashboard not available yet, have you run cluster.apply()? Run cluster.details() to check if it's ready."

def list_jobs(self) -> List:
"""
Expand Down
6 changes: 5 additions & 1 deletion src/codeflare_sdk/ray/cluster/pretty_print.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@

def print_no_resources_found():
console = Console()
console.print(Panel("[red]No resources found, have you run cluster.up() yet?"))
console.print(
Panel(
"[red]No resources found, have you run cluster.apply() yet? Run cluster.details() to check if it's ready."
)
)


def print_app_wrappers_status(app_wrappers: List[AppWrapper], starting: bool = False):
Expand Down
Loading