Skip to main content

This library provides a simple Python interface for implementing erasure codes. To obtain the best possible performance, the underlying erasure code algorithms are written in C.

Project description

This library provides a simple Python interface for implementing erasure codes and is known to work with Python 3.10 through 3.13. To obtain the best possible performance, the library utilizes liberasurecode, which is a C based erasure code library.

PyECLib supports a variety of Erasure Coding backends including the standard Reed-Solomon implementations provided by Jerasure [1], liberasurecode [3], Intel’s ISA-L [4] and Phazr.IO’s libphazr. It also provides support for a flat XOR-based encoder and decoder (part of liberasurecode) - a class of HD Combination Codes based on “Flat XOR-based erasure codes in storage systems: Constructions, efficient recovery, and tradeoffs” in IEEE MSST 2010[2]). These codes are well-suited to archival use-cases, have a simple construction and require a minimum number of participating disks during single-disk reconstruction (think XOR-based LRC code).


Installation

Install pre-requisites:

  • Python 3.10+ (including development packages), argparse, setuptools

  • liberasurecode v1.4.0 or greater [3]

  • Erasure code backend libraries, gf-complete and Jerasure [1], ISA-L [4], etc.

Install dependencies:

Debian/Ubuntu hosts:

$ sudo apt-get install build-essential python-dev python-pip liberasurecode-dev
$ sudo pip install -U bindep -r test-requirements.txt

RHEL/CentOS hosts:

$ sudo yum install -y redhat-lsb python2-pip python-devel liberasurecode-devel
$ sudo pip install -U bindep -r test-requirements.txt
$ tools/test-setup.sh

If you want to confirm all dependency packages installed successfully, try:

$ sudo bindep -f bindep.txt

For CentOS, make sure to install the latest Openstack Cloud SIG repo to be able to install the latest available version of liberasurecode-devel.

Install PyECLib:

$ sudo python setup.py install

Run test suite included:

$ ./.unittests

If the test suite fails because it cannot find any of the shared libraries, then you probably need to add /usr/local/lib to the path searched when loading libraries. The best way to do this (on Linux) is to add ‘/usr/local/lib’ to:

/etc/ld.so.conf

and then make sure to run:

$ sudo ldconfig

Getting started

Examples of using PyECLib are provided in the “tools” directory:

Command-line encoder:

tools/pyeclib_encode.py

Command-line decoder:

tools/pyeclib_decode.py

Utility to determine what is needed to reconstruct missing fragments:

tools/pyeclib_fragments_needed.py

A configuration utility to help compare available EC schemes in terms of performance and redundancy:

tools/pyeclib_conf_tool.py

PyEClib initialization:

ec_driver = ECDriver(k=<num_encoded_data_fragments>,
                     m=<num_encoded_parity_fragments>,
                     ec_type=<ec_scheme>))

Supported ec_type values:

  • liberasurecode_rs_vand => Vandermonde Reed-Solomon encoding, software-only backend implemented by liberasurecode [3]

  • jerasure_rs_vand => Vandermonde Reed-Solomon encoding, based on Jerasure [1]

  • jerasure_rs_cauchy => Cauchy Reed-Solomon encoding (Jerasure variant), based on Jerasure [1]

  • flat_xor_hd_3, flat_xor_hd_4 => Flat-XOR based HD combination codes, liberasurecode [3]

  • isa_l_rs_vand => Intel Storage Acceleration Library (ISA-L) - SIMD accelerated Erasure Coding backends [4]

  • isa_l_rs_cauchy => Cauchy Reed-Solomon encoding (ISA-L variant) [4]

  • shss => NTT Lab Japan’s Erasure Coding Library [5]

  • libphazr => Phazr.IO’s erasure code library with built-in privacy [6]


Code Maintenance

This library is currently mainly maintained by the Openstack Swift community. For questions or any other help, come ask in #openstack-swift on OFTC.


References

[1] Jerasure, C library that supports erasure coding in storage applications, http://jerasure.org

