Skip to content

Commit a9b314e

Browse files
Revert "New ClusterConfiguration parameter for user labels"
This reverts commit e2cc8e1.
1 parent 4efbfdf commit a9b314e

File tree

3 files changed

+7
-23
lines changed

3 files changed

+7
-23
lines changed

Diff for: src/codeflare_sdk/cluster/cluster.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ def create_app_wrapper(self):
187187
write_to_file = self.config.write_to_file
188188
verify_tls = self.config.verify_tls
189189
local_queue = self.config.local_queue
190-
user_labels = self.config.user_labels
191190
return generate_appwrapper(
192191
name=name,
193192
namespace=namespace,
@@ -212,7 +211,6 @@ def create_app_wrapper(self):
212211
write_to_file=write_to_file,
213212
verify_tls=verify_tls,
214213
local_queue=local_queue,
215-
user_labels=user_labels,
216214
)
217215

218216
# creates a new cluster with the provided or default spec
@@ -455,7 +453,9 @@ def cluster_dashboard_uri(self) -> str:
455453
"name"
456454
] == f"ray-dashboard-{self.config.name}" or route["metadata"][
457455
"name"
458-
].startswith(f"{self.config.name}-ingress"):
456+
].startswith(
457+
f"{self.config.name}-ingress"
458+
):
459459
protocol = "https" if route["spec"].get("tls") else "http"
460460
return f"{protocol}://{route['spec']['host']}"
461461
else:

Diff for: src/codeflare_sdk/cluster/config.py

-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ class ClusterConfiguration:
5454
dispatch_priority: str = None
5555
write_to_file: bool = False
5656
verify_tls: bool = True
57-
user_labels: dict = field(default_factory=dict)
5857

5958
def __post_init__(self):
6059
if not self.verify_tls:

Diff for: src/codeflare_sdk/utils/generate_yaml.py

+4-19
Original file line numberDiff line numberDiff line change
@@ -309,11 +309,7 @@ def get_default_kueue_name(namespace: str):
309309

310310

311311
def write_components(
312-
user_yaml: dict,
313-
output_file_name: str,
314-
namespace: str,
315-
local_queue: Optional[str],
316-
user_labels: dict,
312+
user_yaml: dict, output_file_name: str, namespace: str, local_queue: Optional[str]
317313
):
318314
# Create the directory if it doesn't exist
319315
directory_path = os.path.dirname(output_file_name)
@@ -335,8 +331,6 @@ def write_components(
335331
]
336332
labels = component["generictemplate"]["metadata"]["labels"]
337333
labels.update({"kueue.x-k8s.io/queue-name": lq_name})
338-
for key in user_labels:
339-
labels.update({key: user_labels[key]})
340334
outfile.write("---\n")
341335
yaml.dump(
342336
component["generictemplate"], outfile, default_flow_style=False
@@ -345,11 +339,7 @@ def write_components(
345339

346340

347341
def load_components(
348-
user_yaml: dict,
349-
name: str,
350-
namespace: str,
351-
local_queue: Optional[str],
352-
user_labels: dict,
342+
user_yaml: dict, name: str, namespace: str, local_queue: Optional[str]
353343
):
354344
component_list = []
355345
components = user_yaml.get("spec", "resources")["resources"].get("GenericItems")
@@ -365,8 +355,6 @@ def load_components(
365355
]
366356
labels = component["generictemplate"]["metadata"]["labels"]
367357
labels.update({"kueue.x-k8s.io/queue-name": lq_name})
368-
for key in user_labels:
369-
labels.update({key: user_labels[key]})
370358
component_list.append(component["generictemplate"])
371359

372360
resources = "---\n" + "---\n".join(
@@ -407,7 +395,6 @@ def generate_appwrapper(
407395
write_to_file: bool,
408396
verify_tls: bool,
409397
local_queue: Optional[str],
410-
user_labels,
411398
):
412399
user_yaml = read_template(template)
413400
appwrapper_name, cluster_name = gen_names(name)
@@ -459,13 +446,11 @@ def generate_appwrapper(
459446
if mcad:
460447
write_user_appwrapper(user_yaml, outfile)
461448
else:
462-
write_components(user_yaml, outfile, namespace, local_queue, user_labels)
449+
write_components(user_yaml, outfile, namespace, local_queue)
463450
return outfile
464451
else:
465452
if mcad:
466453
user_yaml = load_appwrapper(user_yaml, name)
467454
else:
468-
user_yaml = load_components(
469-
user_yaml, name, namespace, local_queue, user_labels
470-
)
455+
user_yaml = load_components(user_yaml, name, namespace, local_queue)
471456
return user_yaml

0 commit comments

Comments
 (0)