@@ -50,10 +50,6 @@ class ClusterConfiguration:
50
50
The name of the cluster.
51
51
namespace:
52
52
The namespace in which the cluster should be created.
53
- head_cpus:
54
- The number of CPUs to allocate to the head node.
55
- head_memory:
56
- The amount of memory to allocate to the head node.
57
53
head_extended_resource_requests:
58
54
A dictionary of extended resource requests for the head node. ex: {"nvidia.com/gpu": 1}
59
55
head_tolerations:
@@ -104,10 +100,8 @@ class ClusterConfiguration:
104
100
namespace : Optional [str ] = None
105
101
head_cpu_requests : Union [int , str ] = 2
106
102
head_cpu_limits : Union [int , str ] = 2
107
- head_cpus : Optional [Union [int , str ]] = None # Deprecating
108
103
head_memory_requests : Union [int , str ] = 8
109
104
head_memory_limits : Union [int , str ] = 8
110
- head_memory : Optional [Union [int , str ]] = None # Deprecating
111
105
head_extended_resource_requests : Dict [str , Union [str , int ]] = field (
112
106
default_factory = dict
113
107
)
@@ -173,10 +167,8 @@ def __post_init__(self):
173
167
)
174
168
175
169
self ._validate_types ()
176
- self ._memory_to_resource ()
177
170
self ._memory_to_string ()
178
171
self ._str_mem_no_unit_add_GB ()
179
- self ._cpu_to_resource ()
180
172
self ._combine_extended_resource_mapping ()
181
173
self ._validate_extended_resource_requests (self .head_extended_resource_requests )
182
174
self ._validate_extended_resource_requests (
@@ -209,8 +201,6 @@ def _validate_extended_resource_requests(self, extended_resources: Dict[str, int
209
201
)
210
202
211
203
def _str_mem_no_unit_add_GB (self ):
212
- if isinstance (self .head_memory , str ) and self .head_memory .isdecimal ():
213
- self .head_memory = f"{ self .head_memory } G"
214
204
if (
215
205
isinstance (self .worker_memory_requests , str )
216
206
and self .worker_memory_requests .isdecimal ()
@@ -232,20 +222,6 @@ def _memory_to_string(self):
232
222
if isinstance (self .worker_memory_limits , int ):
233
223
self .worker_memory_limits = f"{ self .worker_memory_limits } G"
234
224
235
- def _cpu_to_resource (self ):
236
- if self .head_cpus :
237
- warnings .warn (
238
- "head_cpus is being deprecated, use head_cpu_requests and head_cpu_limits"
239
- )
240
- self .head_cpu_requests = self .head_cpu_limits = self .head_cpus
241
-
242
- def _memory_to_resource (self ):
243
- if self .head_memory :
244
- warnings .warn (
245
- "head_memory is being deprecated, use head_memory_requests and head_memory_limits"
246
- )
247
- self .head_memory_requests = self .head_memory_limits = self .head_memory
248
-
249
225
def _validate_types (self ):
250
226
"""Validate the types of all fields in the ClusterConfiguration dataclass."""
251
227
errors = []
0 commit comments