Skip to content

Commit

Permalink
Add enableIngress and set to false by default
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianZaccaria authored and openshift-merge-bot[bot] committed Apr 16, 2024
1 parent 979ff43 commit 6557465
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/codeflare_sdk/cluster/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,20 @@ def _component_resources_up(
if self.config.write_to_file:
with open(self.app_wrapper_yaml) as f:
yamls = yaml.load_all(f, Loader=yaml.FullLoader)
for resource in yamls:
enable_ingress = (
resource.get("spec", {})
.get("headGroupSpec", {})
.get("enableIngress")
)
if resource["kind"] == "RayCluster" and enable_ingress is not False:
name = resource["metadata"]["name"]
print(
f"Forbidden: RayCluster '{name}' has 'enableIngress' set to 'True' or is unset."
)
return
f.seek(0) # Reset file pointer to the beginning
yamls = yaml.load_all(f, Loader=yaml.FullLoader) # Reload the YAMLs
_create_resources(yamls, namespace, api_instance)
else:
yamls = yaml.load_all(self.app_wrapper_yaml, Loader=yaml.FullLoader)
Expand Down
1 change: 1 addition & 0 deletions src/codeflare_sdk/templates/base-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ spec:
headGroupSpec:
# Kubernetes Service Type, valid values are 'ClusterIP', 'NodePort' and 'LoadBalancer'
serviceType: ClusterIP
enableIngress: false
# logical group name, for this called head-group, also can be functional
# pod type head or worker
# rayNodeType: head # Not needed since it is under the headgroup
Expand Down
1 change: 1 addition & 0 deletions tests/test-case-no-mcad.yamls
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ spec:
upscalingMode: Default
enableInTreeAutoscaling: false
headGroupSpec:
enableIngress: false
rayStartParams:
block: 'true'
dashboard-host: 0.0.0.0
Expand Down
1 change: 1 addition & 0 deletions tests/test-case-prio.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ spec:
upscalingMode: Default
enableInTreeAutoscaling: false
headGroupSpec:
enableIngress: false
rayStartParams:
block: 'true'
dashboard-host: 0.0.0.0
Expand Down
1 change: 1 addition & 0 deletions tests/test-case.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ spec:
upscalingMode: Default
enableInTreeAutoscaling: false
headGroupSpec:
enableIngress: false
rayStartParams:
block: 'true'
dashboard-host: 0.0.0.0
Expand Down
1 change: 1 addition & 0 deletions tests/test-default-appwrapper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ spec:
upscalingMode: Default
enableInTreeAutoscaling: false
headGroupSpec:
enableIngress: false
rayStartParams:
block: 'true'
dashboard-host: 0.0.0.0
Expand Down

0 comments on commit 6557465

Please sign in to comment.