Repository: modin-project/modin

Issue:
Update ray API used for cloud features after pin ray>=1.0.0
### System information
- **OS Platform and Distribution (e.g., Linux Ubuntu 16.04)**:
- **Modin version** (`modin.__version__`): `0.8.1.1`
- **Python version**:
- **Code we can use to reproduce**:

<!--
You can obtain the Modin version with

python -c "import modin; print(modin.__version__)"
-->

### Describe the problem
<!-- Describe the problem clearly here. -->

```shell
...
modin.experimental.cloud.base.CannotSpawnCluster: cause: create_or_update_cluste
r() got an unexpected keyword argument 'log_old_style'
Cannot spawn cluster
Cannot destroy cluster:
Traceback (most recent call last):
  File "modin/modin/experimental/cloud/rayscale.py", line 2
20, in __do_destroy
    teardown_cluster(
TypeError: teardown_cluster() got an unexpected keyword argument 'log_old_style'
...
```

### Source code / logs
<!-- Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached. Try to provide a reproducible test case that is the bare minimum necessary to generate the problem. -->



Discussion:

Resolving patch:
diff --git a/modin/experimental/cloud/rayscale.py b/modin/experimental/cloud/rayscale.py
--- a/modin/experimental/cloud/rayscale.py
+++ b/modin/experimental/cloud/rayscale.py
@@ -200,9 +200,8 @@ def __do_spawn(self):
                 yes=True,
                 override_cluster_name=None,
                 no_config_cache=False,
-                log_old_style=False,
-                log_color="auto",
-                verbose=1,
+                redirect_command_output=False,
+                use_login_shells=True,
             )
             # need to re-load the config, as create_or_update_cluster() modifies it
             with open(self.config_file) as inp:
@@ -223,9 +222,6 @@ def __do_destroy(self):
                 workers_only=False,
                 override_cluster_name=None,
                 keep_min_workers=0,
-                log_old_style=False,
-                log_color="auto",
-                verbose=1,
             )
             self.ready = False
             self.config = None


Test patch:
diff --git a/modin/experimental/cloud/test/test_cloud.py b/modin/experimental/cloud/test/test_cloud.py
--- a/modin/experimental/cloud/test/test_cloud.py
+++ b/modin/experimental/cloud/test/test_cloud.py
@@ -14,8 +14,90 @@
 import unittest.mock as mock
 import pytest
 from collections import namedtuple
+from inspect import signature
 from modin.experimental.cloud.rayscale import RayCluster
 from modin.experimental.cloud.cluster import Provider
+from ray.autoscaler.commands import (
+    create_or_update_cluster,
+    teardown_cluster,
+    get_head_node_ip,
+    _bootstrap_config,
+)
+
+
+@pytest.fixture
+def make_bootstrap_config_mock():
+    def bootstrap_config_mock(config, *args, **kwargs):
+        signature(_bootstrap_config).bind(config, *args, **kwargs)
+        config["auth"]["ssh_user"] = "modin"
+        config["auth"]["ssh_private_key"] = "X" * 20
+        return config
+
+    return bootstrap_config_mock
+
+
+@pytest.fixture
+def make_get_head_node_ip_mock():
+    def get_head_node_ip_mock(*args, **kwargs):
+        signature(get_head_node_ip).bind(*args, **kwargs)
+        return "127.0.0.1"
+
+    return get_head_node_ip_mock
+
+
+@pytest.fixture
+def make_teardown_cluster_mock():
+    return lambda *args, **kw: signature(teardown_cluster).bind(*args, **kw)
+
+
+@pytest.fixture
+def make_create_or_update_cluster_mock():
+    return lambda *args, **kw: signature(create_or_update_cluster).bind(*args, **kw)
+
+
+@pytest.fixture
+def make_ray_cluster(make_bootstrap_config_mock):
+    def ray_cluster():
+        with mock.patch(
+            "modin.experimental.cloud.rayscale._bootstrap_config",
+            make_bootstrap_config_mock,
+        ):
+            ray_cluster = RayCluster(
+                Provider(name="aws"), add_conda_packages=["scikit-learn>=0.23"]
+            )
+        return ray_cluster
+
+    return ray_cluster
+
+
+def test__bootstrap_config(make_ray_cluster):
+    make_ray_cluster()
+
+
+def test_get_head_node_ip(make_ray_cluster, make_get_head_node_ip_mock):
+    ray_cluster = make_ray_cluster()
+
+    with mock.patch(
+        "modin.experimental.cloud.rayscale.get_head_node_ip", make_get_head_node_ip_mock
+    ):
+        ray_cluster.ready = True
+        details = ray_cluster._get_connection_details()
+        assert details.address == "127.0.0.1"
+
+
+def test_teardown_cluster(make_ray_cluster, make_teardown_cluster_mock):
+    with mock.patch(
+        "modin.experimental.cloud.rayscale.teardown_cluster", make_teardown_cluster_mock
+    ):
+        make_ray_cluster()._destroy(wait=True)
+
+
+def test_create_or_update_cluster(make_ray_cluster, make_create_or_update_cluster_mock):
+    with mock.patch(
+        "modin.experimental.cloud.rayscale.create_or_update_cluster",
+        make_create_or_update_cluster_mock,
+    ):
+        make_ray_cluster()._spawn(wait=True)
 
 
 @pytest.mark.parametrize(
@@ -29,17 +111,10 @@
         """
     ],
 )
-def test_update_conda_requirements(setup_commands_source):
-    with mock.patch(
-        "modin.experimental.cloud.rayscale._bootstrap_config", lambda config: config
-    ):
-        ray_cluster = RayCluster(
-            Provider(name="aws"), add_conda_packages=["scikit-learn>=0.23"]
-        )
-
+def test_update_conda_requirements(setup_commands_source, make_ray_cluster):
     fake_version = namedtuple("FakeVersion", "major minor micro")(7, 12, 45)
     with mock.patch("sys.version_info", fake_version):
-        setup_commands_result = ray_cluster._update_conda_requirements(
+        setup_commands_result = make_ray_cluster()._update_conda_requirements(
             setup_commands_source
         )