Commit 97dc6295 authored by Matt Clarkson's avatar Matt Clarkson

Removed travis and appveyor builds, as GPU.

parent 098f7fd3
......@@ -4,6 +4,3 @@
[submodule "Code/Lib/PythonBoost/pyboostcvconverter"]
path = Code/PythonBoost/pyboostcvconverter
url = https://github.com/Algomorph/pyboostcvconverter.git
[submodule "multibuild"]
path = multibuild
url = https://github.com/matthew-brett/multibuild.git
#/*============================================================================
#
# SKSURGERYGPUCPP: Image-guided surgery functions, in C++, using GPU.
#
# Copyright (c) University College London (UCL). All rights reserved.
#
# This software is distributed WITHOUT ANY WARRANTY; without even
# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE.
#
# See LICENSE.txt in the top level directory for details.
#
#============================================================================*/
# Inspired by: https://github.com/skvark/opencv-python
# and : https://github.com/matthew-brett/multibuild
# and : https://github.com/thompson318/ndicapi-wheels
language: python
# The Travis Python version is unrelated to the version we build and test
# with. This is set with the MB_PYTHON_VERSION variable.
python: 3.6
sudo: required
dist: trusty
services: docker
# To Do: Where to put these?
# Most of these were deduced while testing various combinations of
# VTK, PCL, OpenCV etc. Your project may be able to get away with a
# much smaller list, depending on your actual testing requirements.
#
#sudo apt-get update
#sudo apt-get -yqq install build-essential
#sudo apt-get -yqq install binutils-gold
#sudo apt-get -yqq install freeglut3
#sudo apt-get -yqq install freeglut3-dev
#sudo apt-get -yqq install libglew-dev
#sudo apt-get -yqq install libglew1.5-dev
#sudo apt-get -yqq install libglm-dev
#sudo apt-get -yqq install mesa-common-dev
#sudo apt-get -yqq install mesa-utils-extra
#sudo apt-get -yqq install libgl1-mesa-dev
#sudo apt-get -yqq install libglapi-mesa
env:
global:
- DO_PYTHON_BUILD="true"
- "PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'"
- REPO_DIR=.
- BUILD_COMMIT=HEAD
- BUILD_DEPENDS="numpy six wheel"
- TEST_DEPENDS="numpy six pytest"
- BDIST_PARAMS=""
- PLAT=x86_64
- UNICODE_WIDTH=32
matrix:
fast_finish: true
exclude:
# Exclude the default Python 3.6 build
- python: 3.6
include:
# Builds for MacOS
- os: osx
language: generic
env:
- MB_PYTHON_VERSION=2.7
- BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7"
- os: osx
language: generic
env:
- MB_PYTHON_VERSION=3.6
- BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7"
- os: osx
language: generic
env:
- MB_PYTHON_VERSION=3.7
- BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7"
# Builds for Linux
- os: linux
env:
- MB_PYTHON_VERSION=2.7
- os: linux
env:
- MB_PYTHON_VERSION=2.7
- UNICODE_WIDTH=16
- os: linux
env:
- MB_PYTHON_VERSION=2.7
- PLAT=i686
- os: linux
env:
- MB_PYTHON_VERSION=2.7
- PLAT=i686
- UNICODE_WIDTH=16
- os: linux
env:
- MB_PYTHON_VERSION=3.5
- os: linux
env:
- MB_PYTHON_VERSION=3.5
- PLAT=i686
- os: linux
env:
- MB_PYTHON_VERSION=3.6
- os: linux
env:
- MB_PYTHON_VERSION=3.6
- PLAT=i686
- os: linux
env:
- MB_PYTHON_VERSION=3.7
- os: linux
env:
- MB_PYTHON_VERSION=3.7
- PLAT=i686
before_install:
- source multibuild/common_utils.sh
- source multibuild/travis_steps.sh
- before_install
install: |
echo "Starting main library build section."
if [ "${DO_PYTHON_BUILD}" = "true" ]; then
echo "DO_PYTHON_BUILD=true, so will do C++ and then build a wheel."
if [ -n "$IS_OSX" ]; then
# On Mac, it builds it inside the Travis Mac VM.
# So, you could add various homebrew commands to pre-install stuff,
# or if you are reading the travis documentation, you could use
# travis type directives like 'addons', which are normally configured above.
build_wheel $REPO_DIR $PLAT
else
# On Linux, this builds the C++ and then wheel
# inside a manylinux docker container (Centos 5).
DOCKER_IMAGE=quay.io/skvark/manylinux1_$PLAT
build_multilinux $PLAT "build_wheel $REPO_DIR"
fi
else
echo "DO_PYTHON_BUILD is not set to true, so will just do C++."
# This builds the C++ inside the Travis VM. On Linux this will
# be the OS listed above, e.g. Ubuntu trusty. So, if your project
# is only doing C++ and not Python, you will need debian based
# 'sudo apt-get' type commands, either here, or if you are reading
# travis documentation, then using various travis type directives
# like 'addons', which are normally configured at the top of this file.
source ci_cmake_build.sh
cmake_build
fi
echo "Finished main library build section."
script: |
echo "Starting to check if we are running tests on installed python wheel."
if [ "${DO_PYTHON_BUILD}" = "true" ]; then
echo "DO_PYTHON_BUILD is set to true, which means config.sh::run_tests() is called."
install_run $PLAT
else
echo "Nothing to do as DO_PYTHON_BUILD is not set to true."
fi
echo "Finished running tests on installed python wheel."
after_success: |
echo "Starting to check if we are deploying to PyPi"
if [ -n "$TRAVIS_TAG" ]; then
if [ "${DO_PYTHON_BUILD}" = "true" ]; then
pip install twine
if [[ "$TRAVIS_OS_NAME" = "osx" ]]; then
pip install --upgrade pyOpenSSL
fi
twine upload --repository pypi -u ${PYPI_USER} -p ${PYPI_PASS} --skip-existing wheelhouse/*
else
echo "Deployment skipped as DO_PYTHON_BUILD is not set to true."
fi
else
echo "Deployment skipped as git tag not set."
fi
echo "Finished any necessary deployment."
#/*============================================================================
#
# SKSURGERYGPUCPP: Image-guided surgery functions, in C++, using GPU.
#
# Copyright (c) University College London (UCL). All rights reserved.
#
# This software is distributed WITHOUT ANY WARRANTY; without even
# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE.
#
# See LICENSE.txt in the top level directory for details.
#
#============================================================================*/
version: "{build}"
init:
- git config --global core.autocrlf input
clone_folder: c:\projects\scikit-surgerygpucpp
shallow_clone: false
environment:
# Set DO_PYTHON_BUILD to false, if you are only interested in the C++ part.
DO_PYTHON_BUILD: true
USER:
secure: fUZFeIra+GVpjh8AFC8kpw==
PASS:
secure: p0rP3cr8gF2t+7jdtpH10XV2RbKw6JXW35nNCrT5rfY=
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
COMPILER: "Visual Studio 14 2015"
MB_PYTHON: "C:/Python35"
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
COMPILER: "Visual Studio 14 2015 Win64"
MB_PYTHON: "C:/Python35-x64"
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
COMPILER: "Visual Studio 14 2015"
MB_PYTHON: "C:/Python36"
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
COMPILER: "Visual Studio 14 2015 Win64"
MB_PYTHON: "C:/Python36-x64"
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
COMPILER: "Visual Studio 15 2017"
MB_PYTHON: "C:/Python37"
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
COMPILER: "Visual Studio 15 2017 Win64"
MB_PYTHON: "C:/Python37-x64"
matrix:
# This is so that if any of the above builds fails, then the whole build fails early.
fast_finish: true
configuration:
- Release
platform:
# Set to 'Any CPU', as it is the COMPILER string listed above that tells
# cmake to pick a generator for either a 64 or 32 bit build.
- Any CPU
before_build:
- ps: |
echo --------------------------------------------------------------------------------
echo "Doing before_build: PYTHON=${Env:MB_PYTHON}"
cd ${Env:APPVEYOR_BUILD_FOLDER}
pwd
${Env:PATH} = "${Env:MB_PYTHON};${Env:MB_PYTHON}/Scripts;${Env:PATH}"
echo "${Env:PATH}"
git submodule update -q --init --recursive
if ($LastExitCode -ne 0) {throw $LastExitCode}
&"${Env:MB_PYTHON}/python.exe" -m pip install --upgrade pip
if ($LastExitCode -ne 0) {throw $LastExitCode}
&"${Env:MB_PYTHON}/python.exe" -m pip install --upgrade setuptools
if ($LastExitCode -ne 0) {throw $LastExitCode}
&"${Env:MB_PYTHON}/python.exe" -m pip install --upgrade six
if ($LastExitCode -ne 0) {throw $LastExitCode}
&"${Env:MB_PYTHON}/python.exe" -m pip install --upgrade numpy
if ($LastExitCode -ne 0) {throw $LastExitCode}
&"${Env:MB_PYTHON}/python.exe" -m pip install --upgrade --no-warn-script-location wheel
if ($LastExitCode -ne 0) {throw $LastExitCode}
build_script:
- ps: |
echo --------------------------------------------------------------------------------
echo "Building the C++ part: PYTHON=${Env:MB_PYTHON}, COMPILER=${Env:COMPILER}, CONFIGURATION=${Env:CONFIGURATION}"
cd ${Env:APPVEYOR_BUILD_FOLDER}
pwd
${Env:PATH} = "${Env:MB_PYTHON};${Env:MB_PYTHON}/Scripts;${Env:PATH}"
echo "${Env:PATH}"
cmake -version
mkdir build
cd build
cmake -G "${Env:COMPILER}" -DBUILD_SUPERBUILD:BOOL=ON -DBUILD_TESTING:BOOL=ON -DBUILD_Boost:BOOL=ON -DBUILD_Python_PyBind:BOOL=OFF -DBUILD_Python_Boost:BOOL=ON -DBUILD_Eigen:BOOL=ON -DBUILD_glog:BOOL=ON -DBUILD_gflags:BOOL=ON -DBUILD_VTK:BOOL=OFF -DBUILD_PCL:BOOL=ON -DBUILD_OpenCV:BOOL=ON --config ${Env:CONFIGURATION} ..
if ($LastExitCode -ne 0) {throw $LastExitCode}
cmake --build . --config ${Env:CONFIGURATION}
if ($LastExitCode -ne 0) {throw $LastExitCode}
test_script:
- ps: |
echo --------------------------------------------------------------------------------
cd ${Env:APPVEYOR_BUILD_FOLDER}
pwd
cd build
pwd
cd SKSURGERYGPUCPP-build
pwd
ctest -C ${Env:CONFIGURATION}
if ($LastExitCode -ne 0) {throw $LastExitCode}
after_test:
- ps: |
echo --------------------------------------------------------------------------------
echo "Building the Python wheel part:"
cd ${Env:APPVEYOR_BUILD_FOLDER}
pwd
${Env:PATH} = "${Env:MB_PYTHON};${Env:MB_PYTHON}/Scripts;${Env:PATH}"
if (${Env:DO_PYTHON_BUILD} -eq "true") {
echo "Building python wheel."
&"${Env:MB_PYTHON}/python.exe" setup.py bdist_wheel
if ($LastExitCode -ne 0) {throw $LastExitCode}
echo "Finished building python wheel."
echo "Installing python wheel."
echo "Contents of dist directory:"
dir dist
$wheel_files = @(Get-ChildItem dist\* -include *.whl)
$wheel = $wheel_files[0]
echo "Wheel file is $wheel"
&"${Env:MB_PYTHON}/python.exe" -m pip install --upgrade --no-index --find-links dist/ $wheel
if ($LastExitCode -ne 0) {throw $LastExitCode}
echo "Finished installing python wheel."
echo "Running python tests."
dir c:\python35\lib\site-packages
&"${Env:MB_PYTHON}/python.exe" -m pip install pytest
if ($LastExitCode -ne 0) {throw $LastExitCode}
# Uncomment this when you actually have tests.
# &"${Env:MB_PYTHON}/python.exe" -m pytest -v -s Testing/
# if ($LastExitCode -ne 0) {throw $LastExitCode}
echo "Finished python tests."
}
deploy_script:
- ps: |
cd ${Env:APPVEYOR_BUILD_FOLDER}
pwd
if (${Env:APPVEYOR_REPO_TAG} -eq "true") {
if (${Env:DO_PYTHON_BUILD} -eq "true") {
&"${Env:MB_PYTHON}/python.exe" -m pip install twine
if ($LastExitCode -ne 0) {throw $LastExitCode}
&"${Env:MB_PYTHON}/python.exe" -m twine upload --repository pypi -u ${Env:USER} -p ${Env:PASS} --skip-existing dist/*
if ($LastExitCode -ne 0) {throw $LastExitCode}
}
else {
echo "DO_PYTHON_BUILD not set, deployment skipped."
}
}
else {
echo "Tag not set, deployment skipped."
}
#/*============================================================================
#
# SKSURGERYGPUCPP: Image-guided surgery functions, in C++, using GPU.
#
# Copyright (c) University College London (UCL). All rights reserved.
#
# This software is distributed WITHOUT ANY WARRANTY; without even
# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE.
#
# See LICENSE.txt in the top level directory for details.
#
#============================================================================*/
function pre_build {
echo "Starting pre_build."
# Debug info.
pwd
echo "PATH=$PATH"
python --version
cmake --version
if [ -n "$BUILD_DEPENDS" ]; then
pip install $BUILD_DEPENDS
fi
if [ -n "$IS_OSX" ]; then
echo "pre_build is on Mac."
else
echo "pre_build is on Linux."
#############################################################################################
# IMPORTANT: Look in .travis.yml. Decide if your project requires DO_PYTHON_BUILD to be true.
#############################################################################################
#
# if DO_PYTHON_BUILD = true
#
# i.e. you want to build C++ and then Python wheels. Therefore, this function is running inside
# a manylinux docker image. Any library installations here should use Centos based commands
# like 'sudo yum install ...'.
# OR
# You should build your own docker image, specify that URL in .travis.yml,
# and then you won't need any 'sudo yum install ...' type commands here.
#
# if DO_PYTHON_BUILD = false
#
# then this function is running inside the main travis VM, most likely Ubuntu,
# so you should set up dependencies in top-level .travis.yml, or try some
# 'sudo apt-get install' type commands here. But its more obvious if you
# put them in the top level .travis.yml file.
fi
# Run the actual C++ build.
source travis_cmake_build.sh
cmake_build
echo "Finished pre_build."
}
function build_wheel {
# Don't remove this function, or switch back to pip, as pip
# doesn't get on well with versioneer.py
# https://github.com/warner/python-versioneer/issues/121
build_bdist_wheel $@
}
function run_tests {
echo "Starting run_tests."
pwd
cd ..
# Uncomment this when you have some tests.
# If no tests are found, this fails with non-zero error code.
# python -m pytest -v -s Testing/
echo "Finished run_tests."
}
Subproject commit 31383c154eef36357fa1ac64e288c66946ee4383
#/*============================================================================
#
# SKSURGERYGPUCPP: Image-guided surgery functions, in C++, using GPU.
#
# Copyright (c) University College London (UCL). All rights reserved.
#
# This software is distributed WITHOUT ANY WARRANTY; without even
# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE.
#
# See LICENSE.txt in the top level directory for details.
#
#============================================================================*/
function cmake_build {
echo "Starting travis_cmake_build.sh"
pwd
echo "Requested python version:${PYTHON_VERSION}"
cmake --version
python --version
mkdir build
cd build
cmake -DSKSURGERYGPUCPP_PYTHON_VERSION:STRING=${PYTHON_VERSION} -DBUILD_SUPERBUILD:BOOL=ON -DBUILD_TESTING:BOOL=ON -DBUILD_Boost:BOOL=ON -DBUILD_Python_Boost:BOOL=ON -DBUILD_Eigen:BOOL=ON -DBUILD_glog:BOOL=ON -DBUILD_gflags:BOOL=ON -DBUILD_VTK:BOOL=OFF -DBUILD_PCL:BOOL=ON -DBUILD_OpenCV:BOOL=ON ..
make -j 2
cd SKSURGERYGPUCPP-build
ctest .
cd ../../
echo "Finished travis_cmake_build.sh"
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment