Skip to content

Commit

Permalink
Merge pull request #1310 from quantopian/vagrantf
Browse files Browse the repository at this point in the history
VagrantFile for Ubuntu 14.04 that includes all the development requirements
  • Loading branch information
richafrank committed Jul 7, 2016
2 parents 459366c + 424d774 commit 7c17027
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 27 deletions.
6 changes: 5 additions & 1 deletion Dockerfile-dev
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,8 @@
#
FROM quantopian/zipline

RUN cd /zipline && pip install -r etc/requirements_dev.txt -r etc/requirements_blaze.txt
WORKDIR /zipline

RUN pip install -r etc/requirements_dev.txt -r etc/requirements_blaze.txt
# Clean out any cython assets. The pip install re-builds them.
RUN find . -type f -name '*.c' -exec rm {} + && pip install -e .[all]
3 changes: 1 addition & 2 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.vm.box = "ubuntu/trusty64"
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", 2048, "--cpus", 2]
end
Expand Down
3 changes: 3 additions & 0 deletions docs/source/whatsnew/1.0.2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ Enhancements
must search for when querying data. The checkpoints should have novel deltas
applied (:issue:`1276`).

- Updated VagrantFile to include all dev requirements and use a newer image
(:issue:`1310`).

Bug Fixes
~~~~~~~~~

Expand Down
51 changes: 27 additions & 24 deletions vagrant_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# from the root of the zipline github checkout.
# This will put the zipline code in the
# /vagrant folder in the system.
set -e

VAGRANT_LOG="/home/vagrant/vagrant.log"

Expand All @@ -18,33 +19,35 @@ VAGRANT_LOG="/home/vagrant/vagrant.log"
# (grub-pc will complain that your boot device changed, probably
# due to something that vagrant did, and break your console)

echo "Obstructing updates to grub-pc..."
apt-mark hold grub-pc 2>&1 >> "$VAGRANT_LOG"
echo "Obstructing updates to grub-pc..." | tee -a "$VAGRANT_LOG"
apt-mark hold grub-pc 2>&1 | tee -a "$VAGRANT_LOG"

# Run a full apt-get update first.
echo "Updating apt-get caches..."
apt-get -y update 2>&1 >> "$VAGRANT_LOG"
echo "Adding python apt repo..." | tee -a "$VAGRANT_LOG"
apt-add-repository -y ppa:fkrull/deadsnakes-python2.7 2>&1 | tee -a "$VAGRANT_LOG"
echo "Updating apt-get caches..." | tee -a "$VAGRANT_LOG"
apt-get -y update 2>&1 | tee -a "$VAGRANT_LOG"

# Install required packages
echo "Installing required packages..."
apt-get -y install python-pip python-dev g++ make libfreetype6-dev libpng-dev libopenblas-dev liblapack-dev gfortran 2>&1 >> "$VAGRANT_LOG"
echo "Installing required system packages..." | tee -a "$VAGRANT_LOG"
apt-get -y install python2.7 python-dev g++ make libfreetype6-dev libpng-dev libopenblas-dev liblapack-dev gfortran pkg-config git 2>&1 | tee -a "$VAGRANT_LOG"

# Add ta-lib
echo "Installing ta-lib integration..."
wget http://switch.dl.sourceforge.net/project/ta-lib/ta-lib/0.4.0/ta-lib-0.4.0-src.tar.gz 2>&1 "$VAGRANT_LOG"
tar -xvzf ta-lib-0.4.0-src.tar.gz 2>&1 >> "$VAGRANT_LOG"
echo "Installing ta-lib..." | tee -a "$VAGRANT_LOG"
wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz --no-verbose -a "$VAGRANT_LOG"
tar -xvzf ta-lib-0.4.0-src.tar.gz 2>&1 | tee -a "$VAGRANT_LOG"
cd ta-lib/
./configure --prefix=/usr 2>&1 >> "$VAGRANT_LOG"
make 2>&1 >> "$VAGRANT_LOG"
sudo make install 2>&1 >> "$VAGRANT_LOG"
./configure --prefix=/usr 2>&1 | tee -a "$VAGRANT_LOG"
make 2>&1 | tee -a "$VAGRANT_LOG"
sudo make install 2>&1 | tee -a "$VAGRANT_LOG"
cd ../

# Add Zipline python dependencies
echo "Installing python package dependencies..."
/vagrant/etc/ordered_pip.sh /vagrant/etc/requirements.txt 2>&1 >> "$VAGRANT_LOG"
# Add scipy next (if it's not done now, breaks installing of statsmodels for some reason ??)
echo "Installing scipy..."
pip install scipy==0.12.0 2>&1 >> "$VAGRANT_LOG"
echo "Installing zipline dev python dependencies..."
pip install --exists-action w -r /vagrant/etc/requirements_dev.txt 2>&1 >> "$VAGRANT_LOG"
echo "Finished!"
echo "Installing pip and setuptools..." | tee -a "$VAGRANT_LOG"
wget https://bootstrap.pypa.io/get-pip.py 2>&1 | tee -a "$VAGRANT_LOG"
python get-pip.py 2>&1 >> "$VAGRANT_LOG" | tee -a "$VAGRANT_LOG"
echo "Installing zipline python dependencies..." | tee -a "$VAGRANT_LOG"
/vagrant/etc/ordered_pip.sh /vagrant/etc/requirements.txt 2>&1 | tee -a "$VAGRANT_LOG"
echo "Installing zipline extra python dependencies..." | tee -a "$VAGRANT_LOG"
pip install -r /vagrant/etc/requirements_dev.txt -r /vagrant/etc/requirements_blaze.txt 2>&1 | tee -a "$VAGRANT_LOG"
echo "Installing zipline package itself..." | tee -a "$VAGRANT_LOG"
# Clean out any cython assets. The pip install re-builds them.
find /vagrant/ -type f -name '*.c' -exec rm {} +
pip install -e /vagrant[all] 2>&1 | tee -a "$VAGRANT_LOG"
echo "Finished! zipline repo is in '/vagrant'." | tee -a "$VAGRANT_LOG"

0 comments on commit 7c17027

Please sign in to comment.