Commit 85fe019
[Data] Deprecate V1 cluster autoscaler in favor of V2 (ray-project#60474)
## Description
This document describes how to verify the V1 cluster autoscaler
deprecation.
1. Added `@Deprecated` annotation to `DefaultClusterAutoscaler` in
`default_cluster_autoscaler.py`
2. Changed default from `V1` to `V2` in `__init__.py`
## Related issues
Closes ray-project#60459
## Additional information
### Testing
**Test V1 via env var emits deprecation warning:**
```bash
RAY_DATA_CLUSTER_AUTOSCALER=V1 python -c "
import warnings
warnings.simplefilter('always')
from unittest.mock import MagicMock
from ray.data._internal.cluster_autoscaler import create_cluster_autoscaler
mock_data_context = MagicMock()
mock_data_context.execution_options.resource_limits = None
autoscaler = create_cluster_autoscaler(MagicMock(), MagicMock(), mock_data_context, execution_id='test')
print(f'Created: {type(autoscaler).__name__}')
"
```
```
...RayDeprecationWarning: This API is deprecated and may be removed in future Ray releases...
DefaultClusterAutoscaler (V1) is deprecated. Use DefaultClusterAutoscalerV2 instead by setting RAY_DATA_CLUSTER_AUTOSCALER=V2 or using the default.
Created: DefaultClusterAutoscaler
```
**Test V2 (default) has no deprecation warning:**
```bash
python -c "
import warnings
warnings.filterwarnings('always', category=DeprecationWarning)
from unittest.mock import MagicMock
from ray.data._internal.cluster_autoscaler import create_cluster_autoscaler
mock_data_context = MagicMock()
mock_data_context.execution_options.resource_limits = None
autoscaler = create_cluster_autoscaler(MagicMock(), MagicMock(), mock_data_context, execution_id='test')
print(f'Created: {type(autoscaler).__name__}')
"
```
```
Created: DefaultClusterAutoscalerV2
```
---------
Signed-off-by: Ryan Huang <ryankert01@gmail.com>
Signed-off-by: 400Ping <jiekaichang@apache.org>1 parent 776f9a1 commit 85fe019
File tree
3 files changed
+31
-24
lines changed- python/ray
- data/_internal/cluster_autoscaler
- train/v2/tests
3 files changed
+31
-24
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
17 | 24 | | |
18 | 25 | | |
19 | 26 | | |
| |||
25 | 32 | | |
26 | 33 | | |
27 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
28 | 42 | | |
29 | 43 | | |
30 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
| 8 | + | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
105 | | - | |
106 | | - | |
| 104 | + | |
| 105 | + | |
107 | 106 | | |
108 | 107 | | |
109 | 108 | | |
110 | 109 | | |
111 | | - | |
| 110 | + | |
112 | 111 | | |
113 | | - | |
| 112 | + | |
114 | 113 | | |
115 | 114 | | |
116 | 115 | | |
| |||
123 | 122 | | |
124 | 123 | | |
125 | 124 | | |
126 | | - | |
| 125 | + | |
127 | 126 | | |
128 | 127 | | |
129 | 128 | | |
130 | 129 | | |
131 | 130 | | |
132 | 131 | | |
133 | | - | |
134 | | - | |
135 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
136 | 135 | | |
137 | | - | |
| 136 | + | |
138 | 137 | | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
| 138 | + | |
| 139 | + | |
143 | 140 | | |
144 | 141 | | |
145 | 142 | | |
146 | 143 | | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
154 | 147 | | |
155 | 148 | | |
156 | 149 | | |
| |||
0 commit comments