Skip to content

Commit 6eeb49c

Browse files
committed
test certificate changes
1 parent d6a07f3 commit 6eeb49c

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

src/codeflare_sdk/common/utils/generate_cert.py

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,12 +240,27 @@ def export_env(cluster_name, namespace):
240240
241241
Environment Variables Set:
242242
- RAY_USE_TLS: Enables TLS for Ray.
243-
- RAY_TLS_SERVER_CERT: Path to the TLS server certificate.
244-
- RAY_TLS_SERVER_KEY: Path to the TLS server private key.
245243
- RAY_TLS_CA_CERT: Path to the CA certificate.
246244
"""
245+
# Assuming logger is configured elsewhere or add basicConfig here for the module
246+
# import logging
247+
# logger = logging.getLogger(__name__)
248+
# logging.basicConfig(level=logging.INFO) # Or use existing logger if available
249+
247250
tls_dir = os.path.join(os.getcwd(), f"tls-{cluster_name}-{namespace}")
248251
os.environ["RAY_USE_TLS"] = "1"
249-
os.environ["RAY_TLS_SERVER_CERT"] = os.path.join(tls_dir, "tls.crt")
250-
os.environ["RAY_TLS_SERVER_KEY"] = os.path.join(tls_dir, "tls.key")
252+
# os.environ["RAY_TLS_SERVER_CERT"] = os.path.join(tls_dir, "tls.crt") # Client usually doesn't need to present a server cert
253+
# os.environ["RAY_TLS_SERVER_KEY"] = os.path.join(tls_dir, "tls.key") # Client usually doesn't need to present a server key
254+
if "RAY_TLS_SERVER_CERT" in os.environ:
255+
del os.environ["RAY_TLS_SERVER_CERT"]
256+
if "RAY_TLS_SERVER_KEY" in os.environ:
257+
del os.environ["RAY_TLS_SERVER_KEY"]
251258
os.environ["RAY_TLS_CA_CERT"] = os.path.join(tls_dir, "ca.crt")
259+
260+
# It's better to use a logger instance if this module has one,
261+
# otherwise, these prints will go to stdout.
262+
# For now, using print for visibility in test logs if logger isn't set up in this exact scope.
263+
print(f"generate_cert.export_env: RAY_USE_TLS set to: {os.environ.get('RAY_USE_TLS')}")
264+
print(f"generate_cert.export_env: RAY_TLS_CA_CERT set to: {os.environ.get('RAY_TLS_CA_CERT')}")
265+
print(f"generate_cert.export_env: RAY_TLS_SERVER_CERT is: {os.environ.get('RAY_TLS_SERVER_CERT')}")
266+
print(f"generate_cert.export_env: RAY_TLS_SERVER_KEY is: {os.environ.get('RAY_TLS_SERVER_KEY')}")

0 commit comments

Comments
 (0)