-
Notifications
You must be signed in to change notification settings - Fork 4k
ARROW-1149: [Plasma] Create Cython client library for Plasma #797
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
Changes from all commits
9044a01
5178ee7
d590c8a
f8e05f2
bc681ca
18e0ac4
78d08ac
db2d09a
d9261b4
c3d462d
187cc24
1c5434c
5bf722a
bf39297
3c4de52
1aea320
066d0ea
cba92c1
d4934a9
2ff2480
f970df3
924888b
a4a9628
777e9c7
dd5a7d8
3021d59
6371e2e
1d7928f
c06f1b5
2b7f949
acc71d2
e26527c
67b0951
c9f6bcf
3b69973
fd80203
4ae1a27
348f9bf
1ff88e7
a9f6502
44d1a55
3270628
2c6d652
54f595e
8b53618
45f338f
9bc5c15
ed84c53
47033e7
47dc739
997de1e
b863d13
23fe5f5
0bea267
3e4a84d
b9e2dee
5f7b779
e33443d
08f24a5
d14ab87
d8319fc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. See accompanying LICENSE file. | ||
|
|
||
| set -e | ||
|
|
||
| source $TRAVIS_BUILD_DIR/ci/travis_env_common.sh | ||
|
|
||
| export ARROW_HOME=$ARROW_CPP_INSTALL | ||
| export PYARROW_WITH_PLASMA=1 | ||
|
|
||
| pushd $ARROW_PYTHON_DIR | ||
|
|
||
| function build_arrow_libraries() { | ||
| CPP_BUILD_DIR=$1 | ||
| CPP_DIR=$TRAVIS_BUILD_DIR/cpp | ||
|
|
||
| mkdir $CPP_BUILD_DIR | ||
| pushd $CPP_BUILD_DIR | ||
|
|
||
| cmake -DARROW_BUILD_TESTS=off \ | ||
| -DARROW_PYTHON=on \ | ||
| -DARROW_PLASMA=on \ | ||
| -DCMAKE_INSTALL_PREFIX=$2 \ | ||
| $CPP_DIR | ||
|
|
||
| make -j4 | ||
| make install | ||
|
|
||
| popd | ||
| } | ||
|
|
||
| python_version_tests() { | ||
| PYTHON_VERSION=$1 | ||
| CONDA_ENV_DIR=$TRAVIS_BUILD_DIR/pyarrow-test-$PYTHON_VERSION | ||
|
|
||
| export ARROW_HOME=$TRAVIS_BUILD_DIR/arrow-install-$PYTHON_VERSION | ||
| export LD_LIBRARY_PATH=$ARROW_HOME/lib:$PARQUET_HOME/lib | ||
|
|
||
| conda create -y -q -p $CONDA_ENV_DIR python=$PYTHON_VERSION cmake curl | ||
| source activate $CONDA_ENV_DIR | ||
|
|
||
| python --version | ||
| which python | ||
|
|
||
| # faster builds, please | ||
| conda install -y -q nomkl | ||
|
|
||
| # Expensive dependencies install from Continuum package repo | ||
| conda install -y -q pip numpy pandas cython | ||
|
|
||
| # Build C++ libraries | ||
| build_arrow_libraries arrow-build-$PYTHON_VERSION $ARROW_HOME | ||
|
|
||
| # Other stuff pip install | ||
| pip install -r requirements.txt | ||
|
|
||
| python setup.py build_ext --inplace | ||
|
|
||
| python -m pytest -vv -r sxX pyarrow | ||
|
|
||
| # Build documentation once | ||
| if [[ "$PYTHON_VERSION" == "3.6" ]] | ||
| then | ||
| conda install -y -q --file=doc/requirements.txt | ||
| python setup.py build_sphinx -s doc/source | ||
| fi | ||
|
|
||
| # Build and install pyarrow | ||
| pushd $TRAVIS_BUILD_DIR/python | ||
| python setup.py install | ||
| popd | ||
|
|
||
| # Run Plasma tests | ||
| pushd $TRAVIS_BUILD_DIR/python | ||
| python -m pytest pyarrow/tests/test_plasma.py | ||
| if [ $TRAVIS_OS_NAME == "linux" ]; then | ||
| PLASMA_VALGRIND=1 python -m pytest pyarrow/tests/test_plasma.py | ||
| fi | ||
| popd | ||
| } | ||
|
|
||
| # run tests for python 2.7 and 3.6 | ||
| python_version_tests 2.7 | ||
| python_version_tests 3.6 | ||
|
|
||
| popd |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,16 +19,13 @@ cmake_minimum_required(VERSION 2.8) | |
|
|
||
| project(plasma) | ||
|
|
||
| set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/../python/cmake_modules") | ||
|
||
|
|
||
| find_package(PythonLibsNew REQUIRED) | ||
| find_package(Threads) | ||
|
|
||
| option(PLASMA_PYTHON | ||
| "Build the Plasma Python extensions" | ||
| OFF) | ||
|
|
||
| if(APPLE) | ||
| SET(CMAKE_SHARED_LIBRARY_SUFFIX ".so") | ||
| endif(APPLE) | ||
| set(PLASMA_SO_VERSION "0") | ||
| set(PLASMA_ABI_VERSION "${PLASMA_SO_VERSION}.0.0") | ||
|
|
||
| include_directories(SYSTEM ${PYTHON_INCLUDE_DIRS}) | ||
| include_directories("${FLATBUFFERS_INCLUDE_DIR}" "${CMAKE_CURRENT_LIST_DIR}/" "${CMAKE_CURRENT_LIST_DIR}/thirdparty/" "${CMAKE_CURRENT_LIST_DIR}/../") | ||
|
|
@@ -40,7 +37,7 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-conversion") | |
| # Compile flatbuffers | ||
|
|
||
| set(PLASMA_FBS_SRC "${CMAKE_CURRENT_LIST_DIR}/format/plasma.fbs" "${CMAKE_CURRENT_LIST_DIR}/format/common.fbs") | ||
| set(OUTPUT_DIR ${CMAKE_CURRENT_LIST_DIR}/format/) | ||
| set(OUTPUT_DIR ${CMAKE_CURRENT_LIST_DIR}/) | ||
|
|
||
| set(PLASMA_FBS_OUTPUT_FILES | ||
| "${OUTPUT_DIR}/common_generated.h" | ||
|
|
@@ -69,8 +66,6 @@ endif() | |
|
|
||
| set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") | ||
|
|
||
| set_source_files_properties(extension.cc PROPERTIES COMPILE_FLAGS -Wno-strict-aliasing) | ||
|
|
||
| set(PLASMA_SRCS | ||
| client.cc | ||
| common.cc | ||
|
|
@@ -97,17 +92,33 @@ set_source_files_properties(malloc.cc PROPERTIES COMPILE_FLAGS "-Wno-error -O3") | |
| add_executable(plasma_store store.cc) | ||
| target_link_libraries(plasma_store plasma_static) | ||
|
|
||
| # Headers: top level | ||
| install(FILES | ||
| common.h | ||
| common_generated.h | ||
| client.h | ||
| events.h | ||
| plasma.h | ||
| plasma_generated.h | ||
| protocol.h | ||
| DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/plasma") | ||
|
|
||
| # Plasma store | ||
| install(TARGETS plasma_store DESTINATION ${CMAKE_INSTALL_BINDIR}) | ||
|
|
||
| # pkg-config support | ||
| configure_file(plasma.pc.in | ||
| "${CMAKE_CURRENT_BINARY_DIR}/plasma.pc" | ||
| @ONLY) | ||
| install( | ||
| FILES "${CMAKE_CURRENT_BINARY_DIR}/plasma.pc" | ||
| DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig/") | ||
|
|
||
| ####################################### | ||
| # Unit tests | ||
| ####################################### | ||
|
|
||
| ADD_ARROW_TEST(test/serialization_tests) | ||
| ARROW_TEST_LINK_LIBRARIES(test/serialization_tests plasma_static) | ||
| ADD_ARROW_TEST(test/client_tests) | ||
| ARROW_TEST_LINK_LIBRARIES(test/client_tests plasma_static) | ||
|
|
||
| if(PLASMA_PYTHON) | ||
| add_library(plasma_extension SHARED extension.cc) | ||
|
|
||
| if(APPLE) | ||
| target_link_libraries(plasma_extension plasma_static "-undefined dynamic_lookup") | ||
| else(APPLE) | ||
| target_link_libraries(plasma_extension plasma_static -Wl,--whole-archive ${FLATBUFFERS_STATIC_LIB} -Wl,--no-whole-archive) | ||
| endif(APPLE) | ||
| endif() | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little concerned about not also testing this on OSX, but I agree it might be too burdensome on Travis.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added tests for mac os now, if it becomes too burdensome, we can switch it off