Skip to content

Apache DataFusion SQL Query Engine

ARROW-5803: [CI] Dockerize C++ with clang 7 Travis CI

François Saint-Jacques22b1d2a93748
diff --git a/.travis.yml b/.travis.yml
index 793e86aa78..49f9ea8635 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -35,16 +35,7 @@ git:
depth: 250
before_install:
- # Common pre-install steps for all builds
- - eval "${MATRIX_EVAL}"
- - ulimit -c unlimited -S
- - |
- if [ $TRAVIS_OS_NAME == "linux" ]; then
- sudo bash -c "echo -e 'Acquire::Retries 10; Acquire::http::Timeout \"20\";' > /etc/apt/apt.conf.d/99-travis-retry"
- sudo apt-get update -qq
- fi
- - eval `python $TRAVIS_BUILD_DIR/ci/detect-changes.py`
- - if [ $TRAVIS_OS_NAME == "linux" ]; then ccache -s; fi
+ - source ci/travis/before-install.sh
matrix:
fast_finish: true
@@ -62,28 +53,13 @@ matrix:
- $TRAVIS_BUILD_DIR/ci/travis_release_test.sh
- name: "C++ unit tests w/ clang 7.0, system packages"
os: linux
- env:
- - ARROW_TRAVIS_USE_SYSTEM=1
- - ARROW_TRAVIS_PLASMA=1
- - ARROW_TRAVIS_ORC=1
- - ARROW_TRAVIS_PARQUET=1
- - ARROW_TRAVIS_GANDIVA=1
- - ARROW_TRAVIS_VERBOSE=1
- - ARROW_TRAVIS_USE_SYSTEM_JAVA=1
- - ARROW_BUILD_WARNING_LEVEL=CHECKIN
- - ARROW_USE_ASAN=1
- - ARROW_USE_UBSAN=1
- - CC="clang-7"
- - CXX="clang++-7"
+ language: cpp
before_script:
- if [ $ARROW_CI_CPP_AFFECTED != "1" ]; then exit; fi
- - $TRAVIS_BUILD_DIR/ci/travis_install_clang_tools.sh
- - $TRAVIS_BUILD_DIR/ci/travis_install_linux.sh
- # If either C++ or Python changed, we must install the C++ libraries
- git submodule update --init
- - $TRAVIS_BUILD_DIR/ci/travis_before_script_cpp.sh
+ - docker-compose build --pull cpp-system-deps
script:
- - $TRAVIS_BUILD_DIR/ci/travis_script_cpp.sh || travis_terminate 1
+ - docker-compose run cpp-system-deps
# Separating Valgrind and C++ coverage makes individual jobs shorter
- name: "C++ unit tests w/ conda-forge toolchain, coverage"
compiler: gcc
@@ -204,7 +180,7 @@ matrix:
os: linux
before_script:
- if [ $ARROW_CI_JAVA_AFFECTED != "1" ]; then exit; fi
- - docker-compose pull java-all-jdks
+ - docker-compose build --pull java-all-jdks
script:
- docker-compose run java-all-jdks
- name: "Integration w/ OpenJDK 8, conda-forge toolchain"
@@ -365,23 +341,10 @@ matrix:
- Rscript ../ci/travis_upload_r_coverage.R
after_failure:
-- |
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then
- COREFILE=$(find /cores -maxdepth 1 -type f -name "core.*" | head -n 1)
- if [[ -f "$COREFILE" ]]; then
- lldb -c "$COREFILE" --batch --one-line "thread backtrace all -e true"
- fi
- ls -la ~/Library/Logs/DiagnosticReports/
- cat ~/Library/Logs/DiagnosticReports/*.crash
- else
- COREFILE=$(find . -maxdepth 2 -name "core*" | head -n 1)
- if [[ -f "$COREFILE" ]]; then
- gdb -c "$COREFILE" example -ex "thread apply all bt" -ex "set pagination 0" -batch
- fi
- fi
+ - source ci/travis/after-failure.sh
after_script:
- - if [ $TRAVIS_OS_NAME == "linux" ]; then ccache -s; fi
+ - source ci/travis/after-script.sh
env:
global:
diff --git a/ci/docker_build_cpp.sh b/ci/docker_build_cpp.sh
index 77268bc5a7..307b4cdc14 100755
--- a/ci/docker_build_cpp.sh
+++ b/ci/docker_build_cpp.sh
@@ -16,7 +16,7 @@
# specific language governing permissions and limitations
# under the License.
-set -e
+set -ex
source_dir=${1:-/arrow/cpp}
build_dir=${2:-/build/cpp}
@@ -29,14 +29,22 @@ mkdir -p ${build_dir}
pushd ${build_dir}
cmake -GNinja \
- -DARROW_DEPENDENCY_SOURCE=${ARROW_DEPENDENCY_SOURCE:-AUTO} \
- -DARROW_VERBOSE_THIRDPARTY_BUILD=ON \
- -DCMAKE_BUILD_TYPE=${ARROW_BUILD_TYPE:-debug} \
-DCMAKE_INSTALL_PREFIX=${install_dir} \
-DCMAKE_INSTALL_LIBDIR=lib \
- -DARROW_WITH_BZ2=${ARROW_WITH_BZ2:-ON} \
- -DARROW_WITH_ZSTD=${ARROW_WITH_ZSTD:-ON} \
+ -DCMAKE_BUILD_TYPE=${ARROW_BUILD_TYPE:-debug} \
+ -DCMAKE_CXX_FLAGS=${CXXFLAGS:-} \
+ -DARROW_DEPENDENCY_SOURCE=${ARROW_DEPENDENCY_SOURCE:-AUTO} \
+ -DARROW_VERBOSE_THIRDPARTY_BUILD=${ARROW_VERBOSE_THIRDPARTY_BUILD:-ON} \
+ -DARROW_BUILD_WARNING_LEVEL=${DARROW_BUILD_WARNING_LEVEL:-CHECKIN} \
+ -DARROW_BUILD_TESTS=${ARROW_BUILD_TESTS:-ON} \
-DARROW_BUILD_BENCHMARKS=${ARROW_BUILD_BENCHMARKS:-ON} \
+ -DARROW_BUILD_UTILITIES=${ARROW_BUILD_UTILITIES:-ON} \
+ -DARROW_BUILD_EXAMPLES=${ARROW_BUILD_EXAMPLES:-ON} \
+ -DARROW_BUILD_SHARED=${ARROW_BUILD_SHARED:-ON} \
+ -DARROW_BUILD_STATIC=${ARROW_BUILD_STATIC:-ON} \
+ -DARROW_NO_DEPRECATED_API=${ARROW_NO_DEPRECATED_API:-OFF} \
+ -DARROW_USE_ASAN=${ARROW_USE_ASAN:-OFF} \
+ -DARROW_USE_UBSAN=${ARROW_USE_UBSAN:-OFF} \
-DARROW_FLIGHT=${ARROW_FLIGHT:-ON} \
-DARROW_ORC=${ARROW_ORC:-ON} \
-DARROW_PLASMA=${ARROW_PLASMA:-ON} \
@@ -45,21 +53,19 @@ cmake -GNinja \
-DARROW_PYTHON=${ARROW_PYTHON:-OFF} \
-DARROW_GANDIVA=${ARROW_GANDIVA:-OFF} \
-DARROW_GANDIVA_JAVA=${ARROW_GANDIVA_JAVA:-OFF} \
- -DARROW_BUILD_TESTS=${ARROW_BUILD_TESTS:-OFF} \
- -DARROW_BUILD_UTILITIES=${ARROW_BUILD_UTILITIES:-ON} \
+ -DARROW_WITH_BZ2=${ARROW_WITH_BZ2:-ON} \
+ -DARROW_WITH_ZSTD=${ARROW_WITH_ZSTD:-ON} \
-DARROW_INSTALL_NAME_RPATH=${ARROW_INSTALL_NAME_RPATH:-ON} \
-DARROW_EXTRA_ERROR_CONTEXT=ON \
- -DARROW_BUILD_SHARED=${ARROW_BUILD_SHARED:-ON} \
- -DARROW_BUILD_STATIC=${ARROW_BUILD_STATIC:-ON} \
-DARROW_TEST_LINKAGE=${ARROW_TEST_LINKAGE:-shared} \
-DPARQUET_REQUIRE_ENCRYPTION=${ARROW_WITH_OPENSSL:-ON} \
- -DCMAKE_CXX_FLAGS=$CXXFLAGS \
-DBOOST_SOURCE=${ARROW_BOOST_SOURCE:-AUTO} \
-Duriparser_SOURCE=AUTO \
-DARROW_FUZZING=${ARROW_FUZZING:-OFF} \
-DARROW_USE_ASAN=${ARROW_USE_ASAN:-OFF} \
${CMAKE_ARGS} \
${source_dir}
+
ninja
ninja install
diff --git a/ci/travis/after-failure.sh b/ci/travis/after-failure.sh
new file mode 100755
index 0000000000..35b798fb03
--- /dev/null
+++ b/ci/travis/after-failure.sh
@@ -0,0 +1,35 @@
+#!/bin/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.
+
+set -ex
+
+if [[ "${TRAVIS_OS_NAME}" = "osx" ]]; then
+ COREFILE=$(find /cores -maxdepth 1 -type f -name "core.*" | head -n 1)
+ if [[ -f "$COREFILE" ]]; then
+ lldb -c "$COREFILE" --batch --one-line "thread backtrace all -e true"
+ fi
+ ls -la ~/Library/Logs/DiagnosticReports/
+ cat ~/Library/Logs/DiagnosticReports/*.crash
+else
+ COREFILE=$(find . -maxdepth 2 -name "core*" | head -n 1)
+ if [[ -f "$COREFILE" ]]; then
+ gdb -c "$COREFILE" example -ex "thread apply all bt" -ex "set pagination 0" -batch
+ fi
+fi
+
+set +ex
diff --git a/ci/travis/after-script.sh b/ci/travis/after-script.sh
new file mode 100755
index 0000000000..f323f3cf20
--- /dev/null
+++ b/ci/travis/after-script.sh
@@ -0,0 +1,25 @@
+#!/bin/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.
+
+set -ex
+
+if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
+ ccache --show-stats
+fi
+
+set +ex
diff --git a/ci/travis/before-install.sh b/ci/travis/before-install.sh
new file mode 100755
index 0000000000..02dc971041
--- /dev/null
+++ b/ci/travis/before-install.sh
@@ -0,0 +1,35 @@
+#!/bin/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.
+
+set -ex
+
+eval "${MATRIX_EVAL}"
+
+# Enables core files
+ulimit -c unlimited -S
+
+if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
+ echo -e 'Acquire::Retries 10; Acquire::http::Timeout \"20\";' | \
+ sudo tee /etc/apt/apt.conf.d/99-travis-retry
+ sudo apt-get update -qq
+ ccache --show-stats
+fi
+
+eval "$(python ${TRAVIS_BUILD_DIR}/ci/detect-changes.py)"
+
+set +ex
diff --git a/docker-compose.yml b/docker-compose.yml
index 8d197c1eeb..3b50cd167e 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -114,10 +114,31 @@ services:
build:
context: .
dockerfile: cpp/Dockerfile
- environment:
- PARQUET_TEST_DATA: /arrow/cpp/submodules/parquet-testing/data
volumes: *ubuntu-volumes
+ cpp-system-deps:
+ # Usage:
+ # docker-compose build cpp-system-deps
+ # docker-compose run cpp-system-deps
+ image: ursalab/arrow:cpp-system-deps
+ shm_size: 2G
+ cap_add:
+ # LeakSanitizer and gdb requires ptrace(2)
+ - SYS_PTRACE
+ build:
+ context: .
+ dockerfile: cpp/Dockerfile.ubuntu-bionic
+ args:
+ LLVM_VERSION: 7
+ environment:
+ ARROW_FLIGHT: "ON"
+ ARROW_USE_ASAN: "ON"
+ ARROW_USE_UBSAN: "ON"
+ volumes:
+ - .:/arrow:delegated
+ - ubuntu-cache:/build:delegated
+ - ${HOME}/.ccache:/build/ccache:cached
+
cpp-release:
# Usage:
# docker-compose build cpp