This is an automated email from the ASF dual-hosted git repository.

wesm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new 62b9eb2  ARROW-1579: [Java] Adding containerized Spark Integration 
tests
62b9eb2 is described below

commit 62b9eb29df69456778f339fb00702bc6c55e1394
Author: Bryan Cutler <[email protected]>
AuthorDate: Sat Feb 17 11:43:11 2018 -0500

    ARROW-1579: [Java] Adding containerized Spark Integration tests
    
    This adds configuration files for running containerized integration tests 
with Spark for Java and Python.  The image is based off of maven with openJDK-8 
and will include a copy of Arrow when built on the parent directory to 
ARROW_HOME.  Running the container will do the following:
    
    1) Install Arrow Java artifacts to m2 repo in container
    2) Checkout current Spark master branch
    3) Update Spark POM to use the installed version of Arrow and package
    4) Run Arrow related Java/Scala Spark tests
    5) Run pyarrow related Python Spark tests
    
    Successful completion of the running container will indicate that there are 
no breaking changes between current Spark code and the Arrow code
    
    Author: Bryan Cutler <[email protected]>
    
    Closes #1319 from BryanCutler/docker-spark-integration-ARROW-1579 and 
squashes the following commits:
    
    3f9f483d [Bryan Cutler] now building with ARROW_BUILD_TOOLCHAIN set to 
conda env
    f962e387 [Bryan Cutler] Revert "added fix for using setuptools_scm to get 
version outside of arrow python dir"
    b2182d31 [Bryan Cutler] docker container now running and passing all tests
    3305a352 [Bryan Cutler] added fix for using setuptools_scm to get version 
outside of arrow python dir
    95eb22a5 [Bryan Cutler] running python tests now and building pyarrow, not 
yet passing pyspark tests
    e38d43db [Bryan Cutler] using build/mvn script for spark builds
    b04b0e57 [Bryan Cutler] docker running Scala Arrow tests
    09c961ee [Bryan Cutler] added initial docker files
---
 dev/docker-compose.yml                     |  5 ++
 dev/spark_integration/Dockerfile           | 70 +++++++++++++++++++++++
 dev/spark_integration/spark_integration.sh | 92 ++++++++++++++++++++++++++++++
 3 files changed, 167 insertions(+)

diff --git a/dev/docker-compose.yml b/dev/docker-compose.yml
index a73fd1b..b1e593c 100644
--- a/dev/docker-compose.yml
+++ b/dev/docker-compose.yml
@@ -33,3 +33,8 @@ services:
       context: dask_integration
     volumes:
      - ../..:/apache-arrow
