diff --git a/vagrantSetup/README.md b/vagrantSetup/README.md new file mode 100644 index 0000000..a328d0c --- /dev/null +++ b/vagrantSetup/README.md @@ -0,0 +1,13 @@ +# dara-vagrant-setup + +Install Vagrant and Virtualbox using +``` +> sudo apt-get update +> sudo apt-get -y upgrade +> sudo apt-get -y install virtualbox vagrant +``` +Install Vagrant DiskSize plugin using the below command: + +``` +> vagrant plugin install vagrant-disksize +``` diff --git a/vagrantSetup/Vagrantfile b/vagrantSetup/Vagrantfile new file mode 100644 index 0000000..dd99601 --- /dev/null +++ b/vagrantSetup/Vagrantfile @@ -0,0 +1,29 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +VM_NAME = "dara_VagrantVM" +VM_MEMORY = "8192" # MB + +Vagrant.configure(2) do |config| + # The online documentation for the configuration options is located at + # https://docs.vagrantup.com + + # Our box + config.vm.box = "ubuntu/xenial64" + config.disksize.size = '50GB' + + # Customize the amount of memory on the VM: + config.vm.provider "virtualbox" do |vb| + vb.name = VM_NAME + vb.memory = VM_MEMORY + end + + # SSH + config.ssh.forward_agent = true + config.ssh.forward_x11 = true + config.ssh.keep_alive = true + + # Custom provisioning and setup script + config.vm.provision :shell, path: "bootstrap.sh" + +end diff --git a/vagrantSetup/bootstrap.sh b/vagrantSetup/bootstrap.sh new file mode 100755 index 0000000..58a846d --- /dev/null +++ b/vagrantSetup/bootstrap.sh @@ -0,0 +1,47 @@ +#!/usr/bin/env bash + +# Variables +GOPATH=/home/vagrant/go +GOROOT_BOOTSTRAP=/usr/local/go +export PATH=$GOPATH/bin:$GOROOT_BOOTSTRAP/bin:$PATH + +LOG=/vagrant/vm_build.log + +# Clear old log contents +> $LOG + +# Installing Go-Lang packages +echo -e "\n--- Installing Go ---\n" +sudo apt-get update >> $LOG 2>&1 +sudo apt-get -y upgrade >> $LOG 2>&1 +wget https://dl.google.com/go/go1.10.linux-amd64.tar.gz >> $LOG 2>&1 +sudo tar -xvf go1.10.linux-amd64.tar.gz >> $LOG 2>&1 +sudo mv go /usr/local +mkdir $GOPATH + +#Setting up vagrant .bashrc +echo 'export GOPATH=/home/vagrant/go' >> /home/vagrant/.bashrc +echo 'export GOROOT_BOOTSTRAP=/usr/local/go' >> /home/vagrant/.bashrc +echo 'export PATH=$GOPATH/bin:$GOROOT_BOOTSTRAP/bin:$PATH' >> /home/vagrant/.bashrc +source /home/vagrant/.bashrc + +# Installing dara packages +echo -e "\n--- Installing dara packages ---\n" +mkdir $GOPATH/src +mkdir $GOPATH/src/github.com +cd $GOPATH/src/github.com +mkdir DARA-Project +mkdir novalagung +cd novalagung +git clone https://github.com/novalagung/go-eek.git >> $LOG 2>&1 +cd ../DARA-Project +git clone https://github.com/DARA-Project/GoDist.git >> $LOG 2>&1 +git clone https://github.com/DARA-Project/GoDist-Scheduler.git >> $LOG 2>&1 +cd $GOPATH/src/github.com/DARA-Project/GoDist/src +sudo apt-get -y install gcc >> $LOG 2>&1 +./make.bash >> $LOG 2>&1 +sudo ln -s $GOPATH/src/github.com/DARA-Project/GoDist/bin/go /usr/bin/dgo +cd $GOPATH/src/github.com/DARA-Project/GoDist-Scheduler +sudo chown -R vagrant:vagrant $GOPATH +chmod +x dependencies.sh +./dependencies.sh >> $LOG 2>&1