Skip to content

Commit 032b74f

Browse files
Updated ingress_domain annotation
1 parent 46e9f7d commit 032b74f

File tree

6 files changed

+15
-0
lines changed

6 files changed

+15
-0
lines changed

src/codeflare_sdk/utils/generate_yaml.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,13 @@ def enable_local_interactive(resources, cluster_name, namespace, ingress_domain)
473473
][0].get("command")[2] = command
474474

475475

476+
def apply_ingress_domain_annotation(resources, ingress_domain):
477+
item = resources["resources"].get("GenericItems")[0]
478+
item["generictemplate"]["metadata"]["annotations"][
479+
"sdk.codeflare.dev/ingress_domain"
480+
] = ingress_domain
481+
482+
476483
def del_from_list_by_name(l: list, target: typing.List[str]) -> list:
477484
return [x for x in l if x["name"] not in target]
478485

@@ -740,6 +747,9 @@ def generate_appwrapper(
740747
ingress_options,
741748
ingress_domain,
742749
)
750+
if ingress_domain is not None:
751+
apply_ingress_domain_annotation(resources, ingress_domain)
752+
743753
if local_interactive:
744754
enable_local_interactive(resources, cluster_name, namespace, ingress_domain)
745755
else:

tests/test-case-no-mcad.yamls

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ apiVersion: ray.io/v1
33
kind: RayCluster
44
metadata:
55
annotations:
6+
sdk.codeflare.dev/ingress_domain: apps.cluster.awsroute.org
67
sdk.codeflare.dev/local_interactive: 'false'
78
labels:
89
controller-tools.k8s.io: '1.0'

tests/test-case-prio.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ spec:
3333
kind: RayCluster
3434
metadata:
3535
annotations:
36+
sdk.codeflare.dev/ingress_domain: apps.cluster.awsroute.org
3637
sdk.codeflare.dev/local_interactive: 'false'
3738
labels:
3839
controller-tools.k8s.io: '1.0'

tests/test-case.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ spec:
3232
kind: RayCluster
3333
metadata:
3434
annotations:
35+
sdk.codeflare.dev/ingress_domain: apps.cluster.awsroute.org
3536
sdk.codeflare.dev/local_interactive: 'false'
3637
labels:
3738
controller-tools.k8s.io: '1.0'

tests/test-default-appwrapper.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ spec:
3030
kind: RayCluster
3131
metadata:
3232
annotations:
33+
sdk.codeflare.dev/ingress_domain: apps.cluster.awsroute.org
3334
sdk.codeflare.dev/local_interactive: 'false'
3435
labels:
3536
controller-tools.k8s.io: '1.0'

tests/unit_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3434,6 +3434,7 @@ def test_cleanup():
34343434
os.remove(f"{aw_dir}prio-test-cluster.yaml")
34353435
os.remove(f"{aw_dir}test.yaml")
34363436
os.remove(f"{aw_dir}raytest2.yaml")
3437+
os.remove(f"{aw_dir}unit-test-cluster-ray.yaml")
34373438
os.remove("tls-cluster-namespace/ca.crt")
34383439
os.remove("tls-cluster-namespace/tls.crt")
34393440
os.remove("tls-cluster-namespace/tls.key")

0 commit comments

Comments
 (0)