Skip to content

Commit c509066

Browse files
update rayclient route generation
1 parent 2ef9f67 commit c509066

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

Diff for: src/codeflare_sdk/templates/new-template.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ spec:
161161
- command:
162162
- sh
163163
- -c
164-
- cd /home/ray/workspace/tls && openssl req -nodes -newkey rsa:2048 -keyout server.key -out server.csr -subj '/CN=ray-head' && printf "authorityKeyIdentifier=keyid,issuer\nbasicConstraints=CA:FALSE\nsubjectAltName = @alt_names\n[alt_names]\nDNS.1 = 127.0.0.1\nDNS.2 = localhost\nDNS.3 = ${RAY_IP}\nDNS.4 = $(awk 'END{print $1}' /etc/hosts)\nDNS.5 = rayclient-deployment-name-$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace).apps.$(grep search /etc/resolv.conf|awk '{print $NF}')">./domain.ext && cp /home/ray/workspace/ca/* . && openssl x509 -req -CA ca.crt -CAkey ca.key -in server.csr -out server.crt -days 365 -CAcreateserial -extfile domain.ext
164+
- cd /home/ray/workspace/tls && openssl req -nodes -newkey rsa:2048 -keyout server.key -out server.csr -subj '/CN=ray-head' && printf "authorityKeyIdentifier=keyid,issuer\nbasicConstraints=CA:FALSE\nsubjectAltName = @alt_names\n[alt_names]\nDNS.1 = 127.0.0.1\nDNS.2 = localhost\nDNS.3 = ${RAY_IP}\nDNS.4 = $(awk 'END{print $1}' /etc/hosts)\nDNS.5 = rayclient-deployment-name-$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace).server-name">./domain.ext && cp /home/ray/workspace/ca/* . && openssl x509 -req -CA ca.crt -CAkey ca.key -in server.csr -out server.crt -days 365 -CAcreateserial -extfile domain.ext
165165
image: docker.io/redhat/ubi9
166166
name: create-cert
167167
securityContext:

Diff for: src/codeflare_sdk/utils/generate_yaml.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import sys
2222
import argparse
2323
import uuid
24+
import openshift as oc
2425

2526

2627
def read_template(template):
@@ -235,9 +236,18 @@ def enable_local_interactive(resources, cluster_name, namespace):
235236
command = item["generictemplate"]["spec"]["headGroupSpec"]["template"]["spec"][
236237
"initContainers"
237238
][0].get("command")[2]
239+
240+
command = command.replace("deployment-name", cluster_name)
241+
242+
server_name = (
243+
oc.whoami("--show-server").split(":")[1].split("//")[1].replace("api", "apps")
244+
)
245+
246+
command = command.replace("server-name", server_name)
247+
238248
item["generictemplate"]["spec"]["headGroupSpec"]["template"]["spec"][
239249
"initContainers"
240-
][0]["command"][2] = command.replace("deployment-name", cluster_name)
250+
][0].get("command")[2] = command
241251

242252

243253
def disable_raycluster_tls(resources):

0 commit comments

Comments
 (0)