Crates.io | cuddlyfs |
lib.rs | cuddlyfs |
version | 0.1.2 |
source | src |
created_at | 2024-11-15 09:00:58.665515 |
updated_at | 2024-12-04 13:56:10.627169 |
description | A distributed file system with a cuddly API |
homepage | |
repository | https://github.com/niraj-kumar-r/cuddlyFS |
max_upload_size | |
id | 1448900 |
size | 197,535 |
A distributed file system implemented in Rust.
cuddlyFS is a distributed file system designed to provide high availability, scalability, and performance. It is implemented in Rust and offers a cuddly API for easy integration with your applications.
cuddlyFS consists of several components:
The communication between these components is handled using gRPC, and the protocol definitions can be found in the proto
directory.
Make sure that protoc is installed on your system. If not, you can install it by following the instructions here.
Or run the following command:
# For Ubuntu
sudo apt install protobuf-compiler
# For Fedora
sudo dnf install protobuf
To install cuddlyFS with cargo:
cargo install cuddlyFS
To install cuddlyFS as a library, add it to your Cargo.toml
:
[dependencies]
cuddlyfs = "0.1.2"
or run:
cargo add cuddlyfs
To compile cuddlyFS from source, follow these steps:
Clone the repository:
git clone https://github.com/niraj-kumar-r/cuddlyFS.git
cd cuddlyFS
Build the project using Cargo:
cargo build --release
Set up the configuration files in the config
directory.
For detailed usage instructions, refer to the rust docs
To start the NameNode and DataNodes, use the following commands:
Start the NameNode:
cargo run --bin namenode
Start the DataNodes:
cargo run --bin datanode
Use the client to interact with the file system:
cargo run --bin client
It can also be run inside a docker container. The dockerfile is provided in the repository.
A simple compose file is also provided to start a basic cluster of NameNode and DataNodes.
# Start the cluster
docker-compose up
To get started with cuddlyFS, follow these steps:
Clone the repository and build the project (see the Installation section for instructions).
Make sure Protobuf and Docker Desktop are installed on your system, and Docker Daemon is running.
Spin up a cluster of NameNode and DataNodes using Docker Compose:
docker-compose up
Use the client to interact with the file system:
cargo run --bin cuddly_client report
Create a new file:
cargo run --bin cuddly_client -- put <local_file_path> /<remote_file_path>
List the files in the file system:
cargo run --bin cuddly_client -- ls /
Get the contents of a file:
cargo run --bin cuddly_client -- get /<remote_file_path> <local_file_path>
The configuration files for the NameNode and DataNodes can be found in the config
directory. You can modify these files to customize the behavior of the components.
Do not modify the default configuration files in the config
directory. Instead, create a new configuration file and pass it as a command-line argument when starting the components:
# for dev.yaml file in config directory
EXPORT RUN_MODE=dev
cargo run --bin namenode
To contribute to cuddlyFS, fork the repository and create a new branch for your changes. Make sure to follow the Rust style guide.
After making your changes, run the tests to ensure that everything is working correctly:
cargo test
If the tests pass, submit a pull request with your changes.
Contributions are welcome! Feel free to open an issue or submit a pull request if you have any suggestions, bug reports, or feature requests.
This project is licensed under the Apache License-2.0 - see the LICENSE file for details.