Repository: modin-project/modin

Issue:
ModuleNotFoundError for experimental cloud feature after ray==1.0.1 release
```python
_________ ERROR collecting modin/experimental/cloud/test/test_cloud.py _________
ImportError while importing test module '/home/runner/work/modin/modin/modin/experimental/cloud/test/test_cloud.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/share/miniconda/envs/modin/lib/python3.6/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
modin/experimental/cloud/test/test_cloud.py:18: in <module>
    from modin.experimental.cloud.rayscale import RayCluster
modin/experimental/cloud/rayscale.py:24: in <module>
    from ray.autoscaler.commands import (
E   ModuleNotFoundError: No module named 'ray.autoscaler.commands'
```


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
@@ -21,12 +21,23 @@
 import subprocess
 
 import yaml
-from ray.autoscaler.commands import (
-    create_or_update_cluster,
-    teardown_cluster,
-    get_head_node_ip,
-    _bootstrap_config,
-)
+
+try:
+    # for ray>=1.0.1
+    from ray.autoscaler.sdk import (
+        create_or_update_cluster,
+        teardown_cluster,
+        get_head_node_ip,
+        bootstrap_config,
+    )
+except ModuleNotFoundError:
+    # for ray==1.0.0
+    from ray.autoscaler.commands import (
+        create_or_update_cluster,
+        teardown_cluster,
+        get_head_node_ip,
+        _bootstrap_config as bootstrap_config,
+    )
 
 from .base import (
     CannotSpawnCluster,
@@ -140,7 +151,7 @@ def __make_config(self):
         res = self._update_conda_requirements(config["setup_commands"][0])
         config["setup_commands"][0] = res
 
-        return _bootstrap_config(config)
+        return bootstrap_config(config)
 
     def _conda_requirements(self):
         import shlex
@@ -197,15 +208,9 @@ def __do_spawn(self):
         try:
             create_or_update_cluster(
                 self.config_file,
-                override_min_workers=None,
-                override_max_workers=None,
                 no_restart=False,
                 restart_only=False,
-                yes=True,
-                override_cluster_name=None,
                 no_config_cache=False,
-                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:
@@ -220,13 +225,7 @@ def __do_spawn(self):
 
     def __do_destroy(self):
         try:
-            teardown_cluster(
-                self.config_file,
-                yes=True,
-                workers_only=False,
-                override_cluster_name=None,
-                keep_min_workers=0,
-            )
+            teardown_cluster(self.config_file)
             self.ready = False
             self.config = None
         except BaseException as ex:
@@ -244,7 +243,7 @@ def _get_connection_details(self) -> ConnectionDetails:
         return ConnectionDetails(
             user_name=self.config["auth"]["ssh_user"],
             key_file=self.config["auth"]["ssh_private_key"],
-            address=get_head_node_ip(self.config_file, override_cluster_name=None),
+            address=get_head_node_ip(self.config_file),
         )
 
     def _get_main_python(self) -> str:


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
@@ -15,20 +15,20 @@
 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 (
+from modin.experimental.cloud.rayscale import (
+    RayCluster,
     create_or_update_cluster,
     teardown_cluster,
     get_head_node_ip,
-    _bootstrap_config,
+    bootstrap_config,
 )
+from modin.experimental.cloud.cluster import Provider
 
 
 @pytest.fixture
 def make_bootstrap_config_mock():
     def bootstrap_config_mock(config, *args, **kwargs):
-        signature(_bootstrap_config).bind(config, *args, **kwargs)
+        signature(bootstrap_config).bind(config, *args, **kwargs)
         config["auth"]["ssh_user"] = "modin"
         config["auth"]["ssh_private_key"] = "X" * 20
         return config
@@ -59,7 +59,7 @@ def make_create_or_update_cluster_mock():
 def make_ray_cluster(make_bootstrap_config_mock):
     def ray_cluster(conda_packages=None):
         with mock.patch(
-            "modin.experimental.cloud.rayscale._bootstrap_config",
+            "modin.experimental.cloud.rayscale.bootstrap_config",
             make_bootstrap_config_mock,
         ):
             ray_cluster = RayCluster(
@@ -71,7 +71,7 @@ def ray_cluster(conda_packages=None):
     return ray_cluster
 
 
-def test__bootstrap_config(make_ray_cluster):
+def test_bootstrap_config(make_ray_cluster):
     make_ray_cluster()