Skip to content

Adding Vagrant Setup #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions vagrantSetup/README.md
Original file line number Diff line number Diff line change
@@ -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
```
29 changes: 29 additions & 0 deletions vagrantSetup/Vagrantfile
Original file line number Diff line number Diff line change
@@ -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
47 changes: 47 additions & 0 deletions vagrantSetup/bootstrap.sh
Original file line number Diff line number Diff line change
@@ -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