forked from rstudio/rstudio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
102 lines (90 loc) · 3.44 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# -*- mode: ruby -*-
# vi: set ft=ruby :
# This file defines a set of virtual machines which can be used together to
# create a variety of RStudio Server configurations. Because order matters (the
# machines will access each other to orchestrate configuration), here are some
# recipe orders for typical configs:
#
# Single server:
# primary
#
# Single server with user dirs on NFS:
# primary, nfs
#
# Simple load balanced configuration:
# primary, nfs, balanced
#
# Load balanced configuration with auth via LDAP:
# primary, nfs, balanced, ldap
Vagrant.configure(2) do |config|
# define primary development box
config.vm.define "primary", primary: true do |p|
p.vm.box = "ubuntu/trusty64"
p.vm.network "private_network", ip: "192.168.55.101"
p.vm.network "forwarded_port", guest: 8787, host: 8787, auto_correct: true
p.vm.provision :shell, path: "vagrant/bootstrap-debian.sh", args: 8787
p.vm.provision :shell, path: "vagrant/provision-primary.sh"
# this machine is used for building; give it liberal resources
p.vm.provider "virtualbox" do |vb|
vb.memory = "4096"
vb.cpus = "4"
end
end
# define secondary box for development of load balanced features. if you want
# to use this box, make sure you bring up the NFS box (below) first, since
# load balancing requires a shared file system.
config.vm.define "balanced", autostart: false do |b|
b.vm.box = "ubuntu/trusty64"
b.vm.network "private_network", ip: "192.168.55.102"
b.vm.network "forwarded_port", guest: 8787, host: 8788, auto_correct: true
b.vm.provision :shell, path: "vagrant/bootstrap-debian.sh", args: 8787
b.vm.provision :shell, path: "vagrant/provision-balancer.sh"
# primarily used for serving R
b.vm.provider "virtualbox" do |vb|
vb.memory = "2048"
vb.cpus = "2"
end
end
# define NFS box; can be used with or without the load balancer.
config.vm.define "nfs", autostart: false do |n|
n.vm.box = "ubuntu/trusty64"
n.vm.network "private_network", ip: "192.168.55.103"
n.vm.provision :shell, path: "vagrant/provision-nfs.sh"
# just a file server
n.vm.provider "virtualbox" do |vb|
vb.memory = "1024"
vb.cpus = "1"
end
end
# define an LDAP box; can be used with or without the load balancer, but
# must only be started once all the servers are up since it configures them
config.vm.define "ldap", autostart: false do |l|
l.vm.box = "ubuntu/trusty64"
l.vm.network "private_network", ip: "192.168.55.104"
l.vm.provision :shell, path: "vagrant/provision-ldap-server.sh"
l.vm.provider "virtualbox" do |vb|
vb.memory = "1024"
vb.cpus = "1"
end
end
# define CentOS development box -- similar to primary box, but currently only
# operates in standalone mode
config.vm.define "centos", autostart: false do |c|
c.vm.box = "puphpet/centos65-x64"
c.vm.network "forwarded_port", guest: 8787, host: 8787, auto_correct: true
c.vm.provision :shell, path: "vagrant/bootstrap-centos.sh", args: 8787
c.vm.provision :shell, path: "vagrant/provision-primary.sh"
c.vm.provider "virtualbox" do |vb|
vb.memory = "2048"
vb.cpus = "2"
end
end
# less generous resources (and a box that supports hyperv) on hyper-v
config.vm.provider "hyperv" do |hv|
hv.vm.box = "ericmann/trusty64"
hv.memory = "1024"
hv.cpus = "2"
end
config.vm.synced_folder ".", "/rstudio"
config.vm.synced_folder ".", "/home/vagrant/rstudio"
end