mirror of
https://github.com/wassname/ray.git
synced 2026-07-05 23:12:30 +08:00
[object spilling] Autocreate dir if not exists (#11999)
This commit is contained in:
@@ -77,9 +77,10 @@ class FileSystemStorage(ExternalStorage):
|
||||
def __init__(self, directory_path):
|
||||
self.directory_path = directory_path
|
||||
self.prefix = "ray_spilled_object_"
|
||||
os.makedirs(self.directory_path, exist_ok=True)
|
||||
if not os.path.exists(self.directory_path):
|
||||
raise ValueError("The given directory path to store objects, "
|
||||
f"{self.directory_path}, doesn't exist.")
|
||||
f"{self.directory_path}, could not be created.")
|
||||
|
||||
def spill_objects(self, object_refs):
|
||||
keys = []
|
||||
|
||||
@@ -107,13 +107,6 @@ def test_invalid_config_raises_exception(shutdown_only):
|
||||
"object_spilling_config": json.dumps(copied_config),
|
||||
})
|
||||
|
||||
with pytest.raises(ValueError):
|
||||
copied_config = copy.deepcopy(file_system_object_spilling_config)
|
||||
copied_config["params"].update({"directory_path": "not_exist_path"})
|
||||
ray.init(_system_config={
|
||||
"object_spilling_config": json.dumps(copied_config),
|
||||
})
|
||||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
platform.system() == "Windows", reason="Failing on Windows.")
|
||||
|
||||
Reference in New Issue
Block a user