FUSE is the abbreviation for "FileSystem in Userspace".It's an interface for userspace programs to export a filesystem to the linux kernel.
The FUSE project consists of two components: the fuse kernel module (maintained in the regular kernel repositories) and the libfuse userspace library (maintained in this repository).

When VFS receives a file access request from the user process and this file belongs to a certain fuse file system, it will forward the request to a kernel module named "fuse". Then, "fuse" converts the request into the protocol format agreed upon with the daemon and transmits it to the daemon process.
Currently, there have been many successful fuse based projects,
- s3fs
makes you operate files and directories in S3 bucket like a local file system
- sshfs
allows you to mount a remote filesystem using SFTP
- google-drive-ocamlfuse lets you mount your Google Drive on Linux.
Because the code organization requirements are different from the existing popular distributed version management software Git, clients targeting Monorepo need to implement various additional features to support code pull tasks for large repositories. These requirements include:
-
Partial clone: reduces the time required to obtain a working repository by not immediately downloading all Git objects.
-
Background prefetch: Download Git object data from all remote sources every hour, reducing the time required for front-end Git fetch calls.
-
Sparse checkout: Restrict the size of the working directory.
-
File system monitor: tracks recently modified files, eliminating the need for Git to scan the entire work tree.
-
Submit graph: Accelerate submission traversal and reachability calculations, and speed up commands such as git log.
-
Multi pack index: Implement fast object lookup in many package files.
-
Incremental repackage: Using multiple package indexes, repackage packaged Git data into fewer package files without interrupting parallel commands.
VFS for Git from Microsoft
VFS For Git is a preliminary attempt by Microsoft on the Monorepo client, which implemented the FUSE system based on Sqlite and Mutli pack index, achieving on-demand partial pull functionality. The client will perceive the user's "open directory" operation before pulling the code content under the corresponding directory.
Sapling from Meta
The structure of Sapling is achieved through a multi-layered architecture, with each checkout corresponding to a mount point, followed by an Overlay layer. At the same time, it provides third-party interfaces for other programs to use, so that some heavy IO and computational parts do not need to be consumed by the performance of the virtual layer.
Scorpio is a Rust project, and the crate is named scorpiofs.
https://crates.io/crates/scorpiofs
- run the mono server in
localhost:8000. - config the
mount_pathandstore_pathin theconfig.toml cargo runin thescorpiodictionary.
Command line arguments for the application
Usage: scorpio [OPTIONS]
Options:
-c, --config-path <CONFIG_PATH> Path to the configuration file [default: scorpio.toml]The following interfaces are currently available:
curl -X POST http://localhost:2725/api/fs/mount -H "Content-Type: application/json" -d '{"path": "third-party/mega/scorpio"}'
curl -X GET http://localhost:2725/api/fs/mpoint
curl -X POST http://localhost:2725/api/fs/unmount -H "Content-Type: application/json" -d '{"path": "third-party/mega/scorpio"}'
curl -X POST http://localhost:2725/api/fs/mount -H "Content-Type: application/json" -d '{"path": "third-party/mega/ts"}'There is a example of scorpio.toml in the scorpio dictionary.
base_url = "http://localhost:8000"
lfs_url = "http://localhost:8000"
store_path = "/home/luxian/megadir/store"
workspace = "/home/luxian/megadir/mount"
config_file = "config.toml"
git_author = "MEGA"
git_email = "admin@mega.org"
dicfuse_readable = "true"
load_dir_depth = "3"
fetch_file_thread = "10"-
base_url
Base URL for service APIs (e.g.,http://localhost:8000for local development). -
lfs_url
Dedicated URL for Large File Storage (LFS), typically matchingbase_url. -
store_path
Physical path for storing files (ensure write permissions). -
workspace
User-visible workspace mount path (i.e., the FUSE filesystem mount point) -
config_file
Extended configuration filename (default:config.toml). -
git_author/git_email
Default Git author metadata (for version tracking). -
dicfuse_readable
Allow reading file contents from a read-only directory. -
load_dir_depth
Specifies how deep the file system should load and preload directories during initialization. -
fetch_file_thread
Sets the number of threads used for downloading files concurrently.
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Submit a pull request with a clear description of your changes.
[1] Rachel Potvin and Josh Levenberg. 2016. Why Google stores billions of lines of code in a single repository. Commun. ACM 59, 7 (July 2016), 78–87. https://doi.org/10.1145/2854146 [2] Nicolas Brousse. 2019. The issue of monorepo and polyrepo in large enterprises. In Companion Proceedings of the 3rd International Conference on the Art, Science, and Engineering of Programming (Programming '19). Association for Computing Machinery, New York, NY, USA, Article 2, 1–4. https://doi.org/10.1145/3328433.3328435 [3] libfuse is the reference implementation of the Linux FUSE (Filesystem in Userspace) interface. [4] CS135 FUSE Documentation (hmc.edu) [5] sapling : A cross-platform, highly scalable, Git-compatible source control system. [6] fuser : A Rust library crate for easy implementation of FUSE filesystems in userspace. [7] Scalar : Scalar is a tool that helps Git scale to some of the largest Git repositories. Initially, it was a single standalone git plugin based on Vfs for git, inheriting GVFS. No longer using FUSE. It implements aware partial directory management. Users need to manage and register the required workspace directory on their own. Ease of use can be improved through the fuse mechanism.
-
Performance Optimization
- Enhance performance by leveraging
mmapandeBPF.
- Enhance performance by leveraging
-
Encryption Experimentation
- Explore
rencfsfor file encryption capabilities.
- Explore
-
File Layer Management
- Support file layer management for
Docker Build.
- Support file layer management for
- Support More basic Git operations:
git loggit statusgit add- Support
.gitignorefunctionality.
Integrate Git Large File Storage (LFS) for managing large files.
after mount:
- read the .libra_attribute in monorepo , store the patterns in the store path ..
- get all maybe lfs point(blob);
- if the file is lfs point, then download it.
before git push:
- read the
.libra_attributein the store path .. - get all change lfs point(blob);
- push changed blob to the lfs server;
- get the lfs point(blob) from the lfs server;
- build the commit with the lfs point(blob);
-
Local Directory Storage Recovery
- Implement recovery functionality for local directory storage.
-
Directory Change Monitoring
- Monitor and address inconsistencies between local and remote storage directories.
