Skip to content

Instantly share code, notes, and snippets.

@arjunguha
Last active August 29, 2015 14:04
Show Gist options
  • Select an option

  • Save arjunguha/c6805f0ce77143b413b8 to your computer and use it in GitHub Desktop.

Select an option

Save arjunguha/c6805f0ce77143b413b8 to your computer and use it in GitHub Desktop.
Frenetic Vagrantfile
Vagrant.require_version ">= 1.6.0", "< 1.7.0"
$script = <<EOF
set -x
apt-get update
apt-get upgrade -yq
apt-get install -y \
virtualbox-guest-x11 \
opam \
ocaml-native-compilers \
camlp4-extra \
wireshark \
m4 \
mininet \
git \
xterm \
fortune
# Stop OVS Controller so we can run Frenetic
service openvswitch-controller stop
update-rc.d openvswitch-controller disable
EOF
$userScript = <<EOF
set -x
opam init -y
opam config env
echo 'eval `opam config env`' >> /home/vagrant/.profile
opam repository add frenetic https://github.com/frenetic-lang/opam-bleeding.git
opam install -y packet async quickcheck cmdliner ipaddr ulex
git clone -b async-111.25 https://github.com/frenetic-lang/ocaml-openflow.git
cd ocaml-openflow
git pull
make
make reinstall
opam install -y topology
git clone -b async-111.25 https://github.com/frenetic-lang/frenetic.git
cd frenetic
git pull
make
make reinstall
EOF
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.provider "virtualbox" do |v|
v.memory = 2048
v.cpus = 2
end
config.ssh.forward_x11 = true
config.vm.provision "shell", inline: $script
config.vm.provision "shell", privileged: false, inline: $userScript
config.vm.synced_folder ".", "/vagrant"
config.vm.synced_folder ".", "/home/vagrant/src"
config.vm.hostname = "frenetic"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment