Commit Graph

62 Commits

Author SHA1 Message Date
Tim Burke f28ccb389a Drop support for liberasurecode<1.4.0
Six years seems like more than enough warning, and the data corruption
bug fixed in 1.3.1 is pretty bad.

This also gives us an opportunity to clean up a DeprecationWarning:

   The distutils package is deprecated and slated for removal in
   Python 3.12. Use setuptools or check PEP 632 for potential
   alternatives

Change-Id: Ic34b671dfb2b5bfa7e3a21813cd49d7b720cc94a
Closes-Bug: #1639691
2023-12-18 22:49:29 +00:00
Tim Burke 008840ca19 Prep for 1.6.1 release
Change-Id: I37735a81131612464caff1d08b78d5efb78d694c
2022-04-13 22:10:27 -07:00
Tim Burke 2884a6b882 Use hacking checks
Change-Id: I5ed0829d1124c813fb3457cf45152a0f175cebea
2022-04-08 20:29:20 -07:00
Tim Burke 4c5dc672d9 Deprecate Jerasure support
It's been on its last legs ever since it got pulled from UTK and bitbucket.

See also: the notice at http://web.eecs.utk.edu/~jplank/plank/www/software.html

Change-Id: I28e050a52a2dcf738b1ce7edcfdc3fd78172d025
2022-04-05 12:07:37 -07:00
Zuul 3cc64adebd Merge "Add a __repr__ for ECPyECLibDriver" 2021-06-08 23:04:04 +00:00
Zuul 77028c8d87 Merge "Stop using a mutable default param in fragments_needed" 2021-05-11 06:41:04 +00:00
Tim Burke 8d6bc0ac70 Add a __repr__ for ECPyECLibDriver
Change-Id: I1a22049ee42fc5ee7832989e75c6c9b7147db232
2021-05-10 18:11:32 -07:00
Tim Burke c3313b3ebc Stop using a mutable default param in fragments_needed
Change-Id: I35454f050c8fb24795182fb3fe55c3bb4076e6fc
2021-05-07 16:09:35 -07:00
Tim Burke 5355c0268b Fix reconstruct docstring
Change-Id: Ia3bbea67c65b33262307085c48fc3401988bbc93
2021-05-07 16:08:22 -07:00
Tim Burke 2265056ff0 Fix gate
* Update pike to train
* Fix pep8
* Mark jobs based on legacy jobs non-voting until we can replace them

Change-Id: Ia83ad102bb5c096b01ce73bffb86d44732d2c784
2020-09-22 16:55:54 -07:00
Tim Burke 0e3afd3b94 Fix gate
Change-Id: I1c9bd3a4706a1d7235981f15cb6e1f4cc8d7ff55
2019-02-13 09:43:04 -08:00
Tovin Seven 6d98fcf09a Trivial: Update pypi url to new url
Pypi url changed from [1] to [2]

[1] https://pypi.python.org/pypi/<package>
[2] https://pypi.org/project/<package>

Change-Id: Icb36d732f0b4f48be601ac51a387df9572312214
2018-04-20 17:16:39 +07:00
Zuul 3b7a278123 Merge "Switch from pep8 to flake8 for linting" 2018-03-13 20:15:31 +00:00
Jenkins aa7a2c0cf2 Merge "Clean up ECDriver" 2017-09-13 21:06:46 +00:00
Jenkins 6768ad4403 Merge "Simplify required-method check" 2017-06-06 20:53:33 +00:00
Jenkins c4312307ab Merge "Fix error message with invalid parity number" 2017-05-03 22:52:25 +00:00
Tim Burke 292856defa Switch from pep8 to flake8 for linting
...and clean up the unused variables, unused imports, and inconsistent
spacing that flake8 revealed.

Change-Id: I3ae1e834f01f477be88dfc48de954eeaf19e43cf
2017-05-03 15:07:20 -07:00
Tim Burke 607500d3c5 Simplify required-method check
Change-Id: I527ab490d707871cc9c08345e3213ec2da7c0c43
2017-05-02 16:20:28 -07:00
Tim Burke f990e62dc0 Clean up ECDriver
- Add a docstring, since I can never remember the **kwargs.
 - Drop the (unused) *args.
 - Raise an error earlier if neither ec_type nor library_import_str
   is provided.