+  spark_integration:
+    build: 
+      context: spark_integration
+    volumes:
+     - ../..:/apache-arrow
diff --git a/dev/spark_integration/Dockerfile b/dev/spark_integration/Dockerfile
new file mode 100644
index 0000000..d1b3cf8
--- /dev/null
+++ b/dev/spark_integration/Dockerfile
@@ -0,0 +1,70 @@
+#
+# 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.
+#
+FROM maven:3.5.2-jdk-8-slim
+
+# Basic OS utilities
+RUN apt-get update && apt-get install -y \
+        wget \
+        git build-essential \
+        software-properties-common
+
+# This will install conda in /home/ubuntu/miniconda
+RUN wget -O /tmp/miniconda.sh \
+    https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
+    bash /tmp/miniconda.sh -b -p /home/ubuntu/miniconda && \
+    rm /tmp/miniconda.sh
+
+# Python dependencies
+RUN apt-get install -y \
+        pkg-config
+
+# Create Conda environment
+ENV PATH="/home/ubuntu/miniconda/bin:${PATH}"
+RUN conda create -y -q -n pyarrow-dev \
+        # Python
+        python=2.7 \
+        numpy \
+        pandas \
+        pytest \
+        cython \
+        ipython \
+        matplotlib \
+        six \
+        setuptools \
+        setuptools_scm \
+        # C++
+        boost-cpp \
+        cmake \
+        flatbuffers \
+        rapidjson \
+        thrift-cpp \
+        snappy \
+        zlib \
+        gflags \
+        brotli \
+        jemalloc \
+        lz4-c \
+        zstd \
+        -c conda-forge
+
+ADD . /apache-arrow
+WORKDIR /apache-arrow
+
+CMD arrow/dev/spark_integration/spark_integration.sh
+
+# BUILD: $ docker build -f arrow/dev/spark_integration/Dockerfile -t 
spark-arrow .
+# RUN:   $ docker run -v $HOME/.m2:/root/.m2 spark-arrow
diff --git a/dev/spark_integration/spark_integration.sh 
b/dev/spark_integration/spark_integration.sh
new file mode 100755
index 0000000..8ca4dc3
--- /dev/null
+++ b/dev/spark_integration/spark_integration.sh
@@ -0,0 +1,92 @@
+#!/usr/bin/env bash
+#
+# 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.
+#
+
+# Exit on any error
+set -e
+
+# Set up environment and working directory
+cd /apache-arrow
+
+# Activate our pyarrow-dev conda env
+source activate pyarrow-dev
+
+export ARROW_HOME=$(pwd)/arrow
+export ARROW_BUILD_TYPE=release
+export ARROW_BUILD_TOOLCHAIN=$CONDA_PREFIX
+export LD_LIBRARY_PATH=${ARROW_HOME}/lib:${LD_LIBRARY_PATH}
+export MAVEN_OPTS="-Xmx2g -XX:ReservedCodeCacheSize=512m"
+
+# Build Arrow C++
+pushd arrow/cpp
+rm -rf build/*
+mkdir -p build
+cd build/
+cmake -DCMAKE_CXX_FLAGS="-D_GLIBCXX_USE_CXX11_ABI=0" -DARROW_PYTHON=on 
-DARROW_HDFS=on -DCMAKE_BUILD_TYPE=$ARROW_BUILD_TYPE 
-DCMAKE_INSTALL_PREFIX=$ARROW_HOME ..
+make -j4
+make install
+popd
+
+# Build pyarrow and install inplace
+export PYARROW_CXXFLAGS="-D_GLIBCXX_USE_CXX11_ABI=0"
+pushd arrow/python
+python setup.py clean
+python setup.py build_ext --build-type=$ARROW_BUILD_TYPE install
+popd
+
+# Install Arrow to local maven repo and get the version
+pushd arrow/java
+echo "Building and installing Arrow Java"
+mvn -DskipTests -Drat.skip=true clean install
+ARROW_VERSION=`mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate 
-Dexpression=project.version | sed -n -e '/^\[.*\]/ !{ /^[0-9]/ { p; q } }'`
+echo "Using Arrow version $ARROW_VERSION"
+popd
+
+# Build Spark with Arrow
+SPARK_REPO=git://git.apache.org/spark.git
+SPARK_BRANCH=master
+
+# Get the Spark repo if not in image already
+if [ ! -d "$(pwd)/spark" ]; then
+    export GIT_COMMITTER_NAME="Nobody"
+    export GIT_COMMITTER_EMAIL="[email protected]"
+    git clone "$SPARK_REPO"
+fi
+
+pushd spark
+
+# Make sure branch has no modifications
+git checkout "$SPARK_BRANCH"
+git reset --hard HEAD
+
+# Update Spark pom with the Arrow version just installed and build Spark, need 
package phase for pyspark
+sed -i -e 
"s/\(.*<arrow.version>\).*\(<\/arrow.version>\)/\1$ARROW_VERSION\2/g" ./pom.xml
+echo "Building Spark with Arrow $ARROW_VERSION"
+build/mvn -DskipTests clean package
+
+# Run Arrow related Scala tests only, NOTE: -Dtest=_NonExist_ is to enable 
surefire test discovery without running any tests so that Scalatest can run
+SPARK_SCALA_TESTS="org.apache.spark.sql.execution.arrow,org.apache.spark.sql.execution.vectorized.ColumnarBatchSuite,org.apache.spark.sql.execution.vectorized.ArrowColumnVectorSuite"
+echo "Testing Spark: $SPARK_SCALA_TESTS"
+# TODO: should be able to only build spark-sql tests with adding "-pl 
sql/core" but not currently working
+build/mvn -Dtest=none -DwildcardSuites="$SPARK_SCALA_TESTS" test
+
+# Run pyarrow related Python tests only
+SPARK_PYTHON_TESTS="ArrowTests PandasUDFTests ScalarPandasUDFTests 
GroupedMapPandasUDFTests GroupedAggPandasUDFTests"
+echo "Testing PySpark: $SPARK_PYTHON_TESTS"
+SPARK_TESTING=1 bin/pyspark pyspark.sql.tests $SPARK_PYTHON_TESTS 
+popd
+

-- 
To stop receiving notification emails like this one, please contact
[email protected].

Reply via email to