adr-workspace-restructuring #33

Merged
rawdaGastan merged 14 commits from adr-workspace-restructuring into development 2026-04-07 11:36:33 +00:00
Owner

For Rawda to verify

Split my_fs into a Cargo workspace

Issues

  • #34


    Problem

    my_fs is a single monolithic crate containing everything — FUSE filesystem, HTTP flist hub server, CLI tools, storage backends, metadata layer, container
    conversion, and scripting — all behind feature flags in one src/ directory.

    This causes:

    1. Binary bloat — deploying the FUSE mounter pulls in the entire HTTP server stack and vice versa. Every binary ships all dependencies.
    2. Slow builds — any change to server code triggers a full rebuild of FUSE code, container logic, and everything else.
    3. Unclear boundaries — it's not obvious which code belongs to which concern. New contributors can't tell where server ends and filesystem begins.
    4. Feature flag sprawl — build-binary gates too much. The conditional compilation is fragile and hard to reason about.

    Proposal

    Split into a Cargo workspace with clear layered crates:

    • myfs-core — foundation library: metadata (fungi/SQLite), store backends (S3, ZDB, HTTP, dir), cache, config, error types. No binary.
    • myfs-lib — operations library + myfs binary: FUSE mount, pack/unpack, clone, container conversion, rhai scripting.
    • myfs-hub — myfs-hub binary: flist hosting server (HTTP, auth, DB). Only depends on myfs-core.
    • myfstool — myfstool binary: CLI for clone, merge, sync, container ops, rhai script execution. Absorbs the standalone rhai_runner binary.
    • myfs-test-utils — shared test helpers (dev-dependency only).

    Expected outcome

    • Three focused binaries instead of one bloated one
    • Incremental builds only recompile what changed
    • Clear code ownership per crate
    • No feature flags needed — crate boundaries replace them
    • Same functionality, zero regressions — pure restructuring

    Acceptance criteria

    • cargo build --workspace produces 3 binaries
    • cargo test --workspace passes
    • No duplicated types or functions across crates
    • CI updated for workspace build
    • mos_builder and my_init configs updated if binary names change
For Rawda to verify Split my_fs into a Cargo workspace ### Issues - https://forge.ourworld.tf/geomind_code/my_fs/issues/34 --- Problem my_fs is a single monolithic crate containing everything — FUSE filesystem, HTTP flist hub server, CLI tools, storage backends, metadata layer, container conversion, and scripting — all behind feature flags in one src/ directory. This causes: 1. Binary bloat — deploying the FUSE mounter pulls in the entire HTTP server stack and vice versa. Every binary ships all dependencies. 2. Slow builds — any change to server code triggers a full rebuild of FUSE code, container logic, and everything else. 3. Unclear boundaries — it's not obvious which code belongs to which concern. New contributors can't tell where server ends and filesystem begins. 4. Feature flag sprawl — build-binary gates too much. The conditional compilation is fragile and hard to reason about. Proposal Split into a Cargo workspace with clear layered crates: - myfs-core — foundation library: metadata (fungi/SQLite), store backends (S3, ZDB, HTTP, dir), cache, config, error types. No binary. - myfs-lib — operations library + myfs binary: FUSE mount, pack/unpack, clone, container conversion, rhai scripting. - myfs-hub — myfs-hub binary: flist hosting server (HTTP, auth, DB). Only depends on myfs-core. - myfstool — myfstool binary: CLI for clone, merge, sync, container ops, rhai script execution. Absorbs the standalone rhai_runner binary. - myfs-test-utils — shared test helpers (dev-dependency only). Expected outcome - Three focused binaries instead of one bloated one - Incremental builds only recompile what changed - Clear code ownership per crate - No feature flags needed — crate boundaries replace them - Same functionality, zero regressions — pure restructuring Acceptance criteria - cargo build --workspace produces 3 binaries - cargo test --workspace passes - No duplicated types or functions across crates - CI updated for workspace build - mos_builder and my_init configs updated if binary names change
Replace ADR-002 with a clean workspace split design:
- myfs-core: foundation (store, fungi, cache, error)
- myfs-lib: all reusable operations (pack, unpack, container, clone, merge, sync, rhai, FUSE)
- myfs-hub: flist hosting service (REST API, block storage, website hosting)
- myfstool: thin CLI wrapper with run subcommand (absorbs rhai_runner)
- myfs-test-utils: shared test helpers

Add ADR-006 (future OpenRPC daemon) and ADR-007 (future youki container libs).
Add exhaustive implementation plan at docs/plans/005-workspace-split.md.
implement ADR-005 workspace split: myfs-core/myfs-lib/myfs-hub/myfstool
Some checks failed
Build and Test / build (push) Failing after 3m1s
a8acac21ee
Split monolithic myfs crate into 5 workspace members:

