forked from snorkel-team/snorkel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
97 lines (78 loc) · 3 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
# Travis CI config for Snorkel, a training data creation and management
# system focused on information extraction
dist: trusty
sudo: false # to use container-based infra, see: http://docs.travis-ci.com/user/migrating-from-legacy/
language:
- python
python:
- "2.7"
jdk:
- oraclejdk8
cache:
directories:
- download
- $HOME/.cache/pip
- $HOME/miniconda/envs/test # to avoid repetitively setting up Ana/Miniconda environment
- parser # to avoid repetitively downloading CoreNLP
addons:
apt:
packages:
# CoreNLP needs Java 8
- oracle-java8-installer
# Following trick is necessary to get a binary distribution of numpy, scipy, etc. which takes too long to build every time
# See: http://stackoverflow.com/q/30588634
# See: https://github.com/Theano/Theano/blob/master/.travis.yml (for caching)
# See: http://conda.pydata.org/docs/travis.html
before_install:
- deactivate # leaving Travis' virtualenv first since otherwise Jupyter/IPython gets confused with conda inside a virtualenv (See: https://github.com/ipython/ipython/issues/8898)
- mkdir -p download
- cd download
- travis_retry wget -c http://repo.continuum.io/miniconda/Miniconda-3.8.3-Linux-x86_64.sh -O miniconda.sh
- chmod +x miniconda.sh
- bash miniconda.sh -b -f -p ~/miniconda
- cd ..
- export PATH=~/miniconda/bin:$PATH
- conda update --yes conda
# Make sure Java 8 is used
- export PATH="/usr/lib/jvm/java-8-oracle/bin:$PATH"
- export JAVA_HOME=/usr/lib/jvm/java-8-oracle
- java -version
# Set environment variables
- source set_env.sh
install:
# Install binary distribution of scientific python modules
- test -e ~/miniconda/envs/test/bin/activate || ( rm -rf ~/miniconda/envs/test; conda create --yes -n test python=$TRAVIS_PYTHON_VERSION )
- source activate test
- conda install --yes numpy scipy matplotlib pip
# Install Numba
- conda install --yes numba
# Install all remaining dependencies as per our README
- pip install -r python-package-requirement.txt
- test -e parser/corenlp.sh || ./install-parser.sh
# Use runipy to run Jupyter/IPython notebooks from command-line
- pip install runipy
script:
# Run test modules
- python test/learning/test_gen_learning.py
- python test/learning/test_supervised.py
- python test/learning/test_categorical.py
- runipy test/learning/test_TF_notebook.ipynb
- runipy test/learning/test_parallel_grid_search.ipynb
# Runs intro tutorial notebooks
- cd tutorials
- runipy intro/Intro_Tutorial_1.ipynb
- runipy intro/Intro_Tutorial_2.ipynb
- runipy intro/Intro_Tutorial_3.ipynb
# Run advanced notebooks
- runipy advanced/Categorical_Classes.ipynb
- runipy advanced/Structure_Learning.ipynb
# Run CDR tutorials
- runipy cdr/CDR_Tutorial_1.ipynb
- runipy cdr/CDR_Tutorial_2.ipynb
- runipy cdr/CDR_Tutorial_3.ipynb
# TODO check outputs, upload results, etc.
# for more ideas, see: https://github.com/rossant/ipycache/issues/7
after_success:
- killall java
after_failure:
- killall java