Skip to content
This repository was archived by the owner on Feb 2, 2024. It is now read-only.

Commit 902ea10

Browse files
Vyacheslav-SmirnovIvan Butygin
authored andcommitted
Improve CI builds (#229)
1 parent e48387f commit 902ea10

14 files changed

Lines changed: 160 additions & 90 deletions

‎.travis.yml‎

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,46 @@
22

33
dist: trusty
44

5+
env:
6+
global:
7+
- GIT_DESCRIBE_TAG=0.29.2
8+
- GIT_DESCRIBE_NUMBER=1
9+
- CONDA_ENV=travisci
10+
- PYTHON_VER=3.7
11+
- NUMPY_VER=1.16
12+
matrix:
13+
- HPAT_CHECK_STYLE=True
14+
- HPAT_RUN_BUILD=True HPAT_NUM_PES=1
15+
- HPAT_RUN_BUILD=True HPAT_NUM_PES=2
16+
- HPAT_RUN_BUILD=True HPAT_NUM_PES=3
17+
- HPAT_RUN_BUILD=True HPAT_WHEELS=True
18+
- HPAT_RUN_BUILD=True HPAT_RUN_COVERAGE=True
519
matrix:
6-
include:
7-
- env: CONDA_ENV=travisci PYTHON_VER=3.7
20+
allow_failures:
21+
- env: HPAT_CHECK_STYLE=True
22+
- env: HPAT_RUN_BUILD=True HPAT_NUM_PES=3
823

9-
# TODO Remove travis from repository and add code coverage check
10-
before_install: skip
24+
before_install:
25+
- buildscripts/setup_conda.sh
26+
- export PATH=$HOME/miniconda3/bin:$PATH
1127

12-
install: skip
28+
install:
29+
- export PATH=$HOME/miniconda3/bin:$PATH
30+
- export HPAT_SOURCE_DIR="$(pwd)/hpat"
31+
- env | grep HPAT_SOURCE_DIR
32+
- export HPAT_WHEELS_DIR="$(pwd)/hpat-wheels"
33+
- env | grep HPAT_WHEELS_DIR
34+
- mkdir $HPAT_WHEELS_DIR
35+
- if [ "$HPAT_RUN_BUILD" == "True" ]; then
36+
buildscripts/build.sh;
37+
fi
1338

14-
script: skip
39+
script:
40+
- export PATH=$HOME/miniconda3/bin:$PATH
41+
- if [ "$HPAT_CHECK_STYLE" == "True" ]; then
42+
chmod 777 buildscripts/code_style.sh;
43+
buildscripts/code_style.sh;
44+
fi
1545

1646
after_success: skip
1747

‎azure-pipelines.yml‎

Lines changed: 13 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,32 @@
11
jobs:
2-
- job: Windows
3-
timeoutInMinutes: 0
4-
pool:
5-
vmImage: 'vs2017-win2016'
6-
7-
steps:
8-
- powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
9-
displayName: Add conda to PATH
10-
11-
- script: conda create -q -y -n CB python=3.7 conda-build conda-verify vc vs2015_runtime vs2015_win-64
12-
displayName: Create Anaconda environment
13-
14-
- script: |
15-
call activate CB
16-
conda build --python 3.7 --override-channels -c numba -c conda-forge -c defaults -c intel --output-folder=. buildscripts/hpat-conda-recipe/
17-
displayName: conda build
18-
19-
- template: buildscripts/azure-template-linux-macos.yml
2+
- template: buildscripts/azure-template-windows.yml
203
parameters:
21-
name: macOS
22-
vmImage: xcode9-macos10.13
4+
name: Windows
5+
vmImage: vs2017-win2016
236
matrix:
24-
py37_numpes0:
7+
py37_np116_numpes0:
258
CONDA_ENV: 'travisci'
269
PYTHON_VER: '3.7'
10+
NUMPY_VER: '1.16'
2711

28-
py37_numpes2:
12+
py37_np116_numpes2:
2913
CONDA_ENV: 'travisci'
3014
HPAT_NUM_PES: '2'
3115
PYTHON_VER: '3.7'
16+
NUMPY_VER: '1.16'
3217

3318
- template: buildscripts/azure-template-linux-macos.yml
3419
parameters:
35-
name: Linux
36-
vmImage: ubuntu-16.04
20+
name: macOS
21+
vmImage: xcode9-macos10.13
3722
matrix:
38-
py36_numpes0:
39-
CONDA_ENV: 'travisci'
40-
PYTHON_VER: '3.6'
41-
42-
py36_numpes3:
43-
CONDA_ENV: 'travisci'
44-
HPAT_NUM_PES: '3'
45-
PYTHON_VER: '3.6'
46-
47-
py37_numpes0:
23+
py37_np116_numpes0:
4824
CONDA_ENV: 'travisci'
4925
PYTHON_VER: '3.7'
50-
51-
py37_numpes1:
52-
CONDA_ENV: 'travisci'
53-
HPAT_NUM_PES: '1'
54-
PYTHON_VER: '3.7'
26+
NUMPY_VER: '1.16'
5527

56-
py37_numpes2:
28+
py37_np116_numpes2:
5729
CONDA_ENV: 'travisci'
5830
HPAT_NUM_PES: '2'
5931
PYTHON_VER: '3.7'
60-
61-
py37_numpes3:
62-
CONDA_ENV: 'travisci'
63-
HPAT_NUM_PES: '3'
64-
PYTHON_VER: '3.7'
32+
NUMPY_VER: '1.16'

‎buildscripts/after_success.sh‎

Lines changed: 0 additions & 8 deletions
This file was deleted.

‎buildscripts/azure-template-linux-macos.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ parameters:
55

66
jobs:
77
- job: ${{ parameters.name }}
8-
timeoutInMinutes: 240
8+
timeoutInMinutes: 120
99
pool:
1010
vmImage: ${{ parameters.vmImage }}
1111
strategy:
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
parameters:
2+
name: ''
3+
vmImage: ''
4+
matrix: []
5+
6+
jobs:
7+
- job: ${{ parameters.name }}
8+
timeoutInMinutes: 120
9+
pool:
10+
vmImage: ${{ parameters.vmImage }}
11+
strategy:
12+
maxParallel: 11
13+
matrix:
14+
${{ insert }}: ${{ parameters.matrix }}
15+
16+
steps:
17+
- powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
18+
displayName: Add conda to PATH
19+
20+
- script: conda create -q -y -n %CONDA_ENV% python=%PYTHON_VER% conda-build conda-verify vc vs2015_runtime vs2015_win-64
21+
displayName: Create Anaconda environment
22+
23+
- script: |
24+
call activate %CONDA_ENV%
25+
conda build --python %PYTHON_VER% --numpy=%NUMPY_VER% --override-channels -c numba -c conda-forge -c defaults -c intel buildscripts/hpat-conda-recipe/
26+
displayName: conda build

‎buildscripts/build.sh‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/bin/bash
2+
set -ex
23

34
source activate $CONDA_ENV
45

5-
conda build --python $PYTHON_VER -c numba -c conda-forge -c defaults --override-channels ./buildscripts/hpat-conda-recipe/
6+
conda build --python $PYTHON_VER --numpy=$NUMPY_VER -c numba -c conda-forge -c defaults --override-channels ./buildscripts/hpat-conda-recipe/

‎buildscripts/code_style.sh‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
source activate $CONDA_ENV
4+
5+
# echo "======================================================================"
6+
# echo Executing clang-format-6.0 style:
7+
# echo "======================================================================"
8+
# python ./setup.py style
9+
10+
echo "======================================================================"
11+
echo Executing python flake8:
12+
echo "======================================================================"
13+
flake8 ./
Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1+
echo on
2+
13
set HDF5_DIR="%LIBRARY_PREFIX%"
2-
REM set OPENCV_DIR="%LIBRARY_PREFIX%"
3-
REM set DAALROOT="%LIBRARY_PREFIX%"
44
"%PYTHON%" setup.py build install --single-version-externally-managed --record=record.txt
55
if errorlevel 1 exit 1
66

7-
8-
REM "%PYTHON%" setup.py build_doc
9-
REM if errorlevel 1 exit 1
10-
REM "%PYTHON%" setup.py build_devdoc
11-
REM if errorlevel 1 exit 1
7+
@rem Build HPAT wheel
8+
echo Build HPAT wheel
9+
IF "%HPAT_WHEELS%" == "True" (
10+
"%PYTHON%" setup.py bdist_wheel
11+
if errorlevel 1 exit 1
12+
copy dist\hpat*.whl "%HPAT_WHEELS_DIR%"
13+
if errorlevel 1 exit 1
14+
)
Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1-
# LDSHARED="mpicxx -cxx=$GXX -shared" LD="mpicxx -cxx=$GXX" \
2-
# CC="mpicxx -cxx=$GXX -std=c++11" GXX="mpicxx -cxx=$GXX -std=c++11" \
3-
# OPENCV_DIR="${PREFIX}" DAALROOT="${PREFIX}"
1+
set -ex
2+
43
HDF5_DIR="${PREFIX}" MACOSX_DEPLOYMENT_TARGET=10.9 \
54
$PYTHON setup.py build install --single-version-externally-managed --record=record.txt
65

7-
#Build Documentation
8-
#$PYTHON setup.py build_doc
9-
#$PYTHON setup.py build_devdoc
6+
if [ "$HPAT_WHEELS" == "True" ]; then
7+
if [ -z "$HPAT_WHEELS_DIR" ]; then
8+
echo "Please set HPAT_WHEELS_DIR to build HPAT wheels"
9+
else
10+
# Build HPAT wheel
11+
echo Build HPAT wheel
12+
$PYTHON setup.py bdist_wheel
13+
cp dist/hpat*.whl "$HPAT_WHEELS_DIR"
14+
fi
15+
fi

‎buildscripts/hpat-conda-recipe/meta.yaml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ build:
1111
- HPAT_CONFIG_MPI
1212
- HPAT_NUM_PES
1313
- HPAT_RUN_COVERAGE
14+
- HPAT_SOURCE_DIR
15+
- HPAT_WHEELS
16+
- HPAT_WHEELS_DIR
1417

1518
requirements:
1619
build:
@@ -32,6 +35,7 @@ requirements:
3235
- impi_rt # [win]
3336
- impi-devel # [win]
3437
- conda-package-handling ==1.3.11 #[win]
38+
- wheel
3539

3640
run:
3741
- python
@@ -50,6 +54,7 @@ test:
5054
- h5py
5155
- scipy
5256
- coveralls
57+
- pip
5358
imports:
5459
- hpat
5560

0 commit comments

Comments
 (0)