Skip to content

Commit e8d06f4

Browse files
authored
[#6404] feat (gvfs-fuse): Add Readme document of gvfs-fuse (#6405)
### What changes were proposed in this pull request? Add Readme document of gvfs-fuse ### Why are the changes needed? Fix: #6404 ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? No
1 parent baba58c commit e8d06f4

File tree

1 file changed

+125
-0
lines changed

1 file changed

+125
-0
lines changed

clients/filesystem-fuse/README.md

+125
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
<!--
2+
Licensed to the Apache Software Foundation (ASF) under one
3+
or more contributor license agreements. See the NOTICE file
4+
distributed with this work for additional information
5+
regarding copyright ownership. The ASF licenses this file
6+
to you under the Apache License, Version 2.0 (the
7+
"License"); you may not use this file except in compliance
8+
with the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing,
13+
software distributed under the License is distributed on an
14+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
KIND, either express or implied. See the License for the
16+
specific language governing permissions and limitations
17+
under the License.
18+
-->
19+
20+
# Gvfs-fuse
21+
22+
Gvfs-fuse is the Fuse client for Gravitino fileset. It allows users to mount Gravitino filesets to their local file system via Fuse, enabling access to Gravitino fileset files as if they were part of the local file system.
23+
24+
## Features
25+
26+
- Supports mounting S3 filesets
27+
- Supports basic file read and write operations
28+
- Supports directory operations
29+
- Allows file attribute manipulation
30+
31+
32+
## Environment setup and build instructions
33+
34+
### Prerequisites
35+
36+
You need to install the following software before you can build gvfs-fuse:
37+
38+
- [fuse3 and libfuse3-dev](https://www.kernel.org/doc/html/next/filesystems/fuse.html) for Linux systems.
39+
- [macFUSE](https://macfuse.github.io) for macOS systems.
40+
- [Rust](https://www.rust-lang.org) environment for compiling.
41+
42+
### Build process
43+
44+
Navigate to the `client/filesystem-fuse` directory of the Gravitino project and execute the following commands:
45+
46+
```shell
47+
# Code verification
48+
make check
49+
50+
# Code formatting
51+
make fmt
52+
53+
# Building Gvfs-fuse
54+
make
55+
```
56+
57+
After building, the `gvfs-fuse` executable will be located in the `target/debug` directory.
58+
59+
### Testing
60+
61+
Run the following commands to execute tests:
62+
63+
```
64+
# Run tests that do not depend on the S3 or Gravitino environment
65+
make test
66+
67+
# Run tests that depend on the S3 environment
68+
make test-s3
69+
70+
# Run integration tests that depend on the Gravitino fileset environment
71+
make test-fuse-it
72+
```
73+
74+
## Usage Guide
75+
76+
Navigate to the `clients/filesystem-fuse` directory, run the following commands to view
77+
help information or to perform mounting operations:
78+
79+
```shell
80+
# Display help information for gvfs-fuse
81+
target/debug/gvfs-fuse --help
82+
83+
# Display help for the mount command
84+
target/debug/gvfs-fuse mount --help
85+
86+
# Display help for the umount command
87+
target/debug/gvfs-fuse umount --help
88+
89+
#create mount directory
90+
mkdir -p target/gvfs
91+
92+
# Execute the mount command in the foreground
93+
# mount the fileset uri to the local directory target/gvfs. You need to start the gravitino server and create the fileset first
94+
target/debug/gvfs-fuse mount target/gvfs gvfs://fileset/test/c1/s1/fileset1 -c conf/gvfs_fuse.toml -f
95+
96+
# Execute the mount command in the background
97+
# mount the fileset uri to the local directory target/gvfs
98+
target/debug/gvfs-fuse mount target/gvfs gvfs://fileset/test/c1/s1/fileset1 -c conf/gvfs_fuse.toml
99+
100+
# Execute the umount command
101+
# unmount the fileset from the local directory target/gvfs
102+
target/debug/gvfs-fuse umount target/gvfs
103+
```
104+
105+
The `conf/gvfs_fuse.toml` file is a configuration file that contains the following information:
106+
107+
```toml
108+
# fuse settings
109+
[fuse]
110+
file_mask = 0o600
111+
dir_mask = 0o700
112+
fs_type = "memory"
113+
data_path = "target/gvfs-fuse"
114+
115+
[fuse.properties]
116+
117+
# filesystem settings
118+
[filesystem]
119+
block_size = 8192
120+
```
121+
122+
The `gvfs mount` command starts a FUSE program with the given configuration, using a `MemoryFilesystem` for testing.
123+
You can access the filesystem in the `target/gvfs` directory.
124+
125+
More configration file examples can be found in the `tests/conf` directory.

0 commit comments

Comments
 (0)