Skip to content

ARROW-3180: [C++] Add docker-compose setup to simulate Travis CI run locally #2572

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

Closed
wants to merge 19 commits into from
Closed
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
85 changes: 85 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# 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.

.git

# IDE
.vscode

# c_glib
c_glib/build
c_glib/autom4te.cache
c_glib/m4
c_glib/*/*.o
c_glib/*/*.lo
c_glib/*/*.la
c_glib/*/.deps
c_glib/*/.libs

# cpp
cpp/.idea
cpp/build
cpp/*-build
cpp/Testing

# python
python/build
python/dist
python/*.egg-info
python/*.egg
python/*.pyc
python/doc/_build
__pycache__/
*/__pycache__/
*/*/__pycache__/
*/*/*/__pycache__/
*.py[cod]
*/*.py[cod]
*/*/*.py[cod]
*/*/*/*.py[cod]
*.so
*/*.so
*/*/*.so
*/*/*/*.so
*.dylib
*/*.dylib
*/*/*.dylib
*/*/*/*.dylib

# JS
js/.npm
js/node_modules
js/jspm_packages

js/logs
js/*.log
js/.esm-cache
js/npm-debug.log*
js/yarn-debug.log*
js/yarn-error.log*

js/.grunt
js/bower_components
js/.lock-wscript
js/build/Release
js/dist
js/targets
js/test/data
js/test/__snapshots__

# Rust
rust/target
72 changes: 72 additions & 0 deletions c_glib/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# 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 ubuntu:18.04

ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get -q update && \
apt-get -q install --no-install-recommends -y \
gcc \
g++ \
git \
wget \
tzdata \
ruby-dev \
pkg-config \
ninja-build \
autoconf-archive \
gtk-doc-tools \
libgirepository1.0-dev

ENV CC=gcc \
CXX=g++ \
PATH=/opt/conda/bin:$PATH \
CONDA_PREFIX=/opt/conda

# install dependencies
ADD ci/docker_install_conda.sh \
ci/conda_env_cpp.yml \
/arrow/ci/
ADD c_glib/Gemfile /arrow/c_glib/
RUN arrow/ci/docker_install_conda.sh && \
conda install -c conda-forge \
--file arrow/ci/conda_env_cpp.yml \
meson=0.47.1 && \
conda clean --all && \
gem install bundler && \
bundle install --gemfile arrow/c_glib/Gemfile

# build cpp
ENV ARROW_BUILD_TESTS=OFF \
ARROW_BUILD_UTILITIES=OFF \
ARROW_INSTALL_NAME_RPATH=OFF
ADD ci/docker_build_cpp.sh /arrow/ci/
ADD cpp /arrow/cpp
ADD format /arrow/format
ADD java/pom.xml /arrow/java/pom.xml
RUN arrow/ci/docker_build_cpp.sh

# build c_glib
ENV LD_LIBRARY_PATH="${CONDA_PREFIX}/lib" \
PKG_CONFIG_PATH="${CONDA_PREFIX}/lib/pkgconfig" \
GI_TYPELIB_PATH="${CONDA_PREFIX}/lib/girepository-1.0"
ADD ci/docker_build_c_glib.sh /arrow/ci/
ADD c_glib /arrow/c_glib
RUN arrow/ci/docker_build_c_glib.sh

WORKDIR arrow/c_glib
CMD test/run-test.rb
2 changes: 1 addition & 1 deletion c_glib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ based bindings. Here are languages that support GObject Introspection:
* Ruby: [red-arrow gem](https://rubygems.org/gems/red-arrow) should be used.
* Examples: https://github.com/red-data-tools/red-arrow/tree/master/example

* Python: [PyGObject](https://wiki.gnome.org/Projects/PyGObject) should be used. (Note that you should use PyArrow than Arrow GLib.)
* Python: [PyGObject](https://wiki.gnome.org/Projects/PyGObject) should be used. (Note that you should prefer PyArrow over Arrow GLib.)

* Lua: [LGI](https://github.com/pavouk/lgi) should be used.
* Examples: `example/lua/` directory.
Expand Down
33 changes: 33 additions & 0 deletions ci/conda_env_cpp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# 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.

boost-cpp
brotli
cmake
flatbuffers
gflags
glog
gtest
jemalloc
libprotobuf
lz4-c
python
rapidjson
snappy
thrift-cpp
zlib
zstd
26 changes: 26 additions & 0 deletions ci/conda_env_python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# 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.

cython
ipython
nomkl
numpy
pandas
pytest
python
setuptools
setuptools_scm
37 changes: 37 additions & 0 deletions ci/docker_build_c_glib.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/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.

set -e

export ARROW_C_GLIB_HOME=$CONDA_PREFIX

export CFLAGS="-DARROW_NO_DEPRECATED_API"
export CXXFLAGS="-DARROW_NO_DEPRECATED_API -D_GLIBCXX_USE_CXX11_ABI=0"

pushd arrow/c_glib
mkdir build

# Build with Meson
meson build --prefix=$ARROW_C_GLIB_HOME --libdir=lib

pushd build
ninja
ninja install
popd
popd
49 changes: 49 additions & 0 deletions ci/docker_build_cpp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/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.

set -e

# Arrow specific environment variables
export ARROW_BUILD_TOOLCHAIN=$CONDA_PREFIX
export ARROW_HOME=$CONDA_PREFIX
export PARQUET_HOME=$CONDA_PREFIX

# https://arrow.apache.org/docs/python/development.html#known-issues
export CXXFLAGS="-D_GLIBCXX_USE_CXX11_ABI=0"

mkdir -p arrow/cpp/build
pushd arrow/cpp/build

cmake -GNinja \
-DCMAKE_BUILD_TYPE=${ARROW_BUILD_TYPE:-debug} \
-DCMAKE_INSTALL_PREFIX=$ARROW_HOME \
-DARROW_ORC=ON \
-DARROW_PLASMA=ON \
-DARROW_PARQUET=ON \
-DARROW_HDFS=${ARROW_HDFS:-OFF} \
-DARROW_PYTHON=${ARROW_PYTHON:-OFF} \
-DARROW_BUILD_TESTS=${ARROW_BUILD_TESTS:-OFF} \
-DARROW_BUILD_UTILITIES=${ARROW_BUILD_UTILITIES:-ON} \
-DARROW_INSTALL_NAME_RPATH=${ARROW_INSTALL_NAME_RPATH:-ON} \
-DARROW_EXTRA_ERROR_CONTEXT=ON \
-DCMAKE_CXX_FLAGS=$CXXFLAGS \
..
ninja
ninja install

popd
38 changes: 38 additions & 0 deletions ci/docker_build_python.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/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.

set -e

export ARROW_BUILD_TOOLCHAIN=$CONDA_PREFIX
export ARROW_HOME=$CONDA_PREFIX

# For newer GCC per https://arrow.apache.org/docs/python/development.html#known-issues
export CXXFLAGS="-D_GLIBCXX_USE_CXX11_ABI=0"
export PYARROW_CXXFLAGS=$CXXFLAGS
export PYARROW_CMAKE_GENERATOR=Ninja

# Build pyarrow
pushd arrow/python

python setup.py build_ext \
--build-type=${ARROW_BUILD_TYPE:-debug} \
--with-parquet \
--with-plasma \
--inplace

popd
29 changes: 29 additions & 0 deletions ci/docker_install_conda.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/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

wget --quiet https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
bash miniconda.sh -b -q -p ${CONDA_PREFIX:=/opt/conda}
rm miniconda.sh

ln -s ${CONDA_PREFIX}/etc/profile.d/conda.sh /etc/profile.d/conda.sh
echo ". ${CONDA_PREFIX}/etc/profile.d/conda.sh" >> ~/.bashrc
echo "conda activate base" >> ~/.bashrc
6 changes: 0 additions & 6 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -343,12 +343,6 @@ if (NOT ARROW_FUZZING)
set(NO_FUZZING 1)
endif()

if(ARROW_HDFS)
set(ARROW_BOOST_HEADER_ONLY 0)
else()
set(ARROW_BOOST_HEADER_ONLY 1)
endif()

if (ARROW_TENSORFLOW)
# TensorFlow uses the old GLIBCXX ABI, so we have to use it too
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_USE_CXX11_ABI=0")
Expand Down
Loading