Skip to content

Commit 6e43e09

Browse files
chipspeakopenshift-merge-bot[bot]
authored andcommitted
task(RHOAIENG-28599): Removed dep fields min_cpus max_cpus min_memory max_memory
Signed-off-by: Pat O'Connor <[email protected]>
1 parent 973d320 commit 6e43e09

File tree

3 files changed

+3
-39
lines changed

3 files changed

+3
-39
lines changed

docs/sphinx/user-docs/cluster-configuration.rst

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,3 @@ deprecated.
172172
- ``head_cpu_requests``, ``head_cpu_limits``
173173
* - ``head_memory``
174174
- ``head_memory_requests``, ``head_memory_limits``
175-
* - ``min_cpus``
176-
- ``worker_cpu_requests``
177-
* - ``max_cpus``
178-
- ``worker_cpu_limits``
179-
* - ``min_memory``
180-
- ``worker_memory_requests``
181-
* - ``max_memory``
182-
- ``worker_memory_limits``

src/codeflare_sdk/ray/cluster/config.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,8 @@ class ClusterConfiguration:
5858
A dictionary of extended resource requests for the head node. ex: {"nvidia.com/gpu": 1}
5959
head_tolerations:
6060
List of tolerations for head nodes.
61-
min_cpus:
62-
The minimum number of CPUs to allocate to each worker.
63-
max_cpus:
64-
The maximum number of CPUs to allocate to each worker.
6561
num_workers:
6662
The number of workers to create.
67-
min_memory:
68-
The minimum amount of memory to allocate to each worker.
69-
max_memory:
70-
The maximum amount of memory to allocate to each worker.
7163
worker_tolerations:
7264
List of tolerations for worker nodes.
7365
appwrapper:
@@ -122,13 +114,9 @@ class ClusterConfiguration:
122114
head_tolerations: Optional[List[V1Toleration]] = None
123115
worker_cpu_requests: Union[int, str] = 1
124116
worker_cpu_limits: Union[int, str] = 1
125-
min_cpus: Optional[Union[int, str]] = None # Deprecating
126-
max_cpus: Optional[Union[int, str]] = None # Deprecating
127117
num_workers: int = 1
128118
worker_memory_requests: Union[int, str] = 2
129119
worker_memory_limits: Union[int, str] = 2
130-
min_memory: Optional[Union[int, str]] = None # Deprecating
131-
max_memory: Optional[Union[int, str]] = None # Deprecating
132120
worker_tolerations: Optional[List[V1Toleration]] = None
133121
appwrapper: bool = False
134122
envs: Dict[str, str] = field(default_factory=dict)
@@ -250,25 +238,13 @@ def _cpu_to_resource(self):
250238
"head_cpus is being deprecated, use head_cpu_requests and head_cpu_limits"
251239
)
252240
self.head_cpu_requests = self.head_cpu_limits = self.head_cpus
253-
if self.min_cpus:
254-
warnings.warn("min_cpus is being deprecated, use worker_cpu_requests")
255-
self.worker_cpu_requests = self.min_cpus
256-
if self.max_cpus:
257-
warnings.warn("max_cpus is being deprecated, use worker_cpu_limits")
258-
self.worker_cpu_limits = self.max_cpus
259241

260242
def _memory_to_resource(self):
261243
if self.head_memory:
262244
warnings.warn(
263245
"head_memory is being deprecated, use head_memory_requests and head_memory_limits"
264246
)
265247
self.head_memory_requests = self.head_memory_limits = self.head_memory
266-
if self.min_memory:
267-
warnings.warn("min_memory is being deprecated, use worker_memory_requests")
268-
self.worker_memory_requests = f"{self.min_memory}G"
269-
if self.max_memory:
270-
warnings.warn("max_memory is being deprecated, use worker_memory_limits")
271-
self.worker_memory_limits = f"{self.max_memory}G"
272248

273249
def _validate_types(self):
274250
"""Validate the types of all fields in the ClusterConfiguration dataclass."""

src/codeflare_sdk/ray/cluster/test_config.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -141,19 +141,15 @@ def test_cluster_config_deprecation_conversion(mocker):
141141
name="test",
142142
head_cpus=3,
143143
head_memory=16,
144-
min_memory=3,
145-
max_memory=4,
146-
min_cpus=1,
147-
max_cpus=2,
148144
)
149145
assert config.head_cpu_requests == 3
150146
assert config.head_cpu_limits == 3
151147
assert config.head_memory_requests == "16G"
152148
assert config.head_memory_limits == "16G"
153-
assert config.worker_memory_requests == "3G"
154-
assert config.worker_memory_limits == "4G"
149+
assert config.worker_memory_requests == "2G"
150+
assert config.worker_memory_limits == "2G"
155151
assert config.worker_cpu_requests == 1
156-
assert config.worker_cpu_limits == 2
152+
assert config.worker_cpu_limits == 1
157153

158154

159155
def test_gcs_fault_tolerance_config_validation():

0 commit comments

Comments
 (0)