diff options
-rw-r--r-- | .zuul.yaml | 35 | ||||
-rw-r--r-- | LICENSE (renamed from License.txt) | 0 | ||||
-rw-r--r-- | README.rst | 4 | ||||
-rw-r--r-- | pyeclib/core.py | 5 | ||||
-rw-r--r-- | pyeclib/ec_iface.py | 4 | ||||
-rw-r--r-- | setup.py | 21 | ||||
-rw-r--r-- | src/c/pyeclib_c/pyeclib_c.c | 8 | ||||
-rwxr-xr-x | test/ec_pyeclib_file_test.sh | 6 | ||||
-rwxr-xr-x | tools/pip-install-with-liberasurecode.sh | 4 |
9 files changed, 72 insertions, 15 deletions
@@ -1,8 +1,12 @@ - project: templates: - openstack-python-jobs + - libec-pyeclib-jobs-arm64 check: jobs: + - test-release-openstack: + vars: + build_wheel: false - openstack-tox-py35 - openstack-tox-py36 - openstack-tox-py37 @@ -15,6 +19,9 @@ - libec-pyeclib-unit-centos-8 gate: jobs: + - test-release-openstack: + vars: + build_wheel: false - openstack-tox-py35 - openstack-tox-py36 - openstack-tox-py37 @@ -25,6 +32,16 @@ - libec-pyeclib-unit - libec-pyeclib-unit-centos-7 - libec-pyeclib-unit-centos-8 + pre-release: + jobs: + - release-openstack-python: + vars: + build_wheel: false + release: + jobs: + - release-openstack-python: + vars: + build_wheel: false - job: name: pyeclib-tox-py27-centos-7 @@ -62,3 +79,21 @@ timeout: 1800 vars: tox_envlist: py39-compilelibs + +- job: + name: libec-pyeclib-unit-arm64 + parent: libec-pyeclib-unit + nodeset: ubuntu-focal-arm64 + description: | + Run unit tests for an OpenStack Python project under cPython + version 3.9 on top of arm64 architecture. + +- project-template: + name: libec-pyeclib-jobs-arm64 + description: | + Runs pyeclib unit tests designated for testing on top of + ARM64 architecture + check-arm64: + jobs: + - libec-pyeclib-unit-arm64: + voting: false @@ -113,7 +113,7 @@ 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 freenode. +For questions or any other help, come ask in #openstack-swift on OFTC. ----- @@ -124,7 +124,7 @@ References [2] Greenan, Kevin M et al, "Flat XOR-based erasure codes in storage systems", http://www.kaymgee.com/Kevin_Greenan/Publications_files/greenan-msst10.pdf -[3] liberasurecode, C API abstraction layer for erasure coding backends, https://github.com/openstack/liberasurecode +[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 diff --git a/pyeclib/core.py b/pyeclib/core.py index 11e29e3..3fbbcd3 100644 --- a/pyeclib/core.py +++ b/pyeclib/core.py @@ -58,6 +58,11 @@ class ECPyECLibDriver(object): self.algsig_chksum, validate) + def __repr__(self): + return '%s(k=%r, m=%r, hd=%r, ec_type=%r, chksum_type=%r)' % ( + self.__class__.__name__, self.k, self.m, self.hd, self.ec_type, + self.chksum_type) + def encode(self, data_bytes): return pyeclib_c.encode(self.handle, data_bytes) diff --git a/pyeclib/ec_iface.py b/pyeclib/ec_iface.py index c7dfcac..bd69861 100644 --- a/pyeclib/ec_iface.py +++ b/pyeclib/ec_iface.py @@ -312,7 +312,7 @@ class ECDriver(object): available_fragment_payloads, missing_fragment_indexes) def fragments_needed(self, reconstruction_indexes, - exclude_indexes=[]): + exclude_indexes=None): """ Determine which fragments are needed to reconstruct some subset of missing fragments. @@ -329,6 +329,8 @@ class ECDriver(object): :raises: ECDriverError if there is an error during decoding or there are not sufficient fragments to decode """ + if exclude_indexes is None: + exclude_indexes = [] return self.ec_lib_reference.fragments_needed(reconstruction_indexes, exclude_indexes) @@ -104,7 +104,7 @@ class build(_build): def check_liberasure(self): library_basename = "liberasurecode" library_version = "1" - library_url = "https://github.com/openstack/liberasurecode" + library_url = "https://opendev.org/openstack/liberasurecode" found_path = _find_library("erasurecode") if found_path: @@ -230,12 +230,27 @@ setup(name='pyeclib', author_email='kmgreen2@gmail.com', maintainer='Kevin Greenan and Tushar Gohad', maintainer_email='kmgreen2@gmail.com, tusharsg@gmail.com', - url='http://git.openstack.org/cgit/openstack/pyeclib/', - bugtrack_url='https://bugs.launchpad.net/pyeclib', + url='https://opendev.org/openstack/pyeclib', + project_urls={ + 'Bug Tracker': 'https://bugs.launchpad.net/pyeclib', + }, description=('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.'), + classifiers=[ + "Development Status :: 5 - Production/Stable", + "Programming Language :: Python :: 2", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Intended Audience :: Developers", + "License :: OSI Approved :: BSD License", + ], long_description=open('README.rst', 'r').read(), platforms='Linux', license='BSD', diff --git a/src/c/pyeclib_c/pyeclib_c.c b/src/c/pyeclib_c/pyeclib_c.c index 1968b80..3184b34 100644 --- a/src/c/pyeclib_c/pyeclib_c.c +++ b/src/c/pyeclib_c/pyeclib_c.c @@ -989,15 +989,15 @@ hex_encode_string(char *buf, uint32_t buf_len) { char *hex_encoded_buf = (char*)alloc_zeroed_buffer((buf_len * 2) + 1); char *hex_encoded_ptr = hex_encoded_buf; - int i; + uint32_t i; for (i = 0; i < buf_len; i++) { - hex_encoded_ptr += sprintf(hex_encoded_ptr, "%.2x", (unsigned char)buf[i]); + hex_encoded_ptr += sprintf(hex_encoded_ptr, "%.2x", (unsigned char)buf[i]); } hex_encoded_buf[buf_len * 2] = 0; - - return hex_encoded_buf; + + return hex_encoded_buf; } static PyObject* diff --git a/test/ec_pyeclib_file_test.sh b/test/ec_pyeclib_file_test.sh index 446ad62..f9f396b 100755 --- a/test/ec_pyeclib_file_test.sh +++ b/test/ec_pyeclib_file_test.sh @@ -66,7 +66,7 @@ for TYPE in ${TYPES}; do FAULT_TOL=${NUM_PARITY} if [[ ${TYPE} == "flat_xor_hd"* ]]; then FAULT_TOL="2" - fi + fi for file in `cd ${FILES}; echo *; cd ..`; do python ${TOOLS_DIR}/pyeclib_encode.py ${NUM_DATA} ${NUM_PARITY} ${TYPE} ${FILE_DIR} ${file} ${FRAGMENT_DIR} done @@ -76,10 +76,10 @@ for TYPE in ${TYPES}; do let i=0 while (( $i < ${FAULT_TOL} )); do index=$(( RANDOM % NUM_TOTAL )) - fragments[${index}]="" + fragments[${index}]="" let i=$i+1 done - python ${TOOLS_DIR}/pyeclib_decode.py ${NUM_DATA} ${NUM_PARITY} ${TYPE} ${fragments[*]} ${DECODED_DIR}/${file} + python ${TOOLS_DIR}/pyeclib_decode.py ${NUM_DATA} ${NUM_PARITY} ${TYPE} ${fragments[*]} ${DECODED_DIR}/${file} diff ${FILE_DIR}/${file} ${DECODED_DIR}/${file}.decoded if [[ $? != 0 ]]; then echo "${FILE_DIR}/${file} != ${DECODED_DIR}/${file}.decoded" diff --git a/tools/pip-install-with-liberasurecode.sh b/tools/pip-install-with-liberasurecode.sh index 10a8093..32aa672 100755 --- a/tools/pip-install-with-liberasurecode.sh +++ b/tools/pip-install-with-liberasurecode.sh @@ -6,7 +6,7 @@ fi if [ -n "$ISAL_DIR" ]; then if [ ! -d "$ISAL_DIR" ]; then - git clone git://github.com/01org/isa-l.git "$ISAL_DIR" + git clone git://github.com/intel/isa-l.git -b v2.30.0 "$ISAL_DIR" fi pushd "$ISAL_DIR" ./autogen.sh @@ -49,7 +49,7 @@ if [ -z "$LIBERASURECODE_DIR" ]; then exit 1 fi if [ ! -d "$LIBERASURECODE_DIR" ]; then - git clone https://git.openstack.org/openstack/liberasurecode "$LIBERASURECODE_DIR" + git clone https://opendev.org/openstack/liberasurecode.git "$LIBERASURECODE_DIR" fi pushd "$LIBERASURECODE_DIR" if [ -n "$LIBERASURECODE_REF" ]; then |