Skip to content

Commit

Permalink
[object spilling] Autocreate dir if not exists (ray-project#11999)
Browse files Browse the repository at this point in the history
  • Loading branch information
ericl authored Nov 13, 2020
1 parent f936ea3 commit 00ef117
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
3 changes: 2 additions & 1 deletion python/ray/external_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down
7 changes: 0 additions & 7 deletions python/ray/tests/test_object_spilling.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand Down

0 comments on commit 00ef117

Please sign in to comment.