[ 
https://issues.apache.org/jira/browse/ARROW-2182?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16435258#comment-16435258
 ] 

ASF GitHub Bot commented on ARROW-2182:
---------------------------------------

xhochy closed pull request #1775: ARROW-2182: [Python] Build C++ libraries in 
benchmarks build step 
URL: https://github.com/apache/arrow/pull/1775
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/.travis.yml b/.travis.yml
index c3e08b9b25..2fd31bec72 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -52,6 +52,8 @@ matrix:
     - ARROW_TRAVIS_PLASMA=1
     - ARROW_TRAVIS_ORC=1
     - ARROW_TRAVIS_CLANG_FORMAT=1
+    - ARROW_TRAVIS_PYTHON_BENCHMARKS=1
+    - ARROW_TRAVIS_PYTHON_DOCS=1
     - ARROW_BUILD_WARNING_LEVEL=CHECKIN
     - CC="clang-5.0"
     - CXX="clang++-5.0"
diff --git a/ci/travis_script_python.sh b/ci/travis_script_python.sh
index 8421e5cd3f..325272fb18 100755
--- a/ci/travis_script_python.sh
+++ b/ci/travis_script_python.sh
@@ -107,7 +107,7 @@ fi
 PYARROW_PATH=$CONDA_PREFIX/lib/python$PYTHON_VERSION/site-packages/pyarrow
 python -m pytest -r sxX --durations=15 $PYARROW_PATH --parquet
 
-if [ "$PYTHON_VERSION" == "3.6" ] && [ $TRAVIS_OS_NAME == "linux" ]; then
+if [ "$ARROW_TRAVIS_PYTHON_DOCS" == "1" ] && [ "$PYTHON_VERSION" == "3.6" ]; 
then
   # Build documentation once
   conda install -y -q \
         ipython \
@@ -120,3 +120,22 @@ if [ "$PYTHON_VERSION" == "3.6" ] && [ $TRAVIS_OS_NAME == 
"linux" ]; then
   sphinx-build -q -b html -d _build/doctrees -W source _build/html
   popd
 fi
+
+if [ "$ARROW_TRAVIS_PYTHON_BENCHMARKS" == "1" ] && [ "$PYTHON_VERSION" == 
"3.6" ]; then
+  # Check the ASV benchmarking setup.
+  # Unfortunately this won't ensure that all benchmarks succeed
+  # (see https://github.com/airspeed-velocity/asv/issues/449)
+  source deactivate
+  conda create -y -q -n pyarrow_asv python=$PYTHON_VERSION
+  source activate pyarrow_asv
+  pip install -q git+https://github.com/pitrou/asv.git@customize_commands
+
+  pushd $TRAVIS_BUILD_DIR/python
+  # Workaround for https://github.com/airspeed-velocity/asv/issues/631
+  git fetch --depth=100 origin master:master
+  # Generate machine information (mandatory)
+  asv machine --yes
+  # Run benchmarks on the changeset being tested
+  asv run --no-pull --show-stderr --quick ${TRAVIS_COMMIT}^!
+  popd
+fi
diff --git a/python/README-benchmarks.md b/python/README-benchmarks.md
index 60fa88f4ac..c51d36e6bb 100644
--- a/python/README-benchmarks.md
+++ b/python/README-benchmarks.md
@@ -32,21 +32,16 @@ use your current Python interpreter and environment.
 ## Running with arbitrary revisions
 
 ASV allows to store results and generate graphs of the benchmarks over
-the project's evolution.  Doing this requires a bit more massaging
-currently.
-
-First you have to install ASV's development version:
+the project's evolution.  For this you have to install our fork of ASV:
 
 ```shell
-pip install git+https://github.com/airspeed-velocity/asv.git
-```
-
-Then you need to set up a few environment variables:
-
-```shell
-export SETUPTOOLS_SCM_PRETEND_VERSION=0.0.1
-export PYARROW_BUNDLE_ARROW_CPP=1
+pip install git+https://github.com/pitrou/asv.git@customize_commands
 ```
 
 Now you should be ready to run `asv run` or whatever other command
 suits your needs.
