From 0df1b6a984799e65e183ad965d0f797299ae492e Mon Sep 17 00:00:00 2001 From: Antoine Lambert Date: Wed, 26 Sep 2018 23:40:30 +0200 Subject: [PATCH] travis.yml: Add job to build tulip-python wheel on manylinux1 --- .travis.yml | 26 ++++++++++++++++ bundlers/linux/tulip_python_wheels_build.sh | 34 +++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 bundlers/linux/tulip_python_wheels_build.sh diff --git a/.travis.yml b/.travis.yml index 02c7de0862..3150c9043f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,6 +21,32 @@ notifications: # define build jobs jobs: include: + #============================================================================================================================================================== + # Tulip-Python wheels build on manylinux1 + - stage: Tulip-Python wheels build (CentOS 5.11 manylinux1) + os: linux + dist: trusty + cache: + directories: + - $HOME/ccache + + sudo: required + env: + - ARCH=x86_64 + - DOCKER_IMAGE=quay.io/pypa/manylinux1_x86_64 + + services: + - docker + + before_install: + - echo 'DOCKER_OPTS="-H tcp://127.0.0.1:2375 -H unix:///var/run/docker.sock -s devicemapper"' | sudo tee /etc/default/docker > /dev/null + - sudo service docker restart + - sleep 5 + - sudo docker pull ${DOCKER_IMAGE} + - sudo docker create -v $HOME/ccache:/ccache --name ccache ${DOCKER_IMAGE} + + script: + - sudo docker run --rm=true -e CCACHE_DIR=/ccache --volumes-from ccache --cap-add SYS_ADMIN -v `pwd`:/tulip:rw ${DOCKER_IMAGE} /bin/bash -c "bash -xe /tulip/bundlers/linux/tulip_python_wheels_build.sh" #============================================================================================================================================================== # Tulip core build stage on Linux - stage: Tulip core build (Linux) diff --git a/bundlers/linux/tulip_python_wheels_build.sh b/bundlers/linux/tulip_python_wheels_build.sh new file mode 100644 index 0000000000..f7f7276f66 --- /dev/null +++ b/bundlers/linux/tulip_python_wheels_build.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +# This script is only intended to be run in the pypa/manylinux1 +# docker image based on Centos 5.11 + +cd + +# install tulip-python wheel deps +yum -y install zlib-devel qhull-devel ccache + +# we need at least CMake 2.8.12 in order to build tulip-python wheel +# so let's grab it, compile it and install it +curl -LO https://cmake.org/files/v2.8/cmake-2.8.12.tar.gz +tar -xvzf cmake-2.8.12.tar.gz +cd cmake-2.8.12 +./bootstrap --enable-ccache +make -j4 +make -j4 install + +cd + +mkdir tulip_build && cd tulip_build +# iterate on available Python versions +for PYTHON_BIN_PATH in /opt/python/cp*/bin +do + # configure and build tulip-python with specific Python version + cmake -DTULIP_USE_CCACHE=ON -DTULIP_ACTIVATE_PYTHON_WHEEL_TARGET=ON -DPYTHON_EXECUTABLE=$PYTHON_BIN_PATH/python -DCMAKE_BUILD_TYPE=Release /tulip + make -j4 wheel + # install and check that the produced module can be successfully imported + cd ./library/tulip-python/bindings/tulip-core/tulip_module/dist + $PYTHON_BIN_PATH/pip install $(ls -t | head -1) + $PYTHON_BIN_PATH/python -c "import tulip" + cd && cd tulip_build +done