forked from numenta/nupic-legacy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
144 lines (127 loc) · 6.11 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
branches:
except:
- gh-pages
language: cpp
os:
- linux
- osx
compiler:
- clang
- gcc
env:
global:
- NUPIC=$TRAVIS_BUILD_DIR
- NTA=$HOME/nta/eng
- PATH=$TRAVIS_BUILD_DIR/python/bin:$PATH
matrix:
- PY_VER=2.7
- PY_VER=2.6
matrix:
# This excludes OSX builds from the build matrix for gcc and Python 2.6
exclude:
- os: osx
env: PY_VER=2.6
- os: osx
compiler: gcc
# Successful builds are archived and uploaded to S3 for regression testing.
before_deploy:
# We need to move the pip requirements into the archived directory so they can
# be installed for regression tests
- cp ${TRAVIS_BUILD_DIR}/external/common/requirements.txt ${NTA}/.
# This is the directory we'll be archiving.
- mkdir ${TRAVIS_BUILD_DIR}/build/archive
# Tar up the release directory
- tar -zcf ${TRAVIS_BUILD_DIR}/build/archive/nupic-linux64-${TRAVIS_COMMIT}.tar.gz -C $NTA/.. --transform=s/eng/nupic-linux64-${TRAVIS_COMMIT}/ --exclude="*.pyc" eng
deploy:
provider: s3
access_key_id: AKIAIGHYSEHV3WFKOWNQ
secret_access_key:
secure: "ONG00ZCPpfU/nugFiON3K2q8IMk3nB/aAUj2Ggjf1z0CJS/cvnfIexmJhe+DJCccoco2l5gpiqp7gweH5vXEcyrzTt1I3Z+iFNas2cQ/wF3LjW0NcbdGeC9NN9kGIoOvr8g6L66CUvazYoirgbJO01ktm7LVNeGS3Q1pk36Vp10="
bucket: artifacts.numenta.org
region: us-west-2
local-dir: "${TRAVIS_BUILD_DIR}/build/archive"
upload-dir: "numenta/nupic/${TRAVIS_COMMIT}"
skip_cleanup: true
# Only deploy on master from one build job: linux, clang, python 2.7
on:
branch: master
condition:
- "$TRAVIS_OS_NAME == linux"
- "$PY_VER == 2.7"
- "$CC == clang"
git:
submodules: false
notifications:
irc:
channels:
- "irc.freenode.net#nupic-hackers"
webhooks: http://issues.numenta.org:8081/travis
before_install:
# Get Darwin64 libs for OSX
- "if [ $TRAVIS_OS_NAME = 'osx' ]; then git clone https://github.com/numenta/nupic-darwin64.git; fi"
- "if [ $TRAVIS_OS_NAME = 'osx' ]; then (cd nupic-darwin64 && git reset --hard 6496136d3748f5f15eaf8e85e48c113d7447149b); fi"
- "if [ $TRAVIS_OS_NAME = 'osx' ]; then source nupic-darwin64/bin/activate; fi"
# Install cmake on OSX
- "if [ $TRAVIS_OS_NAME = 'osx' ]; then brew install cmake; fi"
# Install MySQL on OSX
- "if [ $TRAVIS_OS_NAME = 'osx' ]; then brew install mysql; fi"
- "if [ $TRAVIS_OS_NAME = 'osx' ]; then mysql.server start; fi"
# Necessary Linux prep work
- "if [ $TRAVIS_OS_NAME = 'linux' ]; then sudo add-apt-repository -y ppa:fkrull/deadsnakes; fi"
- "if [ $TRAVIS_OS_NAME = 'linux' ]; then sudo apt-get update; fi"
# Install virtualenv
- "if [ $TRAVIS_OS_NAME = 'linux' ]; then sudo apt-get install python$PY_VER python$PY_VER-dev python-virtualenv; fi"
- "if [ $TRAVIS_OS_NAME = 'linux' ]; then sudo ls -laFh /usr/lib/libpython$PY_VER.so; fi"
# Prefix env with our own python installation
- "if [ $TRAVIS_OS_NAME = 'linux' ]; then export PYTHONPATH=$PYTHONPATH:$NTA/lib/python$PY_VER/site-packages; fi"
# Execute virtualenv
- "if [ $TRAVIS_OS_NAME = 'linux' ]; then virtualenv --python=`which python$PY_VER` .; fi"
- "if [ $TRAVIS_OS_NAME = 'linux' ]; then source bin/activate; fi"
# Workaround for multiprocessing.Queue SemLock error from run_opf_bechmarks_test.
# See: https://github.com/travis-ci/travis-cookbooks/issues/155
- "if [ $TRAVIS_OS_NAME = 'linux' ]; then sudo rm -rf /dev/shm && sudo ln -s /run/shm /dev/shm; fi"
# Install NuPIC python dependencies
- "if [ $TRAVIS_OS_NAME = 'linux' ]; then travis_retry pip install -q -r $NUPIC/external/common/requirements.txt; fi"
install:
- "mkdir -p $TRAVIS_BUILD_DIR/build/scripts"
- "cd $TRAVIS_BUILD_DIR/build/scripts"
# Verify cmake version
- "cmake --version"
# Verify python version
- "python --version"
# Build NuPIC
- "if [ $TRAVIS_OS_NAME = 'osx' ]; then cmake $NUPIC -DPROJECT_BUILD_RELEASE_DIR:STRING=$NTA; fi"
- "if [ $TRAVIS_OS_NAME = 'linux' ]; then PYTHON=`which python$PY_VER` cmake $NUPIC -DPYTHON_LIBRARY=/usr/lib/libpython$PY_VER.so -DPROJECT_BUILD_RELEASE_DIR:STRING=$NTA; fi"
- "make -j3"
script:
# legacy binary tests
- "make tests_pyhtm"
# Python unit tests and prep for coveralls reporting
- "make python_unit_tests"
- "mv ${TRAVIS_BUILD_DIR}/.coverage ${TRAVIS_BUILD_DIR}/.coverage_unit"
# Python integration tests and prep for coveralls reporting
- "make python_integration_tests"
- "mv ${TRAVIS_BUILD_DIR}/.coverage ${TRAVIS_BUILD_DIR}/.coverage_integration"
- "cd ${TRAVIS_BUILD_DIR}"
# run all example files
# examples/bindings
- "python$PY_VER $NUPIC/examples/bindings/sparse_matrix_how_to.py"
# - "python $NUPIC/examples/bindings/svm_how_to.py" # tkinter missing in Travis build machine
# - "python $NUPIC/examples/bindings/temporal_pooler_how_to.py" # tkinter too
# examples/opf (run at least 1 from each category)
- "python$PY_VER $NUPIC/scripts/run_opf_experiment.py $NUPIC/examples/opf/experiments/anomaly/spatial/2field_few_skewed/"
- "python$PY_VER $NUPIC/scripts/run_opf_experiment.py $NUPIC/examples/opf/experiments/anomaly/temporal/saw_200/"
- "python$PY_VER $NUPIC/scripts/run_opf_experiment.py $NUPIC/examples/opf/experiments/classification/category_TP_1/"
- "python$PY_VER $NUPIC/scripts/run_opf_experiment.py $NUPIC/examples/opf/experiments/missing_record/simple_0/"
- "python$PY_VER $NUPIC/scripts/run_opf_experiment.py $NUPIC/examples/opf/experiments/multistep/hotgym/"
- "python$PY_VER $NUPIC/scripts/run_opf_experiment.py $NUPIC/examples/opf/experiments/opfrunexperiment_test/simpleOPF/hotgym_1hr_agg/"
# opf/experiments/params - skip now
- "python$PY_VER $NUPIC/scripts/run_opf_experiment.py $NUPIC/examples/opf/experiments/spatial_classification/category_1/"
# examples/tp
- "python$PY_VER $NUPIC/examples/tp/hello_tp.py"
- "python$PY_VER $NUPIC/examples/tp/tp_test.py"
after_success:
- "if [ $TRAVIS_OS_NAME = 'linux' ] && [ $PY_VER = '2.7' ] && [ $CC = 'clang' ]; then pip install python-coveralls; fi"
# Only publishing unit test coverage at this point.
- "if [ $TRAVIS_OS_NAME = 'linux' ] && [ $PY_VER = '2.7' ] && [ $CC = 'clang' ]; then coveralls -i --data_file=.coverage_unit; fi"
# TODO: figure out how to publish integration test coverage as well.