Skip to content

Instantly share code, notes, and snippets.

@jtyberg
Last active August 29, 2015 14:13
Show Gist options
  • Save jtyberg/6fa3b97ce063245d4f57 to your computer and use it in GitHub Desktop.
Save jtyberg/6fa3b97ce063245d4f57 to your computer and use it in GitHub Desktop.
IPython-dev-vagrant

Bring up vagrant

vagrant up ipython
vagrant ssh ipython

Install OS pkgs

sudo apt-get -yq install python python-pip python-dev build-essential
sudo pip install virtualenv

Create a virtualenv

cd /vagrant
virtualenv --system-site-packages env_ipython
source env_ipython/bin/activate

Clone ipython master

git clone --recursive https://github.com/ipython/ipython.git

Install notebook deps

cd ipython
pip install -e ".[notebook]"

Start notebook server

  • --no-browser don't start browser from command line
  • --ip=* bind notebook server to all ips on the guest VM
/vagrant/env_ipython/bin/ipython notebook --no-browser --ip=*
# -*- mode: ruby -*-
# vi: set ft=ruby :
$script = <<SCRIPT
sudo apt-get -y install linux-image-extra-$(uname -r)
sudo sh -c "wget -qO- https://get.docker.io/gpg | apt-key add -"
sudo sh -c "echo deb http://get.docker.io/ubuntu docker main\ > /etc/apt/sources.list.d/docker.list"
sudo apt-get update
sudo apt-get -y install lxc-docker
sudo usermod -a -G docker vagrant
sudo service docker stop
sudo service docker start
SCRIPT
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.provision :shell, :inline => $script
config.vm.box = "ubuntu/trusty64"
config.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--natdnsproxy1", "off" ]
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "off" ]
vb.customize ["modifyvm", :id, "--memory", "4096"]
vb.customize ["modifyvm", :id, "--cpus", "4"]
end
# ipython for development
config.vm.define "ipython" do |box|
box.vm.network "private_network", ip: "192.168.12.10"
box.vm.hostname = "ipython"
box.vm.synced_folder ".", "/vagrant"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment