Skip to content

Commit 9dd120b

Browse files
Altered tests so they pass
1 parent 46822a2 commit 9dd120b

File tree

4 files changed

+218
-1
lines changed

4 files changed

+218
-1
lines changed

tests/test-case-no-mcad.yamls

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,41 @@ spec:
7777
cpu: 2
7878
memory: 8G
7979
nvidia.com/gpu: 0
80+
volumeMounts:
81+
- mountPath: /home/ray/workspace/tls
82+
name: server-cert
83+
readOnly: true
84+
- mountPath: /etc/pki/tls/certs
85+
name: odh-trusted-ca-cert
86+
subPath: odh-trusted-ca-bundle.crt
87+
- mountPath: /etc/ssl/certs
88+
name: odh-trusted-ca-cert
89+
subPath: odh-trusted-ca-bundle.crt
90+
- mountPath: /etc/pki/tls/certs
91+
name: odh-ca-cert
92+
subPath: odh-ca-bundle.crt
93+
- mountPath: /etc/ssl/certs
94+
name: odh-ca-cert
95+
subPath: odh-ca-bundle.crt
8096
imagePullSecrets:
8197
- name: unit-test-pull-secret
98+
volumes:
99+
- emptyDir: {}
100+
name: server-cert
101+
- configMap:
102+
items:
103+
- key: ca-bundle.crt
104+
path: odh-custom-ca-bundle.crt
105+
name: odh-trusted-ca-bundle
106+
optional: true
107+
name: odh-trusted-ca-cert
108+
- configMap:
109+
items:
110+
- key: odh-ca-bundle.crt
111+
path: odh-ca-bundle.crt
112+
name: odh-trusted-ca-bundle
113+
optional: true
114+
name: odh-ca-cert
82115
rayVersion: 2.7.0
83116
workerGroupSpecs:
84117
- groupName: small-group-unit-test-cluster-ray
@@ -136,8 +169,41 @@ spec:
136169
cpu: 3
137170
memory: 5G
138171
nvidia.com/gpu: 7
172+
volumeMounts:
173+
- mountPath: /home/ray/workspace/tls
174+
name: server-cert
175+
readOnly: true
176+
- mountPath: /etc/pki/tls/certs
177+
name: odh-trusted-ca-cert
178+
subPath: odh-trusted-ca-bundle.crt
179+
- mountPath: /etc/ssl/certs
180+
name: odh-trusted-ca-cert
181+
subPath: odh-trusted-ca-bundle.crt
182+
- mountPath: /etc/pki/tls/certs
183+
name: odh-ca-cert
184+
subPath: odh-ca-bundle.crt
185+
- mountPath: /etc/ssl/certs
186+
name: odh-ca-cert
187+
subPath: odh-ca-bundle.crt
139188
imagePullSecrets:
140189
- name: unit-test-pull-secret
190+
volumes:
191+
- emptyDir: {}
192+
name: server-cert
193+
- configMap:
194+
items:
195+
- key: ca-bundle.crt
196+
path: odh-custom-ca-bundle.crt
197+
name: odh-trusted-ca-bundle
198+
optional: true
199+
name: odh-trusted-ca-cert
200+
- configMap:
201+
items:
202+
- key: odh-ca-bundle.crt
203+
path: odh-ca-bundle.crt
204+
name: odh-trusted-ca-bundle
205+
optional: true
206+
name: odh-ca-cert
141207
---
142208
apiVersion: networking.k8s.io/v1
143209
kind: Ingress

tests/test-case-prio.yaml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,42 @@ spec:
107107
cpu: 2
108108
memory: 8G
109109
nvidia.com/gpu: 0
110+
volumeMounts:
111+
- mountPath: /home/ray/workspace/tls
112+
name: server-cert
113+
readOnly: true
114+
- mountPath: /etc/pki/tls/certs
115+
name: odh-trusted-ca-cert
116+
subPath: odh-trusted-ca-bundle.crt
117+
- mountPath: /etc/ssl/certs
118+
name: odh-trusted-ca-cert
119+
subPath: odh-trusted-ca-bundle.crt
120+
- mountPath: /etc/pki/tls/certs
121+
name: odh-ca-cert
122+
subPath: odh-ca-bundle.crt
123+
- mountPath: /etc/ssl/certs
124+
name: odh-ca-cert
125+
subPath: odh-ca-bundle.crt
110126
imagePullSecrets:
111127
- name: unit-test-pull-secret
112128
priorityClassName: default
129+
volumes:
130+
- emptyDir: {}
131+
name: server-cert
132+
- configMap:
133+
items:
134+
- key: ca-bundle.crt
135+
path: odh-custom-ca-bundle.crt
136+
name: odh-trusted-ca-bundle
137+
optional: true
138+
name: odh-trusted-ca-cert
139+
- configMap:
140+
items:
141+
- key: odh-ca-bundle.crt
142+
path: odh-ca-bundle.crt
143+
name: odh-trusted-ca-bundle
144+
optional: true
145+
name: odh-ca-cert
113146
rayVersion: 2.7.0
114147
workerGroupSpecs:
115148
- groupName: small-group-prio-test-cluster
@@ -167,9 +200,42 @@ spec:
167200
cpu: 3
168201
memory: 5G
169202
nvidia.com/gpu: 7
203+
volumeMounts:
204+
- mountPath: /home/ray/workspace/tls
205+
name: server-cert
206+
readOnly: true
207+
- mountPath: /etc/pki/tls/certs
208+
name: odh-trusted-ca-cert
209+
subPath: odh-trusted-ca-bundle.crt
210+
- mountPath: /etc/ssl/certs
211+
name: odh-trusted-ca-cert
212+
subPath: odh-trusted-ca-bundle.crt
213+
- mountPath: /etc/pki/tls/certs
214+
name: odh-ca-cert
215+
subPath: odh-ca-bundle.crt
216+
- mountPath: /etc/ssl/certs
217+
name: odh-ca-cert
218+
subPath: odh-ca-bundle.crt
170219
imagePullSecrets:
171220
- name: unit-test-pull-secret
172221
priorityClassName: default
222+
volumes:
223+
- emptyDir: {}
224+
name: server-cert
225+
- configMap:
226+
items:
227+
- key: ca-bundle.crt
228+
path: odh-custom-ca-bundle.crt
229+
name: odh-trusted-ca-bundle
230+
optional: true
231+
name: odh-trusted-ca-cert
232+
- configMap:
233+
items:
234+
- key: odh-ca-bundle.crt
235+
path: odh-ca-bundle.crt
236+
name: odh-trusted-ca-bundle
237+
optional: true
238+
name: odh-ca-cert
173239
replicas: 1
174240
- generictemplate:
175241
apiVersion: networking.k8s.io/v1

tests/test-case.yaml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,41 @@ spec:
106106
cpu: 2
107107
memory: 8G
108108
nvidia.com/gpu: 0
109+
volumeMounts:
110+
- mountPath: /home/ray/workspace/tls
111+
name: server-cert
112+
readOnly: true
113+
- mountPath: /etc/pki/tls/certs
114+
name: odh-trusted-ca-cert
115+
subPath: odh-trusted-ca-bundle.crt
116+
- mountPath: /etc/ssl/certs
117+
name: odh-trusted-ca-cert
118+
subPath: odh-trusted-ca-bundle.crt
119+
- mountPath: /etc/pki/tls/certs
120+
name: odh-ca-cert
121+
subPath: odh-ca-bundle.crt
122+
- mountPath: /etc/ssl/certs
123+
name: odh-ca-cert
124+
subPath: odh-ca-bundle.crt
109125
imagePullSecrets:
110126
- name: unit-test-pull-secret
127+
volumes:
128+
- emptyDir: {}
129+
name: server-cert
130+
- configMap:
131+
items:
132+
- key: ca-bundle.crt
133+
path: odh-custom-ca-bundle.crt
134+
name: odh-trusted-ca-bundle
135+
optional: true
136+
name: odh-trusted-ca-cert
137+
- configMap:
138+
items:
139+
- key: odh-ca-bundle.crt
140+
path: odh-ca-bundle.crt
141+
name: odh-trusted-ca-bundle
142+
optional: true
143+
name: odh-ca-cert
111144
rayVersion: 2.7.0
112145
workerGroupSpecs:
113146
- groupName: small-group-unit-test-cluster
@@ -165,8 +198,41 @@ spec:
165198
cpu: 3
166199
memory: 5G
167200
nvidia.com/gpu: 7
201+
volumeMounts:
202+
- mountPath: /home/ray/workspace/tls
203+
name: server-cert
204+
readOnly: true
205+
- mountPath: /etc/pki/tls/certs
206+
name: odh-trusted-ca-cert
207+
subPath: odh-trusted-ca-bundle.crt
208+
- mountPath: /etc/ssl/certs
209+
name: odh-trusted-ca-cert
210+
subPath: odh-trusted-ca-bundle.crt
211+
- mountPath: /etc/pki/tls/certs
212+
name: odh-ca-cert
213+
subPath: odh-ca-bundle.crt
214+
- mountPath: /etc/ssl/certs
215+
name: odh-ca-cert
216+
subPath: odh-ca-bundle.crt
168217
imagePullSecrets:
169218
- name: unit-test-pull-secret
219+
volumes:
220+
- emptyDir: {}
221+
name: server-cert
222+
- configMap:
223+
items:
224+
- key: ca-bundle.crt
225+
path: odh-custom-ca-bundle.crt
226+
name: odh-trusted-ca-bundle
227+
optional: true
228+
name: odh-trusted-ca-cert
229+
- configMap:
230+
items:
231+
- key: odh-ca-bundle.crt
232+
path: odh-ca-bundle.crt
233+
name: odh-trusted-ca-bundle
234+
optional: true
235+
name: odh-ca-cert
170236
replicas: 1
171237
- generictemplate:
172238
apiVersion: networking.k8s.io/v1

tests/unit_test.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2709,10 +2709,26 @@ def test_enable_local_interactive(mocker):
27092709
volumes = [
27102710
{
27112711
"name": "ca-vol",
2712-
"secret": {"secretName": f"ca-secret-{cluster_name}"},
2712+
"secret": {"secretName": "ca-secret-test-enable-local"},
27132713
"optional": False,
27142714
},
27152715
{"name": "server-cert", "emptyDir": {}},
2716+
{
2717+
"name": "odh-trusted-ca-cert",
2718+
"configMap": {
2719+
"name": "odh-trusted-ca-bundle",
2720+
"items": [{"key": "ca-bundle.crt", "path": "odh-custom-ca-bundle.crt"}],
2721+
"optional": True,
2722+
},
2723+
},
2724+
{
2725+
"name": "odh-ca-cert",
2726+
"configMap": {
2727+
"name": "odh-trusted-ca-bundle",
2728+
"items": [{"key": "odh-ca-bundle.crt", "path": "odh-ca-bundle.crt"}],
2729+
"optional": True,
2730+
},
2731+
},
27162732
]
27172733
tls_env = [
27182734
{"name": "RAY_USE_TLS", "value": "1"},
@@ -2740,6 +2756,9 @@ def test_enable_local_interactive(mocker):
27402756
head_group_spec["template"]["spec"]["initContainers"][0]["volumeMounts"]
27412757
== volume_mounts
27422758
)
2759+
print(head_group_spec["template"]["spec"]["volumes"])
2760+
print("----------------")
2761+
print(volumes)
27432762
assert head_group_spec["template"]["spec"]["volumes"] == volumes
27442763

27452764
# 2. workerGroupSpec has the initContainers command to generated TLS cert from the mounted CA cert.

0 commit comments

Comments
 (0)