Skip to content

Commit 65ceb80

Browse files
committed
RHOAIENG-32532: Fix broken E2E tests
1 parent 80d1307 commit 65ceb80

File tree

14 files changed

+32
-36
lines changed

14 files changed

+32
-36
lines changed

.github/workflows/e2e_tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
- name: Set up specific Python version
5858
uses: actions/setup-python@v5
5959
with:
60-
python-version: '3.11'
60+
python-version: '3.12'
6161
cache: 'pip' # caching pip dependencies
6262

6363
- name: Setup NVidia GPU environment for KinD

.github/workflows/rayjob_e2e_tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: rayjob-e2e-with-kueue
1+
name: rayjob-e2e
22

33
on:
44
pull_request:

src/codeflare_sdk/common/utils/k8s_utils.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,10 @@
77
from ..kubernetes_cluster import config_check, _kube_api_error_handling
88

99

10-
def get_current_namespace():
10+
def get_current_namespace(): # pragma: no cover
1111
"""
1212
Retrieves the current Kubernetes namespace.
1313
14-
This function attempts to detect the current namespace by:
15-
1. First checking if running inside a pod (reading from service account namespace file)
16-
2. Falling back to reading from the current kubeconfig context
17-
1814
Returns:
1915
str:
2016
The current namespace or None if not found.

src/codeflare_sdk/ray/cluster/build_ray_cluster.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ def build_ray_cluster(cluster: "codeflare_sdk.ray.cluster.Cluster"):
136136
"enableIngress": False,
137137
"rayStartParams": {
138138
"dashboard-host": "0.0.0.0",
139-
"dashboard-port": "8265",
140139
"block": "true",
141140
"num-gpus": str(head_gpu_count),
142141
"resources": head_resources,

src/codeflare_sdk/ray/cluster/cluster.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -783,6 +783,12 @@ def remove_autogenerated_fields(resource):
783783
del resource[key]
784784
else:
785785
remove_autogenerated_fields(resource[key])
786+
787+
# After cleaning, remove empty metadata sections
788+
if "metadata" in resource and isinstance(resource["metadata"], dict):
789+
if len(resource["metadata"]) == 0:
790+
del resource["metadata"]
791+
786792
elif isinstance(resource, list):
787793
for item in resource:
788794
remove_autogenerated_fields(item)

src/codeflare_sdk/ray/cluster/test_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2022-2025 IBM, Red Hat
1+
# Copyright 2024 IBM, Red Hat
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

tests/e2e/cluster_apply_kind_test.py

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,13 @@ def test_cluster_apply(self):
3232
num_workers=1,
3333
head_cpu_requests="500m",
3434
head_cpu_limits="1",
35-
head_memory_requests="1Gi",
36-
head_memory_limits="2Gi",
35+
head_memory_requests="5",
36+
head_memory_limits="6",
3737
worker_cpu_requests="500m",
3838
worker_cpu_limits="1",
39-
worker_memory_requests="1Gi",
40-
worker_memory_limits="2Gi",
39+
worker_memory_requests="3",
40+
worker_memory_limits="4",
41+
image="rayproject/ray:2.47.1",
4142
write_to_file=True,
4243
verify_tls=False,
4344
)
@@ -65,12 +66,13 @@ def test_cluster_apply(self):
6566
num_workers=2,
6667
head_cpu_requests="500m",
6768
head_cpu_limits="1",
68-
head_memory_requests="1Gi",
69-
head_memory_limits="2Gi",
69+
head_memory_requests="5",
70+
head_memory_limits="6",
7071
worker_cpu_requests="500m",
7172
worker_cpu_limits="1",
72-
worker_memory_requests="1Gi",
73-
worker_memory_limits="2Gi",
73+
worker_memory_requests="3",
74+
worker_memory_limits="4",
75+
image="rayproject/ray:2.47.1",
7476
write_to_file=True,
7577
verify_tls=False,
7678
)
@@ -111,12 +113,13 @@ def test_apply_invalid_update(self):
111113
num_workers=1,
112114
head_cpu_requests="500m",
113115
head_cpu_limits="1",
114-
head_memory_requests="1Gi",
115-
head_memory_limits="2Gi",
116+
head_memory_requests="5",
117+
head_memory_limits="6",
116118
worker_cpu_requests="500m",
117119
worker_cpu_limits="1",
118-
worker_memory_requests="1Gi",
119-
worker_memory_limits="2Gi",
120+
worker_memory_requests="3",
121+
worker_memory_limits="4",
122+
image="rayproject/ray:2.47.1",
120123
write_to_file=True,
121124
verify_tls=False,
122125
)
@@ -135,14 +138,15 @@ def test_apply_invalid_update(self):
135138
name=cluster_name,
136139
namespace=namespace,
137140
num_workers=2,
138-
head_cpu_requests="1",
139-
head_cpu_limits="2", # Changing CPU limits (immutable)
140-
head_memory_requests="1Gi",
141-
head_memory_limits="2Gi",
141+
head_cpu_requests="500m",
142+
head_cpu_limits="1",
143+
head_memory_requests="5",
144+
head_memory_limits="6",
142145
worker_cpu_requests="500m",
143146
worker_cpu_limits="1",
144-
worker_memory_requests="1Gi",
145-
worker_memory_limits="2Gi",
147+
worker_memory_requests="1",
148+
worker_memory_limits="2",
149+
image="rayproject/ray:2.47.1",
146150
write_to_file=True,
147151
verify_tls=False,
148152
)

tests/e2e/rayjob/ray_version_validation_oauth_test.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@
1111
ManagedClusterConfig,
1212
)
1313

14-
# This test validates Ray version compatibility checking for RayJob with cluster lifecycling scenarios
1514

16-
17-
@pytest.mark.openshift
1815
class TestRayJobRayVersionValidationOauth:
1916
def setup_method(self):
2017
initialize_kubernetes_client(self)

tests/test_cluster_yamls/appwrapper/unit-test-all-params.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ spec:
3939
rayStartParams:
4040
block: 'true'
4141
dashboard-host: 0.0.0.0
42-
dashboard-port: '8265'
4342
num-gpus: '1'
4443
resources: '"{\"TPU\": 2}"'
4544
serviceType: ClusterIP

tests/test_cluster_yamls/kueue/aw_kueue.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ spec:
3333
rayStartParams:
3434
block: 'true'
3535
dashboard-host: 0.0.0.0
36-
dashboard-port: '8265'
3736
num-gpus: '0'
3837
resources: '"{}"'
3938
serviceType: ClusterIP

0 commit comments

Comments
 (0)