Development Guide
This guide describes how to set up the Curvine development environment, project layout, and how to build and run tests, based on the Curvine source repository.
Project Layoutโ
The repository is a Cargo workspace. Main directories and crates:
.
โโโ build/ # Build and test scripts
โ โโโ bin/ # Shell wrappers (curvine-master.sh, curvine-worker.sh, cv, etc.)
โ โโโ build.sh # Main build script (-p package, -u ufs, etc.)
โ โโโ check-env.sh # Dependency check
โ โโโ run-tests.sh # Format, clippy, cargo test with test cluster
โ โโโ tests/ # Benchmark/regression scripts (meta-bench.sh, curvine-bench.sh, fio-test.sh, ...)
โโโ Cargo.toml # Workspace definition
โโโ rust-toolchain.toml # Rust version (e.g. 1.92.0)
โโโ orpc/ # RPC and runtime library (used by server and client)
โโโ curvine-common/ # Shared types, config, protocol, Raft, UFS traits
โโโ curvine-server/ # Master and Worker (single binary: --service master|worker)
โโโ curvine-client/ # Rust client and block I/O
โโโ curvine-cli/ # cv CLI (mount, fs, load, report, node, etc.)
โโโ curvine-fuse/ # FUSE filesystem daemon
โโโ curvine-ufs/ # UFS implementations (OpenDAL-based: S3, HDFS, etc.)
โโโ curvine-libsdk/ # Multi-language SDK (Java, Python, Rust)
โโโ curvine-s3-gateway/ # S3-compatible object gateway
โโโ curvine-web/ # Web UI and management API
โโโ curvine-tests/ # Integration tests and test utilities
โโโ curvine-csi/ # Kubernetes CSI driver (Go)
โโโ curvine-docker/ # Dockerfiles (compile, deploy, fluid)
โโโ etc/ # Sample config (curvine-cluster.toml, curvine-env.sh)
Crate roles (from workspace members):
| Crate | Role |
|---|---|
| orpc | Async RPC, runtime, logging, network; used by server and client. |
| curvine-common | Config (ClusterConf, MasterConf, WorkerConf, etc.), protos, Raft storage, shared state types. |
| curvine-server | Master (metadata, journal, WorkerManager) and Worker (block store, read/write handlers); one binary, --service master or --service worker. |
| curvine-client | Client API, block reader/writer, unified filesystem (UFS + Curvine path resolution). |
| curvine-cli | cv command: mount, umount, fs, load, load-status, report, node, version. |
| curvine-fuse | FUSE daemon; translates POSIX calls into Curvine RPC. |
| curvine-ufs | UFS backends (OpenDAL operators for S3, HDFS, WebHDFS, etc.). |
| curvine-libsdk | Java (Hadoop), Python, Rust SDK bindings. |
| curvine-s3-gateway | S3-compatible HTTP API (Axum). |
| curvine-web | Web UI and HTTP API for cluster management. |
| curvine-tests | Integration tests; test_cluster example for local cluster. |
Development Setupโ
Prerequisitesโ
Align with the repositoryโs CONTRIBUTING.md and rust-toolchain.toml:
- Rust: Version specified in
rust-toolchain.toml(e.g. 1.92.0); components:rustfmt,clippy,rust-analyzer. - Protobuf: 3.x (e.g. 27.2) for proto compilation.
- LLVM: Required by some dependencies (e.g. bindgen).
- FUSE: libfuse2 or libfuse3 dev packages for building
curvine-fuse. - Java / Maven: For Java SDK and meta-bench (e.g. JDK 1.8+, Maven 3.8+).
- Node.js / npm: For Web UI (e.g. npm 9+).
- Python: 3.7+ for scripts and Python SDK.
Detailed install steps per OS are in the doc Environment Initialization.
Clone and check environmentโ
git clone https://github.com/CurvineIO/curvine.git
cd curvine
Check that required tools are available:
make check-env
# or: build/check-env.sh
Buildโ
-
Full build (release)
Output is underbuild/dist/(binaries inlib/, scripts inbin/, config inconf/):make all
# or: make build
# internally runs: build/build.sh -
Partial build
Usebuild/build.shoptions viamake build ARGS='...':make build ARGS='-p core' # server, client, cli
make build ARGS='-p core -p fuse' # + FUSE
make build ARGS='-p object' # S3 gateway
make build ARGS='-d' # debug build
make build-hdfs # with HDFS support
make build ARGS='--skip-java-sdk' # skip Java SDK -
Format and lint
make format # cargo fmt + pre-commit hooks
make cargo ARGS='clippy --release --all-targets -- --deny warnings'
See Download and Compile Curvine for more build options and Docker-based builds.
Testโ
-
Rust unit tests
No cluster needed:cargo test --release
# or: make cargo ARGS='test --release' -
Integration tests (with test cluster)
run-tests.shchecks format, optionally clippy, starts a test cluster (cargo run --release --example test_cluster), then runscargo test --release:build/run-tests.sh # fmt + cargo test (with test cluster)
build/run-tests.sh --clippy # also run clippy (default: deny warnings)
build/run-tests.sh --level warn # clippy with warn level -
Run a local cluster manually
Frombuild/dist/(aftermake all):export CURVINE_MASTER_HOSTNAME=localhost
bin/curvine-master.sh start
bin/curvine-worker.sh start
# optional: bin/curvine-fuse.sh startOr use the workspace helper (if available):
bin/local-cluster.sh
Code style and contributionโ
- Rust:
cargo fmt;cargo clippywith project policy (e.g. deny warnings in CI). - Commits: Prefer conventional commits (
feat:,fix:,docs:, etc.); see CONTRIBUTING.md and anyCOMMIT_CONVENTION.mdin the repo. - PRs: Branch from
main; include tests and doc updates; ensure CI passes.
For contribution workflow, labels, and community links, see the repositoryโs CONTRIBUTING.md.