Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion 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
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
4 changes: 2 additions & 2 deletions src/codeflare_sdk/ray/cluster/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,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 +518,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
2 changes: 1 addition & 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,7 @@

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
18 changes: 9 additions & 9 deletions src/codeflare_sdk/ray/cluster/test_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
aw_dir = os.path.expanduser("~/.codeflare/resources/")


def test_cluster_up_down(mocker):
def test_cluster_apply_down(mocker):
mocker.patch("kubernetes.client.ApisApi.get_api_versions")
mocker.patch("kubernetes.config.load_kube_config", return_value="ignore")
mocker.patch("codeflare_sdk.ray.cluster.cluster.Cluster._throw_for_no_raycluster")
Expand All @@ -70,7 +70,7 @@ def test_cluster_up_down(mocker):
return_value=get_local_queue("kueue.x-k8s.io", "v1beta1", "ns", "localqueues"),
)
cluster = create_cluster(mocker)
cluster.up()
cluster.apply()
cluster.down()


Expand Down Expand Up @@ -252,7 +252,7 @@ def test_cluster_apply_without_appwrapper(mocker):
print("Cluster applied without AppWrapper.")


def test_cluster_up_down_no_mcad(mocker):
def test_cluster_apply_down_no_mcad(mocker):
mocker.patch("codeflare_sdk.ray.cluster.cluster.Cluster._throw_for_no_raycluster")
mocker.patch("kubernetes.config.load_kube_config", return_value="ignore")
mocker.patch("kubernetes.client.ApisApi.get_api_versions")
Expand Down Expand Up @@ -282,7 +282,7 @@ def test_cluster_up_down_no_mcad(mocker):
config.name = "unit-test-cluster-ray"
config.appwrapper = False
cluster = Cluster(config)
cluster.up()
cluster.apply()
cluster.down()


Expand Down Expand Up @@ -324,7 +324,7 @@ def test_cluster_uris(mocker):
)
assert (
cluster.cluster_dashboard_uri()
== "Dashboard not available yet, have you run cluster.up()?"
== "Dashboard not available yet, have you run cluster.apply()? Run cluster.details() to check if it's ready."
)

mocker.patch(
Expand Down Expand Up @@ -538,7 +538,7 @@ def test_wait_ready(mocker, capsys):

captured = capsys.readouterr()
assert (
"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."
in captured.out
)
mocker.patch(
Expand Down Expand Up @@ -571,7 +571,7 @@ def test_list_queue_appwrappers(mocker, capsys):
captured = capsys.readouterr()
assert captured.out == (
"╭──────────────────────────────────────────────────────────────────────────────╮\n"
"│ No resources found, have you run cluster.up() yet? │\n"
"│ No resources found, have you run cluster.apply() yet? Run cluster.details() to check if it's ready. │\n"
"╰──────────────────────────────────────────────────────────────────────────────╯\n"
)
mocker.patch(
Expand Down Expand Up @@ -616,7 +616,7 @@ def test_list_queue_rayclusters(mocker, capsys):
captured = capsys.readouterr()
assert captured.out == (
"╭──────────────────────────────────────────────────────────────────────────────╮\n"
"│ No resources found, have you run cluster.up() yet? │\n"
"│ No resources found, have you run cluster.apply() yet? Run cluster.details() to check if it's ready. │\n"
"╰──────────────────────────────────────────────────────────────────────────────╯\n"
)
mocker.patch(
Expand Down Expand Up @@ -658,7 +658,7 @@ def test_list_clusters(mocker, capsys):
captured = capsys.readouterr()
assert captured.out == (
"╭──────────────────────────────────────────────────────────────────────────────╮\n"
"│ No resources found, have you run cluster.up() yet? │\n"
"│ No resources found, have you run cluster.apply() yet? Run cluster.details() to check if it's ready. │\n"
"╰──────────────────────────────────────────────────────────────────────────────╯\n"
)
mocker.patch(
Expand Down
2 changes: 1 addition & 1 deletion src/codeflare_sdk/ray/cluster/test_pretty_print.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def test_print_no_resources(capsys):
captured = capsys.readouterr()
assert captured.out == (
"╭──────────────────────────────────────────────────────────────────────────────╮\n"
"│ No resources found, have you run cluster.up() yet? │\n"
"│ No resources found, have you run cluster.apply() yet? Run cluster.details() to check if it's ready. │\n"
"╰──────────────────────────────────────────────────────────────────────────────╯\n"
)

Expand Down
2 changes: 1 addition & 1 deletion tests/upgrade/raycluster_sdk_upgrade_sleep_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def run_mnist_raycluster_sdk_oauth(self):
)

try:
cluster.up()
cluster.apply()
cluster.status()
# wait for raycluster to be Ready
cluster.wait_ready()
Expand Down
4 changes: 2 additions & 2 deletions tests/upgrade/raycluster_sdk_upgrade_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


# Creates a Ray cluster
class TestMNISTRayClusterUp:
class TestMNISTRayClusterApply:
def setup_method(self):
initialize_kubernetes_client(self)
create_namespace_with_name(self, namespace)
Expand Down Expand Up @@ -63,7 +63,7 @@ def run_mnist_raycluster_sdk_oauth(self):
)

try:
cluster.up()
cluster.apply()
cluster.status()
# wait for raycluster to be Ready
cluster.wait_ready()
Expand Down
Loading