forked from raster-foundry/raster-foundry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
82 lines (73 loc) · 3.38 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.require_version ">= 2.1"
ANSIBLE_VERSION = "2.4.6.0"
Vagrant.configure(2) do |config|
config.vm.box = "bento/ubuntu-16.04"
config.vm.synced_folder ".", "/vagrant", disabled: true
config.vm.synced_folder ".", "/opt/raster-foundry", type: "rsync",
rsync__exclude: [".git/", "app-backend/.ensime/",
"app-backend/.ensime_cache/", "app-backend/.idea/",
"app-backend/project/.boot/", "app-backend/project/.ivy/",
"app-backend/project/.sbtboot/", "app-server/**/target/",
"app-backend/**/target/", "worker-tasks/**/target/",
".sbt/", ".node_modules/",
"deployment/ansible/roles/azavea*/"],
rsync__args: ["--verbose", "--archive", "-z"],
rsync__rsync_path: "sudo rsync"
config.vm.synced_folder "~/.aws", "/home/vagrant/.aws"
# application server
config.vm.network :forwarded_port, guest: 9000, host: Integer(ENV.fetch("RF_PORT_9000", 9000))
# backsplash tileserver
config.vm.network :forwarded_port, guest: 8080, host: Integer(ENV.fetch("RF_PORT_8080", 8080))
# nginx-api
config.vm.network :forwarded_port, guest: 9100, host: Integer(ENV.fetch("RF_PORT_9100", 9100))
# nginx backsplash tileserver
config.vm.network :forwarded_port, guest: 8081, host: Integer(ENV.fetch("RF_PORT_8081", 8081))
# spark master
config.vm.network :forwarded_port, guest: 8888, host: Integer(ENV.fetch("RF_PORT_8888", 8888))
# spark worker
config.vm.network :forwarded_port, guest: 8889, host: Integer(ENV.fetch("RF_PORT_8888", 8889))
# spark driver
config.vm.network :forwarded_port, guest: 4040, host: Integer(ENV.fetch("RF_PORT_4040", 4040))
# jmx api
config.vm.network :forwarded_port, guest: 9010, host: Integer(ENV.fetch("RF_PORT_9010", 9010))
# jmx tile
config.vm.network :forwarded_port, guest: 9030, host: Integer(ENV.fetch("RF_PORT_9030", 9030))
config.vm.provider :virtualbox do |vb|
vb.memory = 8096
vb.cpus = 2
end
host_user = ENV.fetch("USER", "vagrant")
aws_profile = ENV.fetch("RF_AWS_PROFILE", "raster-foundry")
rf_settings_bucket = ENV.fetch("RF_SETTINGS_BUCKET",
"rasterfoundry-development-config-us-east-1")
rf_artifacts_bucket = ENV.fetch("RF_ARTIFACTS_BUCKET",
"rasterfoundry-global-artifacts-us-east-1")
config.vm.provision "shell", inline: "mkdir -p /vagrant"
config.vm.provision "ansible_local" do |ansible|
ansible.compatibility_mode = "2.0"
ansible.install = true
ansible.install_mode = "pip_args_only"
ansible.pip_args = "ansible==#{ANSIBLE_VERSION}"
ansible.playbook = "/opt/raster-foundry/deployment/ansible/raster-foundry.yml"
ansible.galaxy_role_file = "/opt/raster-foundry/deployment/ansible/roles.yml"
ansible.galaxy_roles_path = "/opt/raster-foundry/deployment/ansible/roles"
ansible.extra_vars = {
host_user: host_user,
aws_profile: aws_profile,
rf_settings_bucket: rf_settings_bucket,
rf_artifacts_bucket: rf_artifacts_bucket
}
end
config.vm.provision "shell" do |s|
s.inline = <<-SHELL
cd /opt/raster-foundry
export AWS_PROFILE=#{aws_profile}
export RF_SETTINGS_BUCKET=#{rf_settings_bucket}
export RF_ARTIFACTS_BUCKET=#{rf_artifacts_bucket}
su vagrant ./scripts/bootstrap
su vagrant ./scripts/update
SHELL
end
end