Change-Id: I38b71ede59b6b0e249223792207b0f48438f7b97
2017-05-02 16:07:56 -07:00
Jim Cheung 69cb73f9d1 Add Phazr.IO libphazr backend support
Currently, there are several implementations of erasure codes that are
available within OpenStack Swift.  Most, if not all, of which are based
on the Reed Solomon coding algorithm.

Phazr.IO’s Erasure Coding technology uses a patented algorithm which are
significantly more efficient and improves the speed of coding, decoding
and reconstruction.  In addition, Phazr.IO Erasure Code use a non-systematic
algorithm which provides data protection at rest and in transport without
the need to use encryption.

Please contact support@phazr.io for more info on our technology.

Change-Id: I9377fa32426a190efd0a7f0675ecf13d7e90367d
2017-03-01 19:19:22 -08:00
Kota Tsuyuzaki 5ebb2cd307 Fix error message with invalid parity number
Change-Id: I620df09cf8ddd03e4a4749e9a1d31f8cbe45c752
2017-02-07 23:11:53 -08:00
Kota Tsuyuzaki 22ae03758d ISA-L Cauchy support
This is for supporting ISA-L cauchy based matrix. The difference
from isa_l_rs_vand is only the matrix to use the encode/decode
calculation.

As a known issue, isa_l_rs_vand backend has constraint for the
combinations of the available fragment to be able to
decode/reconstuct. (See related change in detail)

To avoid the constraint, this patch adds another isa-l backend to use
cauchy matrix. The reason I try to add this intead of changing at
sa_l_rs_vand, the isa_l_rs_vand backend may be already used and if we
change the matrix, the current users won't be able to decode the data.

To avoid the problem and keep the backward compatibility, this is in
another isa_l_rs_cauchy namespace.

NOTE: this depends on tag may be meaningless because the depending target
is a c lang project so probably no scripts to install it we have and then,
almost of the tests for isa-l will be skipped due to a lack of isa-l
backend installation.

Related-Change: Icee788a0931fe692fe0de31fabc4ba450e338a87

Depends-On: I6eb150d9d0c3febf233570fa7729f9f72df2e9be

Change-Id: I3a5516545d17ab7ac67a9a3627c85243e2110764
2016-12-01 17:18:42 -08:00
Jenkins 9a20711310 Merge "Assorted combinatoric-test fixes" 2016-11-29 19:28:40 +00:00
Kota Tsuyuzaki d163972bb0 Add soft warning log line when using liberasurecode <1.3.1
To apply the fix for a liberasurecode issue [1], we need hard depencency
of liberasurecode requires >=1.3.1. However current binary dependency
maintainance tool "bindep" works only for packagers' repository. (i.e. it
refers the version of apt/yum/etc...) And nothing is cared for the binary
built from source.

This patch provides a way to detect incompatible liberasurecode and
makes a warning log line to syslog which suggest "you're using older
liberasurecode which will be deprecated, please upgrade it".

NOTE:
- This dependency managemnet depends on erasurecode_version.h header
  file in liberasurecode. i.e. it cannot care of overwritten .so library
  after PyECLib built once.

Partial-Bug: #1639691

1: Icee788a0931fe692fe0de31fabc4ba450e338a87

Change-Id: Ice5e96f0a59096cc9067823f0d62d6c7065ed62f
2016-11-28 20:22:57 -08:00
Tim Burke 9cc72f7ce8 Assorted combinatoric-test fixes
* Test flat_xor_hd decoding/reconstruction
* Use random input
* Make py3-friendly

Additionally:

* Accept iterables as fragment payloads, rather than just lists
* Add a __repr__ for ECDrivers

Change-Id: Ic5b5e5ef2420afdc318b403fcbea1ff106e16a33
2016-11-17 09:57:35 -08:00
Jenkins f53a0d5700 Merge "Fix arg k, m to be required" 2016-09-07 05:41:45 +00:00
Kota Tsuyuzaki 25bc26b914 Fix arg k, m to be required
Right now ECDriver doesn't check if k, m exist in the kwargs for init.
That can tigger unfortunately success to init and that will fail at
encode/decode (or result in odd with get_segment_info)

Once, we have jerasure_rs_vand in default, that worked becuase jerasure
did the assertion for the k, m parameters but we can reproduce the
failures which this patch want fix with like:

driver = ECDriver(ec_type='liberasurecode_rs_vand')   # <- this is
default and it succeeded!
driver.encode(' ')  # <- And then, this will result in ECDriverError:
Out of memory, whooa!

This patch fixes this to check the k, m existence in the init process.

Change-Id: I0757c0a4e510ba42f357db0cac22861919d0ca26
2016-09-06 22:36:16 -07:00
Kota Tsuyuzaki 10802bac59 Add tox/requirements settings to pass gate job
Plus, we need liberasurecode version handling for a few place because
some tests/engine itself is broken with a lack of backword
compatibility.

Closes-Bug: #1586220

Change-Id: I72adaefa10875a73e3e5304eb40fe5d9f6d2598a
2016-08-12 00:05:03 -07:00
Timur Alperovich 4f278195a4 Use the check_backend_available function.
Eliminates the spurrious syslog messages and is a cleaner mechanism
for querying all of the available backends on a system.
2016-03-15 10:34:49 -07:00
Tushar Gohad efddaebeda Explicit driver reference check in VALID_EC_TYPES eval 2015-11-23 02:56:11 +00:00
Tushar Gohad 9b46e826da Disable error reporting during VALID_EC_TYPES eval
... this should not be required after upstream
liberasurecode has more configurable logging
2015-11-23 00:33:11 +00:00
Tushar Gohad b14ac48319 Make VALID_EC_TYPES a runtime/dynamic property
... this is needed for compatibility with older versions
liberasurecode where a few EC types/backends were not
available
2015-11-20 07:23:47 +00:00
Tushar Gohad 47f0aa01e6 Fix line endings in README, up minor rev in setup.py 2015-11-12 18:03:03 +00:00
Tushar Gohad 51737a984f Allow 'flat_xor_hd_4' from external API
Add 'hd' argument back to the internal API
2015-09-08 09:24:32 +00:00
Tushar Gohad e3159f3ae0 More PEP8 fixes 2015-07-28 00:11:15 -07:00
Tushar Gohad 1a1c839e44 PEP8 fixes
TODO: test code
2015-07-22 11:38:54 -07:00
Victor Stinner de2a25c5fe Fix Python 3 issues
* Use relative imports
* Fix bytes/unicode issues in tests
* Replace long() with int()
* Replace a/b with a//b to get integer division
* Use a key function to sort list
* Replace zip() with list(zip()) in a test to get a list on Python 3
2015-07-21 14:51:53 +02:00
Tushar Gohad 04700a4fcf Expose liberasurecode error codes in PyECLib
... also move exception handing down to the C backend layer, so
it is easier to add new error codes.  Addresses #61.
2015-07-19 18:49:34 -07:00
Kevin Greenan 0acbcd2513 Example of passing different exception when decode has insifficient fragments. 2015-07-12 09:32:17 -07:00
Kevin Greenan 169feb5589 Plugging in new internal RS backend into pyeclib 2015-05-19 10:31:54 -07:00
Kevin Greenan 041d44311b Handle non-string arguments in the base PyECLib exception constructor. 2015-04-06 13:42:12 -07:00
Kevin Greenan 88c46cc3ac Revert "Merged in bloodeagle40234/pyeclib/fix-error-handling (pull request #22)"
This reverts commit 65976eb0cc, reversing
changes made to 29c20a8d23.
2015-04-06 12:52:03 -07:00
Kota Tsuyuzaki 132683ba8c Fix ECDriverError.__str__
If ECDriverError is initialized with a non-string argument then its
str method returns non-string, it will return a confusable message
for users.

This patch fixes ECDriverError to set a string message when
the argument doesn't have str method which return a string.
2015-04-02 00:17:35 -07:00
Tushar Gohad 1c9fc482b0 Convert remaining ECPyECLibException instances to ECDriverError 2015-03-13 01:06:29 -07:00
Kevin Greenan d1bf211f43 Replace ECPyECLibException with ECDriverError 2015-03-13 01:06:23 -07:00
Kevin Greenan f48656c5d7 Wrap calls to pyeclib_c in core.py with try/catch and wrote example
test to validate exceptions.
2015-03-10 22:46:38 -07:00
Tushar Gohad 62d41b5c41 Minor whitespace fixes 2015-03-08 02:17:24 -07:00
Kota Tsuyuzaki 298826e0a9 Add shss and its unit tests 2015-03-04 20:18:10 +09:00
Tushar Gohad e74702e7bc Add isa_l_rs_vand to list of valid EC types 2015-03-01 10:19:33 -07:00
Kevin Greenan 3926acccf1 Added to the list of supported EC types. 2015-03-01 09:03:05 -08:00