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

Uploaded CPython 3.10+Windows x86-64

nessie_backend_zfs-0.2.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (373.9 kB view details)

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

nessie_backend_zfs-0.2.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (366.2 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

nessie_backend_zfs-0.2.1-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.2.1-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for nessie_backend_zfs-0.2.1-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 ea57b3f827c9256f8f826258bc3fb684bb36b10fc0c1bf3f3336dfbd7ed2ce98
MD5 d286c9350362787838504a0e526cf739
BLAKE2b-256 266a888fa2870170c526f7ac54a74fac54aedffc5b9dc84a04eaeeb9b1fcca76

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nessie_backend_zfs-0.2.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fc5d674ca4fba8d8e2c419313f4667af3a76fb8a639043f5d9e056ee8f6b6246
MD5 cdea889ebadaff3cd4fb278facdb97a7
BLAKE2b-256 0883aedb12d6ae6e4538afa04099f933ac8a7875b66b44adb3d213a99e28a99b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nessie_backend_zfs-0.2.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 4a6e90e3fc1fd3924635f5bc81b24d3f6912c8cb04f2c8933227c7bf10bdc1dd
MD5 c1c9cf4d5f878ad6fdbfae36096d4945
BLAKE2b-256 7e8dd1291240bd35cf6a99847ecac3135166c46333ed2adcd1b78e5d2e2d6c4b

See more details on using hashes here.

File details

Details for the file nessie_backend_zfs-0.2.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.2.1-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 11ccef98f563b03fd9843c851a949c905e4c0929b34917514023bbf43b093b64
MD5 786710c547eee154e3409c60be8f8a15
BLAKE2b-256 4ecb78baa747ff92fcb27194280c8181e1f9679f5fbfec79091ced98674b9be2

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