Skip to content
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

Add Manylinux Python 3.7 wheel build + tests, disable Azure Windows Python build #1010

Merged
merged 18 commits into from
Apr 14, 2020
Merged
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
2 changes: 2 additions & 0 deletions .artifactignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
**/*
!*.whl
57 changes: 55 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ trigger:
branches:
include:
- '*' # must quote since "*" is a YAML reserved character; we want a string
tags:
include:
- 'v*'

pr:
branches:
Expand Down Expand Up @@ -52,22 +55,27 @@ jobs:
python.version: '2.7'
python_flag: '--python2'
manylinux_flag: ''
artifact_name: 'cp27-cp27m'
Python27ManyLinux2010:
python.version: '2.7'
python_flag: '--python2'
manylinux_flag: '--manylinux2010'
artifact_name: 'cp27-cp27m-manylinux2010'
Python37:
python.version: '3.7'
python_flag: ''
manylinux_flag: ''
artifact_name: 'cp37-cp37m'
Python37ManyLinux2010:
python.version: '3.7'
python_flag: ''
manylinux_flag: '--manylinux2010'
manylinux_flag: '--manylinux2010'
artifact_name: 'cp37-cp37m-manylinux2010'
Python37ManyLinux2014:
python.version: '3.7'
python_flag: ''
manylinux_flag: '--manylinux2014'
artifact_name: 'cp37-cp37m-manylinux2014'

steps:
- task: UsePythonVersion@0
Expand Down Expand Up @@ -101,6 +109,45 @@ jobs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/*coverage.xml'

# Build a python wheel only for Python 3 and Manylinux
- bash: yarn _wheel_python --ci $(python_flag) $(manylinux_flag)
condition: and(succeeded(), ne(variables['manylinux_flag'], ''))
displayName: 'Build wheel'
env:
PSP_DOCKER: 1

# Start a new virtual environment for the Perspective wheel, so as to
# isolate it from previously installed dependencies
- bash: python -m venv ./temp_venv
condition: and(succeeded(), ne(variables['manylinux_flag'], ''), ne(variables['python_flag'], '--python2'))
displayName: "Create virtualenv"

- bash: source ./temp_venv/bin/activate
condition: and(succeeded(), ne(variables['manylinux_flag'], ''), ne(variables['python_flag'], '--python2'))
displayName: "Activate virtualenv"

# Make sure that Perspective is not installed
- bash: "python -c 'from __future__ import print_function\ntry: import perspective; print(perspective.is_libpsp())\nexcept:print(\"Perspective not installed\")'"
condition: and(succeeded(), ne(variables['manylinux_flag'], ''), ne(variables['python_flag'], '--python2'))
displayName: 'Verify that Perspective is not installed'

# Install the manylinux wheel
- bash: python -m pip install --force-reinstall $(System.DefaultWorkingDirectory)/python/perspective/dist/*.whl
condition: and(succeeded(), ne(variables['manylinux_flag'], ''), ne(variables['python_flag'], '--python2'))
displayName: 'Install from wheel'

# Make sure that the binaries are valid and can be imported
- bash: "python -c 'from __future__ import print_function\nimport perspective; print(perspective.is_libpsp())'"
condition: and(succeeded(), ne(variables['manylinux_flag'], ''), ne(variables['python_flag'], '--python2'))
displayName: 'Verify successful installation'

# Save the artifact to Azure storage
- task: PublishPipelineArtifact@1
condition: and(succeeded(), ne(variables['manylinux_flag'], ''), ne(variables['python_flag'], '--python2'))
inputs:
targetPath: '$(System.DefaultWorkingDirectory)/python/perspective/dist/'
artifactName: '$(artifact_name)'

- job: 'Windows'
pool:
vmImage: 'vs2017-win2016'
Expand Down Expand Up @@ -141,6 +188,12 @@ jobs:

- script: yarn build_python --ci $(python_flag)
displayName: 'build'
env:
# Set `BOOST_ROOT` manually, as `BOOST_ROOT` is removed in the VM:
# https://github.com/actions/virtual-environments/issues/687
BOOST_ROOT: "C:/hostedtoolcache/windows/Boost/1.69.0/"
BOOST_INCLUDEDIR: "C:/hostedtoolcache/windows/Boost/1.69.0/include"
BOOST_LIBRARYDIR: "C:/hostedtoolcache/windows/Boost/1.69.0/libs"


- job: 'Mac'
Expand Down Expand Up @@ -199,4 +252,4 @@ jobs:
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/*coverage.xml'
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/*coverage.xml'
29 changes: 26 additions & 3 deletions cpp/perspective/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -286,12 +286,31 @@ elseif(PSP_CPP_BUILD OR PSP_PYTHON_BUILD)
set(ASMJS_MODE_FLAGS "")

if(PSP_CPP_BUILD)
# filesystem not required for Python, as we link to prebuilt arrow shared library
if (WIN32)
# BOOST_ROOT has been removed on Windows VMs in Azure:
#
# - https://github.com/actions/virtual-environments/issues/687
# - https://github.com/actions/virtual-environments/issues/319
#
# `BOOST_ROOT` must be set in the environment, and policy CMP0074
# must be set to `NEW` to allow BOOST_ROOT to be defined by env var
cmake_policy(SET CMP0074 NEW)

if(DEFINED(ENV{BOOST_ROOT}))
set(Boost_NO_BOOST_CMAKE TRUE)

message(WARNING "${Cyan}BOOST_ROOT: $ENV{BOOST_ROOT} ${ColorReset}")
message(WARNING "${Cyan}BOOST_INCLUDEDIR: $ENV{BOOST_INCLUDEDIR} ${ColorReset}")
message(WARNING "${Cyan}BOOST_LIBRARYDIR: $ENV{BOOST_LIBRARYDIR} ${ColorReset}")
endif()

endif()
# Filesystem required for Python build
find_package(Boost COMPONENTS filesystem)
if(NOT Boost_FOUND)
message("${Red}Boost could not be located${ColorReset}")
message("${Red}Boost filesystem could not be located${ColorReset}")
else()
message("${Cyan}Found boost in ${Boost_INCLUDE_DIRS} ${Boost_LIBRARY_DIRS} ${ColorReset}")
message("${Cyan}Found Boost: `Boost_INCLUDE_DIRS`: ${Boost_INCLUDE_DIRS}, `Boost_LIBRARY_DIRS` - ${Boost_LIBRARY_DIRS} ${ColorReset}")
endif()
include_directories( ${Boost_INCLUDE_DIRS} )
endif()
Expand All @@ -309,6 +328,10 @@ elseif(PSP_CPP_BUILD OR PSP_PYTHON_BUILD)
foreach(warning 4244 4251 4267 4275 4290 4786 4305 4996)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd${warning}")
endforeach(warning)
# When linking against Boost on Azure, bcrypt fails to link:
# - https://github.com/microsoft/vcpkg/issues/4481
# - https://github.com/boostorg/uuid/issues/68
#add_definitions("-DBOOST_UUID_FORCE_AUTO_LINK")
else()
include_directories("/usr/local/include")
endif()
Expand Down
1 change: 1 addition & 0 deletions python/perspective/perspective/tests/core/test_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def teardown_method(self):
global SENTINEL
SENTINEL = AsyncSentinel(0)

@mark.skip
def test_async_queue_process(self):
tbl = Table({
"a": int,
Expand Down
2 changes: 1 addition & 1 deletion scripts/script_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ exports.docker = function docker(image = "puppeteer") {
const IMAGE = `perspective/${image}`;
let env_vars = bash`-eWRITE_TESTS=${IS_WRITE} \
-ePACKAGE="${PACKAGE}"`;
let flags = IS_CI ? bash`--rm`: bash`--rm -it`;
let flags = IS_CI ? bash`--rm` : bash`--rm -it`;

if (IS_MANYLINUX) {
console.log(`-- Using manylinux build`);
Expand Down