summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.zuul.yaml71
-rw-r--r--playbooks/legacy/libec-pyeclib-unit-centos-7/run.yaml35
-rw-r--r--playbooks/legacy/libec-pyeclib-unit/run.yaml35
-rw-r--r--pyeclib/core.py5
-rw-r--r--pyeclib/ec_iface.py5
-rw-r--r--src/c/pyeclib_c/pyeclib_c.c5
-rwxr-xr-xtest/ec_pyeclib_file_test.sh6
-rwxr-xr-xtools/pip-install-with-liberasurecode.sh2
-rw-r--r--tox.ini7
9 files changed, 75 insertions, 96 deletions
diff --git a/.zuul.yaml b/.zuul.yaml
index 65f87bc..10bee54 100644
--- a/.zuul.yaml
+++ b/.zuul.yaml
@@ -1,24 +1,47 @@
- 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
- openstack-tox-py38
+ - openstack-tox-py39
- pyeclib-tox-py27-centos-7
- pyeclib-tox-py36-centos-8
- - libec-pyeclib-unit-centos-7
- libec-pyeclib-unit
+ - libec-pyeclib-unit-centos-7
+ - libec-pyeclib-unit-centos-8
gate:
jobs:
+ - test-release-openstack:
+ vars:
+ build_wheel: false
- openstack-tox-py35
- openstack-tox-py36
- openstack-tox-py37
- openstack-tox-py38
+ - openstack-tox-py39
- pyeclib-tox-py27-centos-7
- pyeclib-tox-py36-centos-8
+ - 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
@@ -36,21 +59,41 @@
- job:
name: libec-pyeclib-unit-centos-7
- parent: legacy-base
- run: playbooks/legacy/libec-pyeclib-unit-centos-7/run.yaml
+ parent: openstack-tox-py27
timeout: 1800
- nodeset: legacy-centos-7
- required-projects:
- - openstack/liberasurecode
- - openstack/pyeclib
- voting: false
+ nodeset: centos-7
+ vars:
+ tox_envlist: py27-compilelibs
+
+- job:
+ name: libec-pyeclib-unit-centos-8
+ parent: openstack-tox-py36
+ timeout: 1800
+ nodeset: centos-8
+ vars:
+ tox_envlist: py36-compilelibs
- job:
name: libec-pyeclib-unit
- parent: legacy-base
- run: playbooks/legacy/libec-pyeclib-unit/run.yaml
+ parent: openstack-tox-py39
timeout: 1800
- required-projects:
- - openstack/liberasurecode
- - openstack/pyeclib
- voting: false
+ 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
diff --git a/playbooks/legacy/libec-pyeclib-unit-centos-7/run.yaml b/playbooks/legacy/libec-pyeclib-unit-centos-7/run.yaml
deleted file mode 100644
index 8c645b0..0000000
--- a/playbooks/legacy/libec-pyeclib-unit-centos-7/run.yaml
+++ /dev/null
@@ -1,35 +0,0 @@
-- hosts: all
- name: Autoconverted job legacy-libec-pyeclib-unit-centos-7 from old job gate-libec-pyeclib-unit-centos-7
- roles:
- - bindep
-
- tasks:
-
- - name: Ensure legacy workspace directory
- file:
- path: '{{ ansible_user_dir }}/workspace'
- state: directory
-
- - shell:
- cmd: |
- set -e
- set -x
- cd $WORKSPACE
- /usr/zuul-env/bin/zuul-cloner --cache-dir /opt/git \
- https://opendev.org \
- openstack/liberasurecode \
- openstack/pyeclib
- # build libec
- cd openstack/liberasurecode
- ./autogen.sh
- ./configure
- make
- sudo make install
- sudo bash -c "echo /usr/local/lib >> /etc/ld.so.conf"
- sudo ldconfig
- # test pyeclib
- cd $WORKSPACE/openstack/pyeclib
- tox -e py27
- executable: /bin/bash
- chdir: '{{ ansible_user_dir }}/workspace'
- environment: '{{ zuul | zuul_legacy_vars }}'
diff --git a/playbooks/legacy/libec-pyeclib-unit/run.yaml b/playbooks/legacy/libec-pyeclib-unit/run.yaml
deleted file mode 100644
index 473a16b..0000000
--- a/playbooks/legacy/libec-pyeclib-unit/run.yaml
+++ /dev/null
@@ -1,35 +0,0 @@
-- hosts: all
- name: Autoconverted job legacy-libec-pyeclib-unit from old job gate-libec-pyeclib-unit-ubuntu-xenial
- roles:
- - bindep
-
- tasks:
-
- - name: Ensure legacy workspace directory
- file:
- path: '{{ ansible_user_dir }}/workspace'
- state: directory
-
- - shell:
- cmd: |
- set -e
- set -x
- cd $WORKSPACE
- /usr/zuul-env/bin/zuul-cloner --cache-dir /opt/git \
- https://opendev.org \
- openstack/liberasurecode \
- openstack/pyeclib
- # build libec
- cd openstack/liberasurecode
- ./autogen.sh
- ./configure
- make
- sudo make install
- sudo bash -c "echo /usr/local/lib >> /etc/ld.so.conf"
- sudo ldconfig
- # test pyeclib
- cd $WORKSPACE/openstack/pyeclib
- tox -e py27
- executable: /bin/bash
- chdir: '{{ ansible_user_dir }}/workspace'
- environment: '{{ zuul | zuul_legacy_vars }}'
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 a924dc3..bd69861 100644
--- a/pyeclib/ec_iface.py
+++ b/pyeclib/ec_iface.py
@@ -302,7 +302,6 @@ class ECDriver(object):
:param missing_fragment_indexes: a list of integers representing
the indexes of the fragments to be
reconstructed.
- :param destination_index: the index of the element to reconstruct
:returns: a list of buffers (ordered by fragment index) containing
the reconstructed payload associated with the indexes
provided in missing_fragment_indexes
@@ -313,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.
@@ -330,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)
diff --git a/src/c/pyeclib_c/pyeclib_c.c b/src/c/pyeclib_c/pyeclib_c.c
index 4e2646c..1968b80 100644
--- a/src/c/pyeclib_c/pyeclib_c.c
+++ b/src/c/pyeclib_c/pyeclib_c.c
@@ -26,6 +26,7 @@
#include <stdio.h>
#include <paths.h>
+#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <math.h>
#include <bytesobject.h>
@@ -492,7 +493,7 @@ pyeclib_c_encode(PyObject *self, PyObject *args)
char **encoded_parity = NULL; /* array of m parity buffers */
PyObject *list_of_strips = NULL; /* list of encoded strips to return */
char *data; /* param, data buffer to encode */
- int data_len; /* param, length of data buffer */
+ Py_ssize_t data_len; /* param, length of data buffer */
uint64_t fragment_len; /* length, in bytes of the fragments */
int i; /* a counter */
int ret = 0;
@@ -1040,7 +1041,7 @@ pyeclib_c_get_metadata(PyObject *self, PyObject *args)
char *fragment = NULL; /* param, fragment from caller */
fragment_metadata_t c_fragment_metadata; /* structure to hold metadata */
PyObject *fragment_metadata = NULL; /* metadata object to return */
- int fragment_len; /* fragment length */
+ Py_ssize_t fragment_len; /* fragment length */
int formatted; /* format the metadata in a dict */
int ret;
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..2b3d394 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
diff --git a/tox.ini b/tox.ini
index 349e374..c8f003f 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,20 +1,19 @@
[tox]
-envlist = py27,py35,py36,py37,pep8
+envlist = py{27,35,36,37,38,39}-compilelibs,pep8,docs
[testenv]
deps =
-r{toxinidir}/test-requirements.txt
commands=
nosetests --no-path-adjustment -v test/
-
-[testenv:liberasurecode-git]
setenv = LIBERASURECODE_DIR={envdir}/liberasurecode
ISAL_DIR={envdir}/isa-l
JERASURE_DIR={envdir}/jerasure
GFCOMPLETE_DIR={envdir}/gf-complete
passenv = LIBERASURECODE_REF
install_command =
- {toxinidir}/tools/pip-install-with-liberasurecode.sh {opts} {packages}
+ compilelibs: {toxinidir}/tools/pip-install-with-liberasurecode.sh {opts} {packages}
+ !compilelibs: pip install {opts} {packages}
[testenv:pep8]
skip_install = True