[object spilling] Autocreate dir if not exists (#11999)

This commit is contained in:
Eric Liang
2020-11-13 12:13:06 -08:00
committed by GitHub
parent f936ea35fe
commit 00ef1179c0
2 changed files with 2 additions and 8 deletions
+2 -1
View File
@@ -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 = []
-7
View File
@@ -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.")