Skip to content

Commit 9f629f8

Browse files
authoredApr 5, 2024··
Remove ingress/routes logic from SDK (#495)
* WIP - Remove ingress/routes logic from SDK * Remove ingress_options and update tests
1 parent 403cca6 commit 9f629f8

13 files changed

+139
-688
lines changed
 

‎.github/workflows/e2e_tests.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ jobs:
8484
cd codeflare-operator
8585
echo Deploying CodeFlare operator
8686
IMG="${REGISTRY_ADDRESS}"/codeflare-operator
87+
sed -i 's/RayDashboardOAuthEnabled: pointer.Bool(true)/RayDashboardOAuthEnabled: pointer.Bool(false)/' main.go
8788
make image-push -e IMG="${IMG}"
8889
make deploy -e IMG="${IMG}" -e ENV="e2e"
8990
kubectl wait --timeout=120s --for=condition=Available=true deployment -n openshift-operators codeflare-operator-manager

‎src/codeflare_sdk/cluster/cluster.py

-100
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,6 @@ def create_app_wrapper(self):
187187
local_interactive = self.config.local_interactive
188188
image_pull_secrets = self.config.image_pull_secrets
189189
dispatch_priority = self.config.dispatch_priority
190-
ingress_domain = self.config.ingress_domain
191-
ingress_options = self.config.ingress_options
192190
write_to_file = self.config.write_to_file
193191
verify_tls = self.config.verify_tls
194192
return generate_appwrapper(
@@ -213,8 +211,6 @@ def create_app_wrapper(self):
213211
image_pull_secrets=image_pull_secrets,
214212
dispatch_priority=dispatch_priority,
215213
priority_val=priority_val,
216-
ingress_domain=ingress_domain,
217-
ingress_options=ingress_options,
218214
write_to_file=write_to_file,
219215
verify_tls=verify_tls,
220216
)
@@ -493,8 +489,6 @@ def torchx_config(
493489
def from_k8_cluster_object(
494490
rc,
495491
mcad=True,
496-
ingress_domain=None,
497-
ingress_options={},
498492
write_to_file=False,
499493
verify_tls=True,
500494
):
@@ -512,11 +506,6 @@ def from_k8_cluster_object(
512506
else []
513507
)
514508

515-
if local_interactive and ingress_domain == None:
516-
ingress_domain = rc["metadata"]["annotations"][
517-
"sdk.codeflare.dev/ingress_domain"
518-
]
519-
520509
cluster_config = ClusterConfiguration(
521510
name=rc["metadata"]["name"],
522511
namespace=rc["metadata"]["namespace"],
@@ -553,8 +542,6 @@ def from_k8_cluster_object(
553542
]["image"],
554543
local_interactive=local_interactive,
555544
mcad=mcad,
556-
ingress_domain=ingress_domain,
557-
ingress_options=ingress_options,
558545
write_to_file=write_to_file,
559546
verify_tls=verify_tls,
560547
)
@@ -661,62 +648,9 @@ def get_cluster(
661648
for rc in rcs["items"]:
662649
if rc["metadata"]["name"] == cluster_name:
663650
mcad = _check_aw_exists(cluster_name, namespace)
664-
ingress_host = None
665-
ingress_options = {}
666-
if not is_openshift_cluster():
667-
try:
668-
config_check()
669-
api_instance = client.NetworkingV1Api(api_config_handler())
670-
ingresses = api_instance.list_namespaced_ingress(namespace)
671-
for ingress in ingresses.items:
672-
# Search for ingress with AppWrapper name as the owner
673-
if (
674-
"ingress-owner" in ingress.metadata.labels
675-
and ingress.metadata.labels["ingress-owner"] == cluster_name
676-
):
677-
ingress_host = ingress.spec.rules[0].host
678-
if (
679-
"ingress-options" in ingress.metadata.labels
680-
and ingress.metadata.labels["ingress-options"] == "true"
681-
):
682-
ingress_name = ingress.metadata.name
683-
port = (
684-
ingress.spec.rules[0]
685-
.http.paths[0]
686-
.backend.service.port.number
687-
)
688-
annotations = ingress.metadata.annotations
689-
path = ingress.spec.rules[0].http.paths[0].path
690-
ingress_class_name = ingress.spec.ingress_class_name
691-
path_type = (
692-
ingress.spec.rules[0].http.paths[0].path_type
693-
)
694-
695-
ingress_options = {
696-
"ingresses": [
697-
{
698-
"ingressName": ingress_name,
699-
"port": port,
700-
"annotations": annotations,
701-
"ingressClassName": ingress_class_name,
702-
"pathType": path_type,
703-
"path": path,
704-
"host": ingress_host,
705-
}
706-
]
707-
}
708-
except Exception as e: # pragma: no cover
709-
return _kube_api_error_handling(e)
710-
# We gather the ingress domain from the host
711-
if ingress_host is not None and ingress_options == {}:
712-
ingress_domain = ingress_host.split(".", 1)[1]
713-
else:
714-
ingress_domain = None
715651
return Cluster.from_k8_cluster_object(
716652
rc,
717653
mcad=mcad,
718-
ingress_domain=ingress_domain,
719-
ingress_options=ingress_options,
720654
write_to_file=write_to_file,
721655
verify_tls=verify_tls,
722656
)
@@ -739,24 +673,6 @@ def _delete_resources(
739673
plural="rayclusters",
740674
name=name,
741675
)
742-
elif resource["kind"] == "Ingress":
743-
name = resource["metadata"]["name"]
744-
api_instance.delete_namespaced_custom_object(
745-
group="networking.k8s.io",
746-
version="v1",
747-
namespace=namespace,
748-
plural="ingresses",
749-
name=name,
750-
)
751-
elif resource["kind"] == "Route":
752-
name = resource["metadata"]["name"]
753-
api_instance.delete_namespaced_custom_object(
754-
group="route.openshift.io",
755-
version="v1",
756-
namespace=namespace,
757-
plural="routes",
758-
name=name,
759-
)
760676
elif resource["kind"] == "Secret":
761677
name = resource["metadata"]["name"]
762678
secret_instance = client.CoreV1Api(api_config_handler())
@@ -776,22 +692,6 @@ def _create_resources(yamls, namespace: str, api_instance: client.CustomObjectsA
776692
plural="rayclusters",
777693
body=resource,
778694
)
779-
elif resource["kind"] == "Ingress":
780-
api_instance.create_namespaced_custom_object(
781-
group="networking.k8s.io",
782-
version="v1",
783-
namespace=namespace,
784-
plural="ingresses",
785-
body=resource,
786-
)
787-
elif resource["kind"] == "Route":
788-
api_instance.create_namespaced_custom_object(
789-
group="route.openshift.io",
790-
version="v1",
791-
namespace=namespace,
792-
plural="routes",
793-
body=resource,
794-
)
795695
elif resource["kind"] == "Secret":
796696
secret_instance = client.CoreV1Api(api_config_handler())
797697
secret_instance.create_namespaced_secret(

‎src/codeflare_sdk/cluster/config.py

-2
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ class ClusterConfiguration:
5252
local_interactive: bool = False
5353
image_pull_secrets: list = field(default_factory=list)
5454
dispatch_priority: str = None
55-
ingress_options: dict = field(default_factory=dict)
56-
ingress_domain: str = None
5755
write_to_file: bool = False
5856
verify_tls: bool = True
5957

‎src/codeflare_sdk/templates/base-template.yaml

-85
Original file line numberDiff line numberDiff line change
@@ -338,91 +338,6 @@ spec:
338338
- key: odh-ca-bundle.crt
339339
path: odh-ca-bundle.crt
340340
optional: true
341-
- replicas: 1
342-
generictemplate:
343-
apiVersion: networking.k8s.io/v1
344-
kind: Ingress
345-
metadata:
346-
name: ray-dashboard-deployment-ingress
347-
namespace: default
348-
annotations:
349-
annotations-example:annotations-example
350-
labels:
351-
ingress-options: "false"
352-
ingress-owner: appwrapper-name
353-
spec:
354-
ingressClassName: nginx
355-
rules:
356-
- http:
357-
paths:
358-
- backend:
359-
service:
360-
name: raytest-head-svc
361-
port:
362-
number: 8265
363-
pathType: Prefix
364-
path: /
365-
host: ray-dashboard-raytest.<ingress-domain>
366-
- replicas: 1
367-
generictemplate:
368-
kind: Route
369-
apiVersion: route.openshift.io/v1
370-
metadata:
371-
name: ray-dashboard-deployment-route
372-
namespace: default
373-
labels:
374-
# allows me to return name of service that Ray operator creates
375-
odh-ray-cluster-service: deployment-name-head-svc
376-
spec:
377-
to:
378-
kind: Service
379-
name: deployment-name-head-svc
380-
port:
381-
targetPort: dashboard
382-
tls:
383-
termination: edge
384-
- replicas: 1
385-
generictemplate:
386-
apiVersion: networking.k8s.io/v1
387-
kind: Ingress
388-
metadata:
389-
name: rayclient-deployment-ingress
390-
namespace: default
391-
annotations:
392-
annotations-example:annotations-example
393-
labels:
394-
odh-ray-cluster-service: deployment-name-head-svc
395-
spec:
396-
ingressClassName: nginx
397-
rules:
398-
- http:
399-
paths:
400-
- backend:
401-
service:
402-
name: deployment-name-head-svc
403-
port:
404-
number: 10001
405-
path: ''
406-
pathType: ImplementationSpecific
407-
host: rayclient-raytest.<ingress-domain>
408-
- replicas: 1
409-
generictemplate:
410-
apiVersion: route.openshift.io/v1
411-
kind: Route
412-
metadata:
413-
name: rayclient-deployment-route
414-
namespace: default
415-
labels:
416-
# allows me to return name of service that Ray operator creates
417-
odh-ray-cluster-service: deployment-name-head-svc
418-
spec:
419-
port:
420-
targetPort: client
421-
tls:
422-
termination: passthrough
423-
to:
424-
kind: Service
425-
name: deployment-name-head-svc
426341
- replicas: 1
427342
generictemplate:
428343
apiVersion: v1

‎src/codeflare_sdk/utils/generate_yaml.py

+24-220
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@ def gen_names(name):
4949
return name, name
5050

5151

52-
def gen_dashboard_ingress_name(cluster_name):
53-
return f"ray-dashboard-{cluster_name}"
54-
55-
5652
# Check if the routes api exists
5753
def is_openshift_cluster():
5854
try:
@@ -67,156 +63,17 @@ def is_openshift_cluster():
6763
return _kube_api_error_handling(e)
6864

6965

70-
def update_dashboard_route(route_item, cluster_name, namespace):
71-
metadata = route_item.get("generictemplate", {}).get("metadata")
72-
metadata["name"] = gen_dashboard_ingress_name(cluster_name)
73-
metadata["namespace"] = namespace
74-
metadata["labels"]["odh-ray-cluster-service"] = f"{cluster_name}-head-svc"
75-
spec = route_item.get("generictemplate", {}).get("spec")
76-
spec["to"]["name"] = f"{cluster_name}-head-svc"
77-
78-
79-
# ToDo: refactor the update_x_route() functions
80-
def update_rayclient_route(route_item, cluster_name, namespace):
81-
metadata = route_item.get("generictemplate", {}).get("metadata")
82-
metadata["name"] = f"rayclient-{cluster_name}"
83-
metadata["namespace"] = namespace
84-
metadata["labels"]["odh-ray-cluster-service"] = f"{cluster_name}-head-svc"
85-
spec = route_item.get("generictemplate", {}).get("spec")
86-
spec["to"]["name"] = f"{cluster_name}-head-svc"
87-
88-
89-
def update_dashboard_exposure(
90-
ingress_item, route_item, cluster_name, namespace, ingress_options, ingress_domain
91-
):
92-
if is_openshift_cluster():
93-
update_dashboard_route(route_item, cluster_name, namespace)
94-
else:
95-
update_dashboard_ingress(
96-
ingress_item, cluster_name, namespace, ingress_options, ingress_domain
97-
)
98-
99-
100-
def update_rayclient_exposure(
101-
client_route_item, client_ingress_item, cluster_name, namespace, ingress_domain
102-
):
103-
if is_openshift_cluster():
104-
update_rayclient_route(client_route_item, cluster_name, namespace)
105-
else:
106-
update_rayclient_ingress(
107-
client_ingress_item, cluster_name, namespace, ingress_domain
108-
)
109-
110-
111-
def update_dashboard_ingress(
112-
ingress_item, cluster_name, namespace, ingress_options, ingress_domain
113-
): # pragma: no cover
114-
metadata = ingress_item.get("generictemplate", {}).get("metadata")
115-
spec = ingress_item.get("generictemplate", {}).get("spec")
116-
if ingress_options != {}:
117-
for index, ingress_option in enumerate(ingress_options["ingresses"]):
118-
if "ingressName" not in ingress_option.keys():
119-
raise ValueError(
120-
f"Error: 'ingressName' is missing or empty for ingress item at index {index}"
121-
)
122-
if "port" not in ingress_option.keys():
123-
raise ValueError(
124-
f"Error: 'port' is missing or empty for ingress item at index {index}"
125-
)
126-
elif not isinstance(ingress_option["port"], int):
127-
raise ValueError(
128-
f"Error: 'port' is not of type int for ingress item at index {index}"
129-
)
130-
if ingress_option is not None:
131-
metadata["name"] = ingress_option["ingressName"]
132-
metadata["namespace"] = namespace
133-
metadata["labels"]["ingress-owner"] = cluster_name
134-
metadata["labels"]["ingress-options"] = "true"
135-
if (
136-
"annotations" not in ingress_option.keys()
137-
or ingress_option["annotations"] is None
138-
):
139-
del metadata["annotations"]
140-
else:
141-
metadata["annotations"] = ingress_option["annotations"]
142-
if (
143-
"path" not in ingress_option.keys()
144-
or ingress_option["path"] is None
145-
):
146-
del spec["rules"][0]["http"]["paths"][0]["path"]
147-
else:
148-
spec["rules"][0]["http"]["paths"][0]["path"] = ingress_option[
149-
"path"
150-
]
151-
if (
152-
"pathType" not in ingress_option.keys()
153-
or ingress_option["pathType"] is None
154-
):
155-
spec["rules"][0]["http"]["paths"][0][
156-
"pathType"
157-
] = "ImplementationSpecific"
158-
if (
159-
"host" not in ingress_option.keys()
160-
or ingress_option["host"] is None
161-
):
162-
del spec["rules"][0]["host"]
163-
else:
164-
spec["rules"][0]["host"] = ingress_option["host"]
165-
if (
166-
"ingressClassName" not in ingress_option.keys()
167-
or ingress_option["ingressClassName"] is None
168-
):
169-
del spec["ingressClassName"]
170-
else:
171-
spec["ingressClassName"] = ingress_option["ingressClassName"]
172-
173-
spec["rules"][0]["http"]["paths"][0]["backend"]["service"][
174-
"name"
175-
] = f"{cluster_name}-head-svc"
176-
else:
177-
spec["ingressClassName"] = "nginx"
178-
metadata["name"] = gen_dashboard_ingress_name(cluster_name)
179-
metadata["labels"]["ingress-owner"] = cluster_name
180-
metadata["namespace"] = namespace
181-
spec["rules"][0]["http"]["paths"][0]["backend"]["service"][
182-
"name"
183-
] = f"{cluster_name}-head-svc"
184-
if ingress_domain is None:
185-
raise ValueError(
186-
"ingress_domain is invalid. Please specify an ingress domain"
187-
)
188-
else:
189-
domain = ingress_domain
190-
del metadata["annotations"]
191-
spec["rules"][0]["host"] = f"ray-dashboard-{cluster_name}-{namespace}.{domain}"
192-
193-
194-
def update_rayclient_ingress(
195-
ingress_item, cluster_name, namespace, ingress_domain
196-
): # pragma: no cover
197-
metadata = ingress_item.get("generictemplate", {}).get("metadata")
198-
spec = ingress_item.get("generictemplate", {}).get("spec")
199-
metadata["name"] = f"rayclient-{cluster_name}"
200-
metadata["namespace"] = namespace
201-
metadata["labels"]["odh-ray-cluster-service"] = f"{cluster_name}-head-svc"
202-
203-
spec["rules"][0]["http"]["paths"][0]["backend"]["service"][
204-
"name"
205-
] = f"{cluster_name}-head-svc"
206-
207-
if ingress_domain is not None:
208-
ingressClassName = "nginx"
209-
annotations = {
210-
"nginx.ingress.kubernetes.io/rewrite-target": "/",
211-
"nginx.ingress.kubernetes.io/ssl-redirect": "true",
212-
"nginx.ingress.kubernetes.io/ssl-passthrough": "true",
213-
}
214-
else:
215-
raise ValueError("ingress_domain is invalid. Please specify a domain")
216-
217-
metadata["annotations"] = annotations
218-
spec["ingressClassName"] = ingressClassName
219-
spec["rules"][0]["host"] = f"rayclient-{cluster_name}-{namespace}.{ingress_domain}"
66+
def is_kind_cluster():
67+
try:
68+
config_check()
69+
v1 = client.CoreV1Api()
70+
label_selector = "kubernetes.io/hostname=kind-control-plane"
71+
nodes = v1.list_node(label_selector=label_selector)
72+
# If we find one or more nodes with the label, assume it's a KinD cluster
73+
return len(nodes.items) > 0
74+
except Exception as e:
75+
print(f"Error checking if cluster is KinD: {e}")
76+
return False
22077

22178

22279
def update_names(yaml, item, appwrapper_name, cluster_name, namespace):
@@ -433,10 +290,10 @@ def update_ca_secret(ca_secret_item, cluster_name, namespace):
433290
data["ca.key"], data["ca.crt"] = generate_cert.generate_ca_cert(365)
434291

435292

436-
def enable_local_interactive(resources, cluster_name, namespace, ingress_domain):
437-
rayclient_ingress_item = resources["resources"].get("GenericItems")[3]
438-
rayclient_route_item = resources["resources"].get("GenericItems")[4]
439-
ca_secret_item = resources["resources"].get("GenericItems")[5]
293+
def enable_local_interactive(resources, cluster_name, namespace): # pragma: no cover
294+
from ..cluster.cluster import _get_ingress_domain
295+
296+
ca_secret_item = resources["resources"].get("GenericItems")[1]
440297
item = resources["resources"].get("GenericItems")[0]
441298
update_ca_secret(ca_secret_item, cluster_name, namespace)
442299
# update_ca_secret_volumes
@@ -460,40 +317,18 @@ def enable_local_interactive(resources, cluster_name, namespace, ingress_domain)
460317

461318
command = command.replace("deployment-name", cluster_name)
462319

463-
if ingress_domain is None:
464-
raise ValueError(
465-
"ingress_domain is invalid. For creating the client route/ingress please specify an ingress domain"
466-
)
467-
else:
468-
domain = ingress_domain
320+
domain = "" ## FIX - We can't retrieve ingress domain - move init container to CFO
469321

470322
command = command.replace("server-name", domain)
471-
update_rayclient_exposure(
472-
rayclient_route_item,
473-
rayclient_ingress_item,
474-
cluster_name,
475-
namespace,
476-
ingress_domain,
477-
)
478323
item["generictemplate"]["metadata"]["annotations"][
479324
"sdk.codeflare.dev/local_interactive"
480325
] = "True"
481-
item["generictemplate"]["metadata"]["annotations"][
482-
"sdk.codeflare.dev/ingress_domain"
483-
] = ingress_domain
484326

485327
item["generictemplate"]["spec"]["headGroupSpec"]["template"]["spec"][
486328
"initContainers"
487329
][0].get("command")[2] = command
488330

489331

490-
def apply_ingress_domain_annotation(resources, ingress_domain):
491-
item = resources["resources"].get("GenericItems")[0]
492-
item["generictemplate"]["metadata"]["annotations"][
493-
"sdk.codeflare.dev/ingress_domain"
494-
] = ingress_domain
495-
496-
497332
def del_from_list_by_name(l: list, target: typing.List[str]) -> list:
498333
return [x for x in l if x["name"] not in target]
499334

@@ -544,26 +379,6 @@ def disable_raycluster_tls(resources):
544379
resources["GenericItems"] = updated_items
545380

546381

547-
def delete_route_or_ingress(resources):
548-
if is_openshift_cluster():
549-
client_to_remove_name = "rayclient-deployment-ingress"
550-
dashboard_to_remove_name = "ray-dashboard-deployment-ingress"
551-
else:
552-
client_to_remove_name = "rayclient-deployment-route"
553-
dashboard_to_remove_name = "ray-dashboard-deployment-route"
554-
555-
updated_items = []
556-
for i in resources["GenericItems"][:]:
557-
if dashboard_to_remove_name in i["generictemplate"]["metadata"]["name"]:
558-
continue
559-
elif client_to_remove_name in i["generictemplate"]["metadata"]["name"]:
560-
continue
561-
562-
updated_items.append(i)
563-
564-
resources["GenericItems"] = updated_items
565-
566-
567382
def write_user_appwrapper(user_yaml, output_file_name):
568383
# Create the directory if it doesn't exist
569384
directory_path = os.path.dirname(output_file_name)
@@ -602,7 +417,6 @@ def enable_openshift_oauth(user_yaml, cluster_name, namespace):
602417
ray_headgroup_pod = user_yaml["spec"]["resources"]["GenericItems"][0][
603418
"generictemplate"
604419
]["spec"]["headGroupSpec"]["template"]["spec"]
605-
user_yaml["spec"]["resources"]["GenericItems"].pop(1)
606420
ray_headgroup_pod["serviceAccount"] = oauth_sa_name
607421
ray_headgroup_pod["volumes"] = ray_headgroup_pod.get("volumes", [])
608422

@@ -707,18 +521,20 @@ def generate_appwrapper(
707521
image_pull_secrets: list,
708522
dispatch_priority: str,
709523
priority_val: int,
710-
ingress_domain: str,
711-
ingress_options: dict,
712524
write_to_file: bool,
713525
verify_tls: bool,
714526
):
715527
user_yaml = read_template(template)
716528
appwrapper_name, cluster_name = gen_names(name)
717529
resources = user_yaml.get("spec", "resources")
718530
item = resources["resources"].get("GenericItems")[0]
719-
ingress_item = resources["resources"].get("GenericItems")[1]
720-
route_item = resources["resources"].get("GenericItems")[2]
721-
update_names(user_yaml, item, appwrapper_name, cluster_name, namespace)
531+
update_names(
532+
user_yaml,
533+
item,
534+
appwrapper_name,
535+
cluster_name,
536+
namespace,
537+
)
722538
update_labels(user_yaml, instascale, instance_types)
723539
update_priority(user_yaml, item, dispatch_priority, priority_val)
724540
update_custompodresources(
@@ -750,24 +566,12 @@ def generate_appwrapper(
750566
head_memory,
751567
head_gpus,
752568
)
753-
update_dashboard_exposure(
754-
ingress_item,
755-
route_item,
756-
cluster_name,
757-
namespace,
758-
ingress_options,
759-
ingress_domain,
760-
)
761-
if ingress_domain is not None:
762-
apply_ingress_domain_annotation(resources, ingress_domain)
763569

764570
if local_interactive:
765-
enable_local_interactive(resources, cluster_name, namespace, ingress_domain)
571+
enable_local_interactive(resources, cluster_name, namespace)
766572
else:
767573
disable_raycluster_tls(resources["resources"])
768574

769-
delete_route_or_ingress(resources["resources"])
770-
771575
if is_openshift_cluster():
772576
enable_openshift_oauth(user_yaml, cluster_name, namespace)
773577

‎tests/e2e/mnist_raycluster_sdk_test.py

-19
Original file line numberDiff line numberDiff line change
@@ -36,24 +36,6 @@ def test_mnist_ray_cluster_sdk(self):
3636

3737
def run_mnist_raycluster_sdk(self):
3838
ray_image = get_ray_image()
39-
host = os.getenv("CLUSTER_HOSTNAME")
40-
41-
ingress_options = {}
42-
if host is not None:
43-
ingress_options = {
44-
"ingresses": [
45-
{
46-
"ingressName": "ray-dashboard",
47-
"port": 8265,
48-
"pathType": "Prefix",
49-
"path": "/",
50-
"host": host,
51-
"annotations": {
52-
"nginx.ingress.kubernetes.io/proxy-body-size": "100M",
53-
},
54-
},
55-
]
56-
}
5739

5840
cluster = Cluster(
5941
ClusterConfiguration(
@@ -69,7 +51,6 @@ def run_mnist_raycluster_sdk(self):
6951
num_gpus=0,
7052
instascale=False,
7153
image=ray_image,
72-
ingress_options=ingress_options,
7354
write_to_file=True,
7455
)
7556
)

‎tests/e2e/start_ray_cluster.py

-16
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,6 @@
77

88
namespace = sys.argv[1]
99
ray_image = os.getenv("RAY_IMAGE")
10-
host = os.getenv("CLUSTER_HOSTNAME")
11-
12-
ingress_options = {}
13-
if host is not None:
14-
ingress_options = {
15-
"ingresses": [
16-
{
17-
"ingressName": "ray-dashboard",
18-
"port": 8265,
19-
"pathType": "Prefix",
20-
"path": "/",
21-
"host": host,
22-
},
23-
]
24-
}
2510

2611
cluster = Cluster(
2712
ClusterConfiguration(
@@ -37,7 +22,6 @@
3722
num_gpus=0,
3823
instascale=False,
3924
image=ray_image,
40-
ingress_options=ingress_options,
4125
)
4226
)
4327

‎tests/test-case-no-mcad.yamls

-23
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ apiVersion: ray.io/v1
33
kind: RayCluster
44
metadata:
55
annotations:
6-
sdk.codeflare.dev/ingress_domain: apps.cluster.awsroute.org
76
sdk.codeflare.dev/local_interactive: 'False'
87
labels:
98
controller-tools.k8s.io: '1.0'
@@ -197,25 +196,3 @@ spec:
197196
name: odh-trusted-ca-bundle
198197
optional: true
199198
name: odh-ca-cert
200-
---
201-
apiVersion: networking.k8s.io/v1
202-
kind: Ingress
203-
metadata:
204-
labels:
205-
ingress-options: 'false'
206-
ingress-owner: unit-test-cluster-ray
207-
name: ray-dashboard-unit-test-cluster-ray
208-
namespace: ns
209-
spec:
210-
ingressClassName: nginx
211-
rules:
212-
- host: ray-dashboard-unit-test-cluster-ray-ns.apps.cluster.awsroute.org
213-
http:
214-
paths:
215-
- backend:
216-
service:
217-
name: unit-test-cluster-ray-head-svc
218-
port:
219-
number: 8265
220-
path: /
221-
pathType: Prefix

‎tests/test-case-prio.yaml

-24
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ spec:
3333
kind: RayCluster
3434
metadata:
3535
annotations:
36-
sdk.codeflare.dev/ingress_domain: apps.cluster.awsroute.org
3736
sdk.codeflare.dev/local_interactive: 'False'
3837
labels:
3938
controller-tools.k8s.io: '1.0'
@@ -230,27 +229,4 @@ spec:
230229
optional: true
231230
name: odh-ca-cert
232231
replicas: 1
233-
- generictemplate:
234-
apiVersion: networking.k8s.io/v1
235-
kind: Ingress
236-
metadata:
237-
labels:
238-
ingress-options: 'false'
239-
ingress-owner: prio-test-cluster
240-
name: ray-dashboard-prio-test-cluster
241-
namespace: ns
242-
spec:
243-
ingressClassName: nginx
244-
rules:
245-
- host: ray-dashboard-prio-test-cluster-ns.apps.cluster.awsroute.org
246-
http:
247-
paths:
248-
- backend:
249-
service:
250-
name: prio-test-cluster-head-svc
251-
port:
252-
number: 8265
253-
path: /
254-
pathType: Prefix
255-
replicas: 1
256232
Items: []

‎tests/test-case.yaml

-24
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ spec:
3232
kind: RayCluster
3333
metadata:
3434
annotations:
35-
sdk.codeflare.dev/ingress_domain: apps.cluster.awsroute.org
3635
sdk.codeflare.dev/local_interactive: 'False'
3736
labels:
3837
controller-tools.k8s.io: '1.0'
@@ -227,27 +226,4 @@ spec:
227226
optional: true
228227
name: odh-ca-cert
229228
replicas: 1
230-
- generictemplate:
231-
apiVersion: networking.k8s.io/v1
232-
kind: Ingress
233-
metadata:
234-
labels:
235-
ingress-options: 'false'
236-
ingress-owner: unit-test-cluster
237-
name: ray-dashboard-unit-test-cluster
238-
namespace: ns
239-
spec:
240-
ingressClassName: nginx
241-
rules:
242-
- host: ray-dashboard-unit-test-cluster-ns.apps.cluster.awsroute.org
243-
http:
244-
paths:
245-
- backend:
246-
service:
247-
name: unit-test-cluster-head-svc
248-
port:
249-
number: 8265
250-
path: /
251-
pathType: Prefix
252-
replicas: 1
253229
Items: []

‎tests/test-default-appwrapper.yaml

-24
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ spec:
3030
kind: RayCluster
3131
metadata:
3232
annotations:
33-
sdk.codeflare.dev/ingress_domain: apps.cluster.awsroute.org
3433
sdk.codeflare.dev/local_interactive: 'False'
3534
labels:
3635
controller-tools.k8s.io: '1.0'
@@ -205,27 +204,4 @@ spec:
205204
optional: true
206205
name: odh-ca-cert
207206
replicas: 1
208-
- generictemplate:
209-
apiVersion: networking.k8s.io/v1
210-
kind: Ingress
211-
metadata:
212-
labels:
213-
ingress-options: 'false'
214-
ingress-owner: unit-test-default-cluster
215-
name: ray-dashboard-unit-test-default-cluster
216-
namespace: opendatahub
217-
spec:
218-
ingressClassName: nginx
219-
rules:
220-
- host: ray-dashboard-unit-test-default-cluster-opendatahub.apps.cluster.awsroute.org
221-
http:
222-
paths:
223-
- backend:
224-
service:
225-
name: unit-test-default-cluster-head-svc
226-
port:
227-
number: 8265
228-
path: /
229-
pathType: Prefix
230-
replicas: 1
231207
Items: []

‎tests/unit_test.py

+114-150
Large diffs are not rendered by default.

‎tests/unit_test_support.py

-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ def createClusterConfig():
4646
instascale=True,
4747
machine_types=["cpu.small", "gpu.large"],
4848
image_pull_secrets=["unit-test-pull-secret"],
49-
ingress_domain="apps.cluster.awsroute.org",
5049
image="quay.io/project-codeflare/ray:latest-py39-cu118",
5150
write_to_file=True,
5251
)

0 commit comments

Comments
 (0)
Please sign in to comment.