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.0-cp310-abi3-win_amd64.whl (262.2 kB view details)

Uploaded CPython 3.10+Windows x86-64

nessie_backend_zfs-0.3.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (374.0 kB view details)

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

nessie_backend_zfs-0.3.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (366.4 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

nessie_backend_zfs-0.3.0-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (666.7 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.0-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for nessie_backend_zfs-0.3.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 677e302549de6afc2ccdc33273db5daa0b6dcf1dc624fa8eb799ccb7900e5e13
MD5 c166f407ba1f8987fad495c712d9095f
BLAKE2b-256 351a98b7a169e93f70e4c2e64e61d7b8b1388acd62507f2e320c6c384b5c8a66

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nessie_backend_zfs-0.3.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a1945cb89339739af0e0176286a83a6010956707330a5bdaa1f45a3681bf4236
MD5 ff63efd15800e5117b1d8ffc842ef0d6
BLAKE2b-256 73f403a220759612c04cd920bfa75a66d43dd54da5f98db1a6a57cd18b6a9247

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nessie_backend_zfs-0.3.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 174b0eb06da0f22094382e4a797b82406c4c3550bea680a9cbbdd9feed5db4af
MD5 45b1a7b33724880ca2b423d1585d619e
BLAKE2b-256 e4eaa19e43c9d3088038c3c1aef8b2c30aee34518c48ccfae7981c096f2a6a31

See more details on using hashes here.

File details

Details for the file nessie_backend_zfs-0.3.0-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.0-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 e63bcc9c0ccc6906d4511b9a2972758e2ce1609585e86f0905b0701248b4fc98
MD5 7fd3909c02bc8366cf70b0d1b49c1480
BLAKE2b-256 e447889817f716d2a892455d11c1302f73fe4171d758d205360af65a53455de0

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