[Core] [runtime env] Print message on driver when installing conda or pip (#16516)

This commit is contained in:
architkulkarni 2021-06-18 14:02:46 -07:00 committed by GitHub
parent e6fa8c0015
commit 3ba1cb851e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,6 +3,7 @@ from ray.job_config import JobConfig
import os
import sys
import logging
import json
logger = logging.getLogger(__name__)
@ -62,11 +63,16 @@ class RayAPIStub:
# If we're calling a client connect specifically and we're not
# currently in client mode, ensure we are.
ray._private.client_mode_hook._explicitly_enable_client_mode()
if namespace is not None:
job_config = job_config or JobConfig()
job_config.set_ray_namespace(namespace)
if job_config is not None:
runtime_env = json.loads(job_config.get_serialized_runtime_env())
if runtime_env.get("pip") or runtime_env.get("conda"):
logger.warning("The 'pip' or 'conda' field was specified in "
"the runtime env, so it may take some time to "
"install the environment before ray.connect() "
"returns.")
try:
self.client_worker = Worker(
conn_str,