Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pybind: move cephfs to Cython #7745

Merged
merged 3 commits into from
Mar 1, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion admin/build-doc
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ nm $vdir/lib/python*/*-packages/rados.so | grep 'U rados_' | \
# --global-option=build_ext --global-option="--cython-include-dirs $TOPDIR/src/pybind/rados/"
# but that doesn't work, so copying the file in the rbd module directly, that's ok for docs
cp -f $TOPDIR/src/pybind/rados/rados.pxd $TOPDIR/src/pybind/rbd/
cp -f $TOPDIR/src/pybind/rados/rados.pxd $TOPDIR/src/pybind/cephfs/

ln -sf librbd.so.1 $vdir/lib/librbd.so
gcc -shared -o $vdir/lib/librbd.so.1 -xc /dev/null
Expand All @@ -96,7 +97,19 @@ nm $vdir/lib/python*/*-packages/rbd.so | grep 'U rbd_' | \
awk '{ print "void "$2"(void) {}" }' | \
gcc -shared -o $vdir/lib/librbd.so.1 -xc -

rm -f $TOPDIR/src/pybind/rbd/rados.pxd

ln -sf libcephfs.so.1 $vdir/lib/libcephfs.so
gcc -shared -o $vdir/lib/libcephfs.so.1 -xc /dev/null
CFLAGS="-iquote $TOPDIR/src/include" \
CPPFLAGS="-iquote $TOPDIR/src/include" \
LDFLAGS="-L$vdir/lib -Wl,--no-as-needed" \
$vdir/bin/pip install $TOPDIR/src/pybind/cephfs
nm $vdir/lib/python*/*-packages/cephfs.so | grep 'U cephfs_' | \
awk '{ print "void "$2"(void) {}" }' | \
gcc -shared -o $vdir/lib/libcephfs.so.1 -xc -

rm -f $TOPDIR/src/pybind/rbd/rados.pxd $TOPDIR/src/pybind/cephfs/rados.pxd


$vdir/bin/sphinx-build -a -n -b dirhtml -d doctrees $TOPDIR/doc $TOPDIR/build-doc/output/html
$vdir/bin/sphinx-build -a -b man -d doctrees $TOPDIR/doc $TOPDIR/build-doc/output/man
Expand Down
3 changes: 2 additions & 1 deletion ceph.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -1254,7 +1254,8 @@ ln -sf %{_libdir}/librbd.so.1 /usr/lib64/qemu/librbd.so.1
#################################################################################
%files -n python-cephfs
%defattr(-,root,root,-)
%{python_sitelib}/cephfs.py*
%{python_sitearch}/cephfs.so
%{python_sitearch}/cephfs-*.egg-info
%{python_sitelib}/ceph_volume_client.py*

#################################################################################
Expand Down
3 changes: 2 additions & 1 deletion debian/python-cephfs.install
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
usr/lib/python*/dist-packages/cephfs.py*
usr/lib/python*/dist-packages/ceph_volume_client.py*
usr/lib/python*/dist-packages/cephfs.so
usr/lib/python*/dist-packages/cephfs-*.egg-info
1 change: 0 additions & 1 deletion src/Makefile-client.am
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ cephfs_SOURCES = cephfs.cc
cephfs_LDADD = $(LIBCOMMON)
bin_PROGRAMS += cephfs

python_PYTHON += pybind/cephfs.py
python_PYTHON += pybind/ceph_volume_client.py

# libcephfs (this should go somewhere else in the future)
Expand Down
2 changes: 1 addition & 1 deletion src/civetweb
Submodule civetweb updated 1 files
+0 −4 src/civetweb.c
17 changes: 10 additions & 7 deletions src/pybind/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@

if ENABLE_CLIENT
if WITH_RADOS
if WITH_RBD
if WITH_CYTHON

PY_DISTUTILS = \
Expand All @@ -11,10 +9,15 @@ PY_DISTUTILS = \
CYTHON_BUILD_DIR="$(shell readlink -f $(builddir))/build" \
${PYTHON} ./setup.py

include pybind/rbd/Makefile.am
if WITH_RADOS
include pybind/rados/Makefile.am
if WITH_RBD
include pybind/rbd/Makefile.am
endif # WITH_RBD
if WITH_CEPHFS
include pybind/cephfs/Makefile.am
endif # WITH_CEPHFS
endif # WITH_RADOS

endif
endif
endif
endif
endif # WITH_CYTHON
endif # ENABLE_CLIENT
7 changes: 0 additions & 7 deletions src/pybind/ceph_volume_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,6 @@
import cephfs
from ceph_argparse import json_command

# Generate missing lib errors at load time, rather than the
# first time someone tries to use the FS
try:
cephfs.load_libcephfs()
except EnvironmentError as e:
raise ImportError(e.__str__())


class RadosError(Exception):
"""
Expand Down
Loading