Skip to content

Commit

Permalink
ARROW-2461: [Python] Build manylinux2010 wheels
Browse files Browse the repository at this point in the history
  • Loading branch information
pitrou committed Jun 25, 2019
1 parent a91f78f commit bcd0761
Show file tree
Hide file tree
Showing 34 changed files with 1,483 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import pyarrow.parquet
import pyarrow.plasma
if sys.version_info.major > 2:
import pyarrow.flight
import pyarrow.gandiva
"

Expand Down
45 changes: 45 additions & 0 deletions dev/tasks/python-wheels/manylinux2010-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/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 -e

# Install built wheel
pip install -q /arrow/python/manylinux2010/dist/*.whl

# Runs tests on installed distribution from an empty directory
python --version

# Test optional dependencies
python -c "
import sys
import pyarrow
import pyarrow.orc
import pyarrow.parquet
import pyarrow.plasma
if sys.version_info.major > 2:
import pyarrow.flight
import pyarrow.gandiva
"

export ARROW_TEST_DATA=/arrow/testing/data

# Run pyarrow tests
pip install -q -r /arrow/python/requirements-test.txt
pytest -v --pyargs pyarrow
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ script:
# test on multiple distributions
{%- for image in test_docker_images %}
- docker run -it --shm-size 2G --volume $(pwd)/arrow:/arrow {{ image }}
/arrow/dev/tasks/python-wheels/linux-test.sh
/arrow/dev/tasks/python-wheels/manylinux1-test.sh
{%- endfor %}

# prepare for deployment
Expand Down
82 changes: 82 additions & 0 deletions dev/tasks/python-wheels/travis.manylinux2010.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# 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.

os: linux

services:
- docker

# Update docker to support newer docker-compose versions
addons:
apt:
packages:
- docker-ce

# don't build twice
if: tag IS blank

env:
global:
- PLAT=x86_64
- TRAVIS_TAG={{ task.tag }}

before_script:
- sudo pip install -U docker-compose

script:
- git clone --no-checkout {{ arrow.remote }} arrow
- git -C arrow fetch -t {{ arrow.remote }} {{ arrow.branch }}
- git -C arrow checkout {{ arrow.head }}
- mkdir -p dist

# build wheel
- pushd arrow

# Pull testing resources
- git submodule init
- git submodule update

# don't attempt to build it, because the base image by pypa is updated
# regularly and would cause undeterministic builds
- docker-compose pull python-manylinux2010
- docker-compose run
-e SETUPTOOLS_SCM_PRETEND_VERSION={{ arrow.no_rc_version }}
-e PYTHON_VERSION="{{ python_version }}"
-e UNICODE_WIDTH="{{ unicode_width }}"
python-manylinux2010
- popd

# test on multiple distributions
{%- for image in test_docker_images %}
- docker run -it --shm-size 2G --volume $(pwd)/arrow:/arrow {{ image }}
/arrow/dev/tasks/python-wheels/manylinux2010-test.sh
{%- endfor %}

# prepare for deployment
- sudo mv arrow/python/manylinux2010/dist/* dist/

deploy:
provider: releases
api_key: $CROSSBOW_GITHUB_TOKEN
file_glob: true
file: dist/*.whl
skip_cleanup: true
on:
tags: true

notifications:
email:
- {{ job.email }}
94 changes: 79 additions & 15 deletions dev/tasks/tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,16 @@ groups:
- conda-win-vs2015-py36
- conda-win-vs2015-py37
wheel:
- wheel-linux-cp27m
- wheel-linux-cp27mu
- wheel-linux-cp35m
- wheel-linux-cp36m
- wheel-linux-cp37m
- wheel-manylinux1-cp27m
- wheel-manylinux1-cp27mu
- wheel-manylinux1-cp35m
- wheel-manylinux1-cp36m
- wheel-manylinux1-cp37m
- wheel-manylinux2010-cp27m
- wheel-manylinux2010-cp27mu
- wheel-manylinux2010-cp35m
- wheel-manylinux2010-cp36m
- wheel-manylinux2010-cp37m
- wheel-osx-cp27m
- wheel-osx-cp35m
- wheel-osx-cp36m
Expand Down Expand Up @@ -151,21 +156,21 @@ tasks:

############################## Wheel Linux ##################################

wheel-linux-cp27m:
wheel-manylinux1-cp27m:
ci: travis
platform: linux
template: python-wheels/travis.linux.yml
template: python-wheels/travis.manylinux1.yml
params:
python_version: 2.7
unicode_width: 16
test_docker_images: []
artifacts:
- pyarrow-{no_rc_version}-cp27-cp27m-manylinux1_x86_64.whl

wheel-linux-cp27mu:
wheel-manylinux1-cp27mu:
ci: travis
platform: linux
template: python-wheels/travis.linux.yml
template: python-wheels/travis.manylinux1.yml
params:
python_version: 2.7
unicode_width: 32
Expand All @@ -174,10 +179,10 @@ tasks:
artifacts:
- pyarrow-{no_rc_version}-cp27-cp27mu-manylinux1_x86_64.whl

wheel-linux-cp35m:
wheel-manylinux1-cp35m:
ci: travis
platform: linux
template: python-wheels/travis.linux.yml
template: python-wheels/travis.manylinux1.yml
params:
python_version: 3.5
unicode_width: 16
Expand All @@ -186,10 +191,10 @@ tasks:
artifacts:
- pyarrow-{no_rc_version}-cp35-cp35m-manylinux1_x86_64.whl

wheel-linux-cp36m:
wheel-manylinux1-cp36m:
ci: travis
platform: linux
template: python-wheels/travis.linux.yml
template: python-wheels/travis.manylinux1.yml
params:
python_version: 3.6
unicode_width: 16
Expand All @@ -198,10 +203,10 @@ tasks:
artifacts:
- pyarrow-{no_rc_version}-cp36-cp36m-manylinux1_x86_64.whl

wheel-linux-cp37m:
wheel-manylinux1-cp37m:
ci: travis
platform: linux
template: python-wheels/travis.linux.yml
template: python-wheels/travis.manylinux1.yml
params:
python_version: 3.7
unicode_width: 16
Expand All @@ -210,6 +215,65 @@ tasks:
artifacts:
- pyarrow-{no_rc_version}-cp37-cp37m-manylinux1_x86_64.whl

wheel-manylinux2010-cp27m:
ci: travis
platform: linux
template: python-wheels/travis.manylinux2010.yml
params:
python_version: 2.7
unicode_width: 16
test_docker_images: []
artifacts:
- pyarrow-{no_rc_version}-cp27-cp27m-manylinux2010_x86_64.whl

wheel-manylinux2010-cp27mu:
ci: travis
platform: linux
template: python-wheels/travis.manylinux2010.yml
params:
python_version: 2.7
unicode_width: 32
test_docker_images:
- python:2.7-slim # debian ucs4
artifacts:
- pyarrow-{no_rc_version}-cp27-cp27mu-manylinux2010_x86_64.whl

wheel-manylinux2010-cp35m:
ci: travis
platform: linux
template: python-wheels/travis.manylinux2010.yml
params:
python_version: 3.5
unicode_width: 16
test_docker_images:
- python:3.5-slim
artifacts:
- pyarrow-{no_rc_version}-cp35-cp35m-manylinux2010_x86_64.whl

wheel-manylinux2010-cp36m:
ci: travis
platform: linux
template: python-wheels/travis.manylinux2010.yml
params:
python_version: 3.6
unicode_width: 16
test_docker_images:
- python:3.6-slim
artifacts:
- pyarrow-{no_rc_version}-cp36-cp36m-manylinux2010_x86_64.whl

wheel-manylinux2010-cp37m:
ci: travis
platform: linux
template: python-wheels/travis.manylinux2010.yml
params:
python_version: 3.7
unicode_width: 16
test_docker_images:
- python:3.7-slim
artifacts:
- pyarrow-{no_rc_version}-cp37-cp37m-manylinux2010_x86_64.whl

############################## Wheel OSX ####################################

wheel-osx-cp27m:
Expand Down
22 changes: 22 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,28 @@ services:
- ./python/manylinux1:/io:delegated
command: /io/build_arrow.sh

python-manylinux2010:
# Usage:
# either build:
# $ docker-compose build python-manylinux2010
# or pull:
# $ docker-compose pull python-manylinux2010
# an then run:
# $ docker-compose run -e PYTHON_VERSION=3.7 python-manylinux2010
image: quay.io/ursa-labs/arrow_manylinux2010_x86_64_base:latest
build:
context: python/manylinux2010
dockerfile: Dockerfile-x86_64_base
shm_size: 2G
environment:
PYARROW_PARALLEL: 3
PYTHON_VERSION: ${PYTHON_VERSION:-3.6}
UNICODE_WIDTH: ${UNICODE_WIDTH:-16}
volumes:
- .:/arrow:delegated
- ./python/manylinux2010:/io:delegated
command: /io/build_arrow.sh

######################### Integration Tests #################################

# impala:
Expand Down
4 changes: 3 additions & 1 deletion python/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ htmlcov
.asv
pyarrow/_table_api.h

# manylinux1 temporary files
# manylinux temporary files
manylinux1/arrow
nm_arrow.log
visible_symbols.log

# plasma store
pyarrow/plasma_store_server
Loading

0 comments on commit bcd0761

Please sign in to comment.