-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
242 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# | ||
# 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 | ||
|
||
# TODO; cut make since ninja handles | ||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
gcc-8 \ | ||
g++-8 \ | ||
vim \ | ||
git \ | ||
wget \ | ||
make \ | ||
ninja-build | ||
|
||
ENV CC=gcc-8 | ||
ENV CXX=g++-8 | ||
|
||
# Miniconda - Python 3.6, 64-bit, x86, latest | ||
RUN wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh \ | ||
-O mconda.sh | ||
RUN /bin/bash mconda.sh -b -p miniconda | ||
ENV PATH="/miniconda/bin:$PATH" | ||
|
||
# create conda env with deps | ||
RUN conda create -y -q -n pyarrow-dev \ | ||
python=3.6 numpy six setuptools cython pandas pytest \ | ||
cmake flatbuffers rapidjson boost-cpp thrift-cpp snappy zlib \ | ||
gflags brotli jemalloc lz4-c zstd -c conda-forge \ | ||
&& conda clean --all | ||
|
||
ADD script ./script | ||
RUN chmod u=rwx ./script/*.sh | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
<!--- | ||
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. | ||
--> | ||
|
||
# Apache Arrow development container | ||
Container image to simplify Arrow development by unifying dependencies. | ||
Resolves [ARROW-2486](https://issues.apache.org/jira/browse/ARROW-2486). | ||
|
||
## Get started | ||
|
||
### [Install Docker](https://docs.docker.com/install/) | ||
|
||
### Acquire image | ||
|
||
``` | ||
$ docker pull quiltdata/arrow | ||
``` | ||
|
||
### Populate host directory | ||
Keep git repos and subsequent build products in a persistent local | ||
directory, `/io`. | ||
|
||
``` | ||
$ mkdir -p io/arrow | ||
$ git clone https://github.com/apache/arrow.git io/arrow | ||
$ mkdir -p io/parquet-cpp | ||
$ git clone https://github.com/apache/parquet-cpp.git io/parquet-cpp | ||
``` | ||
Alternatively, if you wish to use existing git repos, you can nest them | ||
under `/io`. | ||
|
||
### Run container, mount `/io` as volume | ||
|
||
``` | ||
$ docker run \ | ||
--shm-size=2g \ | ||
-v /YOUR/PATH/TO/io:/io \ | ||
-it quiltdata/arrow | ||
``` | ||
|
||
### Use container | ||
Run scripts to build executables. | ||
|
||
See also [Arrow dev docs](https://arrow.apache.org/docs/python/development.html). | ||
|
||
``` | ||
$ source script/env.sh | ||
$ script/arrow-build.sh | ||
$ script/parquet-build.sh | ||
$ script/pyarrow-build.sh | ||
# run tests | ||
$ cd /io/arrow/python | ||
$ py.test pyarrow | ||
``` | ||
|
||
## Build container | ||
|
||
``` | ||
$ docker build -it USERNAME/arrow . | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/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. | ||
# | ||
|
||
# See also https://arrow.apache.org/docs/python/development.html | ||
mkdir -p /io/arrow/cpp/build | ||
pushd /io/arrow/cpp/build | ||
cmake -DCMAKE_BUILD_TYPE=$ARROW_BUILD_TYPE \ | ||
-DCMAKE_INSTALL_PREFIX=$ARROW_HOME \ | ||
-DARROW_PYTHON=on \ | ||
-DARROW_PLASMA=on \ | ||
-DARROW_BUILD_TESTS=OFF \ | ||
-DCMAKE_CXX_FLAGS=$CXXFLAGS \ | ||
-GNinja \ | ||
.. | ||
ninja | ||
ninja install | ||
popd | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/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. | ||
# | ||
|
||
# See also https://arrow.apache.org/docs/python/development.html#build-and-test | ||
source activate pyarrow-dev | ||
export ARROW_BUILD_TYPE=release | ||
export ARROW_BUILD_TOOLCHAIN=$CONDA_PREFIX | ||
export PARQUET_BUILD_TOOLCHAIN=$CONDA_PREFIX | ||
export ARROW_HOME=$CONDA_PREFIX | ||
export PARQUET_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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/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. | ||
# | ||
|
||
# See also https://arrow.apache.org/docs/python/development.html#build-and-test | ||
mkdir -p /io/parquet-cpp/build | ||
pushd /io/parquet-cpp/build | ||
cmake -DCMAKE_BUILD_TYPE=$ARROW_BUILD_TYPE \ | ||
-DCMAKE_INSTALL_PREFIX=$PARQUET_HOME \ | ||
-DPARQUET_BUILD_BENCHMARKS=off \ | ||
-DPARQUET_BUILD_EXECUTABLES=off \ | ||
-DPARQUET_BUILD_TESTS=off \ | ||
-DCMAKE_CXX_FLAGS=$CXXFLAGS \ | ||
-GNinja \ | ||
.. | ||
ninja | ||
ninja install | ||
popd | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/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. | ||
# | ||
|
||
# See also https://arrow.apache.org/docs/python/development.html#build-and-test | ||
cd /io/arrow/python | ||
python setup.py build_ext --build-type=$ARROW_BUILD_TYPE \ | ||
--with-parquet --with-plasma --inplace |