forked from azavea/raster-vision
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
63 lines (50 loc) · 1.91 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.require_version ">= 1.8"
$CHANGE_DIR = <<SCRIPT
if ! grep -q "cd /vagrant" "/home/vagrant/.bashrc"; then
echo "cd /vagrant" >> "/home/vagrant/.bashrc"
fi
SCRIPT
DATA_DIR = ENV["RASTER_VISION_DATA_DIR"]
if DATA_DIR.nil?
puts "ERROR: You must set the environment variable: RASTER_VISION_DATA_DIR"
exit 1
end
NOTEBOOK_DIR = ENV["RASTER_VISION_NOTEBOOK_DIR"]
if NOTEBOOK_DIR.nil?
puts "WARN: To use juptyer, You must set the environment variable: RASTER_VISION_NOTEBOOK_DIR"
end
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.define "raster_vision" do |raster_vision|
raster_vision.vm.hostname = "raster-vision"
raster_vision.vm.synced_folder "~/.aws", "/home/vagrant/.aws"
raster_vision.vm.synced_folder DATA_DIR, "/opt/data"
# If RASTER_VISION_NOTEBOOK_DIR is set, sync it to the VM
if NOTEBOOK_DIR and File.directory?(File.expand_path(NOTEBOOK_DIR))
raster_vision.vm.synced_folder NOTEBOOK_DIR, "/opt/notebooks"
end
raster_vision.vm.network "forwarded_port", guest: 8888, host: 8888
raster_vision.vm.network "forwarded_port", guest: 6006, host: 6006
raster_vision.vm.provider :virtualbox do |vb|
vb.memory = 8192
vb.cpus = 2
end
# Change working directory to /vagrant upon session start.
raster_vision.vm.provision "shell", inline: $CHANGE_DIR
if Vagrant::Util::Platform.windows?
raster_vision.vm.provision "shell" do |shell|
shell.binary = true
shell.path = "scripts/provision.sh"
shell.args = "deployment/ansible/raster-vision.yml deployment/ansible/roles.yml"
end
else
raster_vision.vm.provision "ansible" do |ansible|
ansible.playbook = "deployment/ansible/raster-vision.yml"
ansible.galaxy_role_file = "deployment/ansible/roles.yml"
end
end
raster_vision.ssh.forward_agent = true
end
end