Repository: modin-project/modin

Issue:
Align default value of REDIS_PASSWORD with Ray
<!--
General questions should be asked on the mailing list modin-dev@googlegroups.com.

Before submitting an issue, please fill out the following form.
-->

### System information
- **OS Platform and Distribution (e.g., Linux Ubuntu 16.04)**: all
- **Modin installed from (source or binary)**: source
- **Modin version**: edc16083648e80f9c54095a2817b589511257668
- **Python version**: 3.8.12
- **Exact command to reproduce**:

```python
import modin.pandas as pd
from modin.config import IsRayCluster
IsRayCluster.put(True)

df = pd.DataFrame([])
```

<!--
You can obtain the Modin version with

python -c "import modin; print(modin.__version__)"
-->

### Describe the problem
<!-- Describe the problem clearly here. -->
The current default redis password (`RayRedisPassword`) is incompatible with the default value in Ray. It would be better to use default value from Ray:
```python
from ray import ray_constants

ray_constants.REDIS_DEFAULT_PASSWORD

This makes possible to connect to the default Ray cluster without set `MODIN_REDIS_PASSWORD`
```

### 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. -->
```bash
2021-11-29 12:20:28,389 INFO worker.py:726 -- Connecting to existing Ray cluster at address: 10.125.130.30:6379
Traceback (most recent call last):
  File "test4.py", line 5, in <module>
    df = pd.DataFrame([])
  File "/localdisk/aprutsko/modin/modin/pandas/dataframe.py", line 109, in __init__
    Engine.subscribe(_update_engine)
  File "/localdisk/aprutsko/modin/modin/config/pubsub.py", line 213, in subscribe
    callback(cls)
  File "/localdisk/aprutsko/modin/modin/pandas/__init__.py", line 127, in _update_engine
    initialize_ray()
  File "/localdisk/aprutsko/modin/modin/core/execution/ray/common/utils.py", line 120, in initialize_ray
    ray.init(
  File "/localdisk/aprutsko/miniconda3/envs/modin/lib/python3.8/site-packages/ray/_private/client_mode_hook.py", line 62, in wrapper
    return func(*args, **kwargs)
  File "/localdisk/aprutsko/miniconda3/envs/modin/lib/python3.8/site-packages/ray/worker.py", line 830, in init
    _global_node = ray.node.Node(
  File "/localdisk/aprutsko/miniconda3/envs/modin/lib/python3.8/site-packages/ray/node.py", line 163, in __init__
    session_name = _get_with_retry(redis_client, "session_name")
  File "/localdisk/aprutsko/miniconda3/envs/modin/lib/python3.8/site-packages/ray/node.py", line 41, in _get_with_retry
    result = redis_client.get(key)
  File "/localdisk/aprutsko/miniconda3/envs/modin/lib/python3.8/site-packages/redis/client.py", line 1606, in get
    return self.execute_command('GET', name)
  File "/localdisk/aprutsko/miniconda3/envs/modin/lib/python3.8/site-packages/redis/client.py", line 898, in execute_command
    conn = self.connection or pool.get_connection(command_name, **options)
  File "/localdisk/aprutsko/miniconda3/envs/modin/lib/python3.8/site-packages/redis/connection.py", line 1192, in get_connection
    connection.connect()
  File "/localdisk/aprutsko/miniconda3/envs/modin/lib/python3.8/site-packages/redis/connection.py", line 567, in connect
    self.on_connect()
  File "/localdisk/aprutsko/miniconda3/envs/modin/lib/python3.8/site-packages/redis/connection.py", line 643, in on_connect
    auth_response = self.read_response()
  File "/localdisk/aprutsko/miniconda3/envs/modin/lib/python3.8/site-packages/redis/connection.py", line 756, in read_response
    raise response
redis.exceptions.ResponseError: WRONGPASS invalid username-password pair
```



Discussion:

Resolving patch:
diff --git a/modin/core/execution/ray/common/utils.py b/modin/core/execution/ray/common/utils.py
--- a/modin/core/execution/ray/common/utils.py
+++ b/modin/core/execution/ray/common/utils.py
@@ -30,6 +30,7 @@
     GpuCount,
     Memory,
     NPartitions,
+    ValueSource,
 )
 
 
@@ -113,7 +114,16 @@ def initialize_ray(
     if not ray.is_initialized() or override_is_cluster:
         cluster = override_is_cluster or IsRayCluster.get()
         redis_address = override_redis_address or RayRedisAddress.get()
-        redis_password = override_redis_password or RayRedisPassword.get()
+        redis_password = (
+            (
+                ray.ray_constants.REDIS_DEFAULT_PASSWORD
+                if cluster
+                else RayRedisPassword.get()
+            )
+            if override_redis_password is None
+            and RayRedisPassword.get_value_source() == ValueSource.DEFAULT
+            else override_redis_password or RayRedisPassword.get()
+        )
 
         if cluster:
             # We only start ray in a cluster setting for the head node.


Test patch: