mirror of
https://github.com/wassname/ray.git
synced 2026-08-06 13:31:10 +08:00
[tune] Avoid dependency on Kubernetes (#12188)
* fix-kubernetes Signed-off-by: Richard Liaw <rliaw@berkeley.edu> * kub Signed-off-by: Richard Liaw <rliaw@berkeley.edu>
This commit is contained in:
@@ -455,7 +455,6 @@ def detect_sync_to_driver(
|
||||
sync_to_driver: Union[None, bool, Type],
|
||||
cluster_config_file: str = "~/ray_bootstrap_config.yaml"):
|
||||
from ray.tune.integration.docker import DockerSyncer
|
||||
from ray.tune.integration.kubernetes import NamespacedKubernetesSyncer
|
||||
|
||||
if isinstance(sync_to_driver, Type):
|
||||
return sync_to_driver
|
||||
@@ -479,9 +478,19 @@ def detect_sync_to_driver(
|
||||
return DockerSyncer
|
||||
|
||||
if config.get("provider", {}).get("type", "") == "kubernetes":
|
||||
from ray.tune.integration.kubernetes import (
|
||||
NamespacedKubernetesSyncer, try_import_kubernetes)
|
||||
if not try_import_kubernetes():
|
||||
logger.warning(
|
||||
"Detected Ray autoscaling environment on Kubernetes, "
|
||||
"but Kubernetes Python CLI is not installed. "
|
||||
"Checkpoint syncing may not work properly across "
|
||||
"multiple pods. Be sure to install 'kubernetes' on "
|
||||
"each container.")
|
||||
|
||||
namespace = config["provider"].get("namespace", "ray")
|
||||
logger.debug(
|
||||
f"Detected Kubernetes autoscaling environment. Using "
|
||||
f"Detected Ray autoscaling environment on Kubernetes. Using "
|
||||
f"`NamespacedKubernetesSyncer` with namespace `{namespace}` "
|
||||
f"as sync client. If this is not correct or leads to errors, "
|
||||
f"please pass a `sync_to_driver` parameter in the `SyncConfig` "
|
||||
|
||||
Reference in New Issue
Block a user