+
+## Compatibility
+
+We only expect the benchmarking setup to work with Python 3.6 or later,
+on a Unix-like system.
diff --git a/python/asv-build.sh b/python/asv-build.sh
new file mode 100755
index 0000000000..31e56edcdb
--- /dev/null
+++ b/python/asv-build.sh
@@ -0,0 +1,53 @@
+#!/bin/sh
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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.
+
+set -e
+
+# ASV doesn't activate its conda environment for us
+source activate $ASV_ENV_PATH
+
+# Build Arrow C++ libraries
+export ARROW_BUILD_TOOLCHAIN=$CONDA_PREFIX
+export ARROW_HOME=$CONDA_PREFIX
+
+echo $CONDA_PREFIX
+
+pushd ../cpp
+mkdir -p build
+pushd build
+
+cmake -GNinja \
+      -DCMAKE_BUILD_TYPE=release \
+      -DCMAKE_INSTALL_PREFIX=$ARROW_HOME \
+      -DARROW_CXXFLAGS=$CXXFLAGS \
+      -DARROW_PYTHON=ON \
+      -DARROW_BUILD_TESTS=OFF \
+      ..
+cmake --build . --target install
+
+popd
+popd
+
+# Build pyarrow wrappers
+export SETUPTOOLS_SCM_PRETEND_VERSION=0.0.1
+export PYARROW_BUILD_TYPE=release
+
+python setup.py clean
+find pyarrow -name "*.so" -delete
+python setup.py develop
diff --git a/python/asv-install.sh b/python/asv-install.sh
new file mode 100644
index 0000000000..67d2c187d6
--- /dev/null
+++ b/python/asv-install.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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.
+
+# Deliberately empty, but exists so that we don't have to change
+# asv.conf.json if we need specific commands here.
diff --git a/python/asv-uninstall.sh b/python/asv-uninstall.sh
new file mode 100644
index 0000000000..67d2c187d6
--- /dev/null
+++ b/python/asv-uninstall.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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.
+
+# Deliberately empty, but exists so that we don't have to change
+# asv.conf.json if we need specific commands here.
diff --git a/python/asv.conf.json b/python/asv.conf.json
index 150153c802..98ee040193 100644
--- a/python/asv.conf.json
+++ b/python/asv.conf.json
@@ -35,6 +35,10 @@
     // of the repository.
     "repo_subdir": "python",
 
+    "build_command": ["/bin/bash", "asv-build.sh"],
+    "install_command": ["/bin/bash", "asv-install.sh"],
+    "uninstall_command": ["/bin/bash", "asv-uninstall.sh"],
+
     // List of branches to benchmark. If not provided, defaults to "master"
     // (for git) or "default" (for mercurial).
     // "branches": ["master"], // for git
@@ -78,11 +82,19 @@
     // },
     "matrix": {
         "boost-cpp": [],
+        "brotli": [],
         "cmake": [],
         "cython": [],
+        "flatbuffers": [],
+        "libprotobuf": [],
+        "lz4-c": [],
+        "ninja": [],
         "numpy": ["1.14"],
         "pandas": ["0.22"],
         "pip+setuptools_scm": [],
+        "rapidjson": [],
+        "snappy": [],
+        "zstd": [],
     },
 
     // Combinations of libraries/python versions can be excluded/included


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> [Python] ASV benchmark setup does not account for C++ library changing
> ----------------------------------------------------------------------
>
>                 Key: ARROW-2182
>                 URL: https://issues.apache.org/jira/browse/ARROW-2182
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: Python
>            Reporter: Wes McKinney
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 0.10.0
>
>
> See https://github.com/apache/arrow/blob/master/python/README-benchmarks.md
> Perhaps we could create a helper script that will run all the 
> currently-defined benchmarks for a specific commit, and ensure that we are 
> running against pristine, up-to-date release builds of Arrow (and any other 
> dependencies, like parquet-cpp) at that commit? 
> cc [~pitrou]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to