-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
60 lines (55 loc) · 1.98 KB
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#Define the list of machines
slurm_cluster = {
:controller => {
:hostname => "controller",
:ipaddress => "10.10.10.3"
},
:server => {
:hostname => "server",
:ipaddress => "10.10.10.4"
}
}
$provision_script = <<SCRIPT
echo "10.10.10.3 controller" >> /etc/hosts
echo "10.10.10.4 server" >> /etc/hosts
#provision dependencies
sudo add-apt-repository "deb http://us.archive.ubuntu.com/ubuntu/ precise universe multiverse"
sudo apt-get update -qq
#note: running the following apt-get commands as one liner used to generate errors messages such as
#'Failed to fetch http://.../blahblah.deb 403 Forbidden [IP: 91.189.88.152 80]'
sudo apt-get install -qq unzip
sudo apt-get install -qq python-pip
sudo apt-get install -qq libjson-c2
sudo apt-get install -qq libjson-c-dev
sudo apt-get install -qq libmunge2
sudo apt-get install -qq libmunge-dev
sudo apt-get install -qq libcurl4-openssl-dev
sudo apt-get install -qq autoconf
sudo apt-get install -qq automake
sudo apt-get install -qq libtool
sudo apt-get install -qq curl
sudo apt-get install -qq make
sudo apt-get install -qq xfsprogs
sudo apt-get install -qq squashfs-tools
sudo apt-get install -qq mongodb
sudo apt-get install -qq redis-server
#install shifter system
/shared-folder/installation/install-munge.sh
/shared-folder/installation/install-slurm.sh
/shared-folder/installation/install-shifter.sh
SCRIPT
Vagrant.configure("2") do |global_config|
slurm_cluster.each_pair do |name, options|
global_config.vm.define name do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.hostname = "#{name}"
config.vm.network :private_network, ip: options[:ipaddress]
config.vm.synced_folder "shared-folder", "/shared-folder"
config.vm.provider :virtualbox do |v|
v.customize ["modifyvm", :id, "--memory", "2048"]
end
config.vm.provision :shell,
:inline => $provision_script
end
end
end