Skip to main content

ZFS-backed ONTAP-shaped storage backend for nessie-store — PyO3 bindings.

Project description

nessie-backend-zfs

The ZFS-backed storage backend for nessie-store — the VolumeBackend ⊂ SnapshotBackend ⊂ CloneBackend stack mapped onto zfs/zpool/exportfs. Volumes are datasets, snapshots are zfs snapshot, FlexClones are zfs clone, and the data plane is an NFS export. Every command goes through a CommandRunner seam, so it is exact and testable.

Install

pip install nessie-backend-zfs      # Python
cargo add nessie-backend-zfs        # Rust

Usage (Python)

Two extension points. Outside — drive real ZFS (needs zfs/zpool + privilege):

from nessie_backend_zfs import ZfsBackend

b = ZfsBackend(pool="ontap-sim", data_lif="192.168.1.100")
vol = b.create_volume("build-cache", size_bytes=10 * 2**30)
snap = b.create_snapshot(vol["uuid"], "pre-build")
clone = b.create_clone(vol["uuid"], snap["uuid"], "build-cache-pr1234")
print(b.access_handle(vol["uuid"]))   # {'kind': 'nfs_export', 'server': ..., 'path': ...}

Inside — pass a runner(argv) -> {"success", "stdout", "stderr"} callable and every command is routed through your function. Mock it for tests, audit it, or wrap it in sudo:

from nessie_backend_zfs import ZfsBackend

def runner(argv):
    print("nessie ran:", " ".join(argv))      # audit every command
    return {"success": True, "stdout": "", "stderr": ""}

b = ZfsBackend(pool="tank", runner=runner)
vol = b.create_volume("vol1", size_bytes=1 << 30)   # prints: nessie ran: zfs create -o quota=...

Methods return plain dicts in the substrate-neutral domain shape and raise NessieError on failure.

Usage (Rust)

use nessie_backend_core::{VolumeBackend, VolumeSpec};
use nessie_backend_zfs::{SystemRunner, ZfsBackend, ZfsConfig};

let cfg = ZfsConfig { pool: "ontap-sim".into(), ..ZfsConfig::default() };
let b = ZfsBackend::new(SystemRunner, cfg);
let vol = b.create_volume(VolumeSpec::named("build-cache")).unwrap();

The CommandRunner trait is the same seam the Python runner rides on — swap SystemRunner for a mock to assert the exact argv in unit tests.

Dual-licensed MIT OR Apache-2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

nessie_backend_zfs-0.3.1-cp310-abi3-win_amd64.whl (262.4 kB view details)

Uploaded CPython 3.10+Windows x86-64

nessie_backend_zfs-0.3.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (374.2 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

nessie_backend_zfs-0.3.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (366.6 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

nessie_backend_zfs-0.3.1-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (667.2 kB view details)

Uploaded CPython 3.10+macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

File details

Details for the file nessie_backend_zfs-0.3.1-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for nessie_backend_zfs-0.3.1-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 7c5397a58a9467bc7d61bd5ca1d694632111d1e34a35bc4300496575cac1bffe
MD5 1d3e82155060b6a0d0e6df0eaf28e598
BLAKE2b-256 444531ddf7afddab90bf170b6e50056aef02094a37efe80162c1abefa1db92fd

See more details on using hashes here.

File details

Details for the file nessie_backend_zfs-0.3.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for nessie_backend_zfs-0.3.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 944c5c256065aa51b86e0c3a0d3a7a32060a4df043e437c4d4124f8a1960b6a5
MD5 e33c69e9e82fed70a0add26fce763a77
BLAKE2b-256 16067a99d023fd4c5e6e3858c17a6e49623bdd25db05a80a0c111086585ea6d1

See more details on using hashes here.

File details

Details for the file nessie_backend_zfs-0.3.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for nessie_backend_zfs-0.3.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 79365da5615ba81cff0dc4c50dd300210503064c8a157bdf46c1db0dcf2c9487
MD5 0d3815841d9fc33e0c9d2e798377c6ec
BLAKE2b-256 0a817d6706e3e2d30514d70e4c465fc3c3f62c2d1ba895d60a2ae53bb0d2bc82

See more details on using hashes here.

File details

Details for the file nessie_backend_zfs-0.3.1-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for nessie_backend_zfs-0.3.1-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 839070ca6cc4a56f0fb85ea46139bca29f197426b16aafea3b3e3e2ca09fc943
MD5 c992afec0a54020bc428b6aae1fe9216
BLAKE2b-256 e0e468abcf599eee3ca87ef5a8b1a7dd8f3d95a17b705eb5516362108cc58a23

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page