Skip to content

Commit

Permalink
CI
Browse files Browse the repository at this point in the history
  • Loading branch information
luweizheng committed Sep 29, 2024
1 parent ecfe522 commit a79e021
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions python/xorbits/_mars/storage/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

logger = logging.getLogger(__name__)


@register_storage_backend
class FileSystemStorage(StorageBackend):
name = "filesystem"
Expand Down Expand Up @@ -162,13 +163,13 @@ class AlluxioStorage(FileSystemStorage):

def __init__(
self,
root_dir: str,
root_dirs: str,
local_environ: bool, # local_environ means standalone mode
level: StorageLevel = None,
size: int = None,
):
self._fs = AioFilesystem(LocalFileSystem())
self._root_dirs = [root_dir]
self._root_dirs = root_dirs
self._level = level
self._size = size
self._local_environ = local_environ
Expand All @@ -187,24 +188,24 @@ async def setup(cls, **kwargs) -> Tuple[Dict, Dict]:
if local_environ:
proc = await asyncio.create_subprocess_shell(
f"""$ALLUXIO_HOME/bin/alluxio fs mkdir /alluxio-storage
$ALLUXIO_HOME/integration/fuse/bin/alluxio-fuse mount {root_dir} /alluxio-storage
$ALLUXIO_HOME/integration/fuse/bin/alluxio-fuse mount {root_dirs} /alluxio-storage
"""
)
await proc.wait()
params = dict(
root_dir=root_dir,
root_dirs=root_dirs,
level=StorageLevel.MEMORY,
size=None,
local_environ=local_environ,
)
return params, dict(root_dir=root_dir)
return params, dict(root_dirs=root_dirs)

@staticmethod
@implements(StorageBackend.teardown)
async def teardown(**kwargs):
root_dirs = kwargs.get("root_dirs")
proc = await asyncio.create_subprocess_shell(
f"""$ALLUXIO_HOME/integration/fuse/bin/alluxio-fuse unmount {root_dir} /alluxio-storage
f"""$ALLUXIO_HOME/integration/fuse/bin/alluxio-fuse unmount {root_dirs[0]} /alluxio-storage
$ALLUXIO_HOME/bin/alluxio fs rm -R /alluxio-storage
"""
)
Expand Down

0 comments on commit a79e021

Please sign in to comment.