[2] Greenan, Kevin M et al, “Flat XOR-based erasure codes in storage systems”, https://web.archive.org/web/20161001210233/https://www.kaymgee.com/Kevin_Greenan/Publications_files/greenan-msst10.pdf

[3] liberasurecode, C API abstraction layer for erasure coding backends, https://opendev.org/openstack/liberasurecode

[4] Intel(R) Storage Acceleration Library (Open Source Version), https://01.org/intel%C2%AE-storage-acceleration-library-open-source-version

[5] Kota Tsuyuzaki <tsuyuzaki.kota@lab.ntt.co.jp>, “NTT SHSS Erasure Coding backend”

[6] Jim Cheung <support@phazr.io>, “Phazr.IO libphazr erasure code backend with built-in privacy”

Project details


Download files

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

Source Distribution

pyeclib-1.7.0.tar.gz (45.8 kB view details)

Uploaded Source

Built Distributions

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

pyeclib-1.7.0-cp310-abi3-musllinux_1_1_x86_64.whl (511.8 kB view details)

Uploaded CPython 3.10+musllinux: musl 1.1+ x86-64

pyeclib-1.7.0-cp310-abi3-musllinux_1_1_aarch64.whl (473.3 kB view details)

Uploaded CPython 3.10+musllinux: musl 1.1+ ARM64

pyeclib-1.7.0-cp310-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (533.7 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.12+ x86-64manylinux: glibc 2.5+ x86-64

pyeclib-1.7.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl (482.4 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

File details

Details for the file pyeclib-1.7.0.tar.gz.

File metadata

  • Download URL: pyeclib-1.7.0.tar.gz
  • Upload date:
  • Size: 45.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.12

File hashes

Hashes for pyeclib-1.7.0.tar.gz
Algorithm Hash digest
SHA256 1025e283bf9ee157706ef656920cb31a6b7986e21bfcb190288c8d8cde2c0ae5
MD5 265aadce7ee5675b546df185d5d0422b
BLAKE2b-256 ea68606532ec534f5a30beaec13eba142aa3832d47b1765f3f72a212034dd613

See more details on using hashes here.

File details

Details for the file pyeclib-1.7.0-cp310-abi3-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for pyeclib-1.7.0-cp310-abi3-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 f8c1eeaf090c6faece2c9974795f94c542b11c07cd875759ffbab1e19228cef8
MD5 8f33df742ae514464deec4099947c22b
BLAKE2b-256 61a3d053c5536802115c147579546d2a56cd97c83141e2c7264b9929ce47c09d

See more details on using hashes here.

File details

Details for the file pyeclib-1.7.0-cp310-abi3-musllinux_1_1_aarch64.whl.

File metadata

File hashes

Hashes for pyeclib-1.7.0-cp310-abi3-musllinux_1_1_aarch64.whl
Algorithm Hash digest
SHA256 105f3556476dc020f77314ff943ea36a2890a9fb401b4e1610e86c38746bedb0
MD5 663aeea647007a030624775605d62bc1
BLAKE2b-256 7125d6ab9951cc179515b9fc933905f6080f224605465de6c065710ceeadc8a1

See more details on using hashes here.

File details

Details for the file pyeclib-1.7.0-cp310-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for pyeclib-1.7.0-cp310-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 af89b9dd196d7e64f5b0ae5c0bed87a0ab482377ff48e4a80b3b991763f6c756
MD5 076d42c854670a1b0357a02e575dce97
BLAKE2b-256 41477713be5abaf9648a6751300a614cdfd63249c5a16c6daeb151382184da9e

See more details on using hashes here.

File details

Details for the file pyeclib-1.7.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl.

File metadata

File hashes

Hashes for pyeclib-1.7.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 f39d5212f7eebb155ead02b78bd881473eab93100c28f7e77bd577bf3f630576
MD5 ae23e006981b2ead9e8dca9803f014b9
BLAKE2b-256 0c2bd67fef8942f3635352fa2cc010404541507d4c38bcb1aa7800dc59462aed

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