Allow --lru-evict to be passed into ray start (#8959)

This commit is contained in:
Ian Rodney
2020-07-13 14:09:39 -07:00
committed by GitHub
parent 4454d05bcf
commit 0085cf75d0
4 changed files with 32 additions and 14 deletions
+16 -1
View File
@@ -89,6 +89,7 @@ class RayParams:
load_code_from_local: Whether load code from local file or from GCS.
_internal_config (str): JSON configuration for overriding
RayConfig defaults. For testing purposes ONLY.
lru_evict (bool): Enable LRU eviction if space is needed.
"""
def __init__(self,
@@ -130,7 +131,8 @@ class RayParams:
include_java=False,
java_worker_options=None,
load_code_from_local=False,
_internal_config=None):
_internal_config=None,
lru_evict=False):
self.object_ref_seed = object_ref_seed
self.redis_address = redis_address
self.num_cpus = num_cpus
@@ -168,8 +170,21 @@ class RayParams:
self.java_worker_options = java_worker_options
self.load_code_from_local = load_code_from_local
self._internal_config = _internal_config
self._lru_evict = lru_evict
self._check_usage()
# Set the internal config options for LRU eviction.
if lru_evict:
# Turn off object pinning.
if self._internal_config is None:
self._internal_config = dict()
if self._internal_config.get("object_pinning_enabled", False):
raise Exception(
"Object pinning cannot be enabled if using LRU eviction.")
self._internal_config["object_pinning_enabled"] = False
self._internal_config["object_store_full_max_retries"] = -1
self._internal_config["free_objects_period_milliseconds"] = 1000
def update(self, **kwargs):
"""Update the settings according to the keyword arguments.