- myfs-core: foundation library (store, fungi, cache, error, config)
- myfs-lib: operations library (pack/unpack/upload/download/container/FUSE)
  with `myfs` binary for file operations
- myfs-hub: flist hosting server with `myfs-hub` binary
  (serve/token/track/sync/website-publish)
- myfstool: CLI tools with `myfstool` binary
  (clone/merge/container/sync/run)
- myfs-test-utils: shared test helpers

Key changes:
- get_default_parallel() and is_mountpoint() now in myfs-core
- is_mountpoint uses MetadataExt::dev() instead of shell mountpoint command
- rhai_runner binary absorbed into myfstool `run` subcommand
- register_myfs_module() moved from rhai_runner to myfs-lib::rhai_bindings
- build-binary feature removed (FUSE always available in myfs-lib)
- Version bumped to 0.3.0, edition upgraded to 2021
implement ADR-003: FUSE error handling with proper errno mapping
Some checks failed
Build and Test / build (push) Failing after 2m27s
437d5857e6
Replace catch-all reply_error(ENOENT) with error-specific errno codes
using the unified error type's to_errno() method. Transient errors
(network timeouts, store unavailability) now return EAGAIN instead of
ENOENT, enabling application-level retries.

Also marks ADR-001 and ADR-003 as Accepted.
mark ADR-005 as Accepted
Some checks failed
Build and Test / build (push) Failing after 3m3s
1ae60833dc
cargo fmt --all
All checks were successful
Build and Test / build (push) Successful in 4m54s
1c1ee8aec9
update CI workflows for workspace build (3 binaries)
All checks were successful
Build and Test / build (push) Successful in 4m54s
99b6a09c7d
- buildenv.sh: BINARIES="myfs myfs-hub myfstool", remove build-binary feature
- build_lib.sh: build() uses --workspace, tolerates empty ALL_FEATURES
- release.yaml: upload all 3 binaries as release assets
update all docs for workspace split (3 binaries)
Some checks failed
Build and Test / build (push) Has been cancelled
f2acdd216e
Update command references across 24 documentation files:
- myfs server → myfs-hub serve
- myfs token → myfs-hub token
- myfs container/docker → myfstool container
- myfs clone/merge/sync → myfstool clone/merge/sync
- rhai_runner → myfstool run
- cargo build --features build-binary → cargo build --workspace
- test locations updated to per-crate dirs
ADR-008: remove openssl dependency in favour of rustls
Some checks failed
Build and Test / build (push) Has been cancelled
bdf53812f9
plan for ADR-008: step-by-step openssl removal (rust-s3 upgrade, reqwest rustls, CI)
All checks were successful
Build and Test / build (push) Successful in 4m54s
743ed2e8e0
ADR-008: remove openssl, switch to rustls-only TLS
All checks were successful
Build and Test / build (push) Successful in 5m7s
981edecc06
- Upgrade rust-s3 from 0.34 to 0.37 with tokio-rustls-tls feature
- Switch reqwest to rustls-tls (disable default native-tls)
- Remove openssl vendored dependency from workspace and myfs-core
- Fix Bucket::new Box<Bucket> return type change in rust-s3 0.37

openssl, openssl-sys, and native-tls are now fully absent from the
dependency tree. rustls is the sole TLS stack (already present via sqlx).
rename: myfstool → myfs-tool for consistent naming
Some checks failed
Build and Test / build (push) Failing after 1m52s
b5a19954d3
All workspace crates now follow the myfs-* naming convention:
myfs-core, myfs-lib, myfs-hub, myfs-tool, myfs-test-utils.
Binary renamed from myfstool to myfs-tool.
docs: mark ADR 001, 003, 005, 008 as Implemented
Some checks failed
Build and Test / build (push) Failing after 2m20s
5f19780866
fix: resolve client/server deserialization bugs, rename myfstool → myfs-tool, fix e2e tests
All checks were successful
Build and Test / build (push) Successful in 4m11s
939ef23c5e
add more tests
All checks were successful
Build and Test / build (push) Successful in 5m10s
3ae58f51a8
rawdaGastan scheduled this pull request to auto merge when all checks succeed 2026-04-07 11:36:16 +00:00
rawdaGastan merged commit acd4728121 into development 2026-04-07 11:36:33 +00:00
rawdaGastan deleted branch adr-workspace-restructuring 2026-04-07 11:37:38 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
geomind_code/my_fs!33
No description provided.