Browse Source

Merge "Add Vagrant sample file to ease development environment bootstrap."

Jenkins 3 years ago
parent
commit
26f3eb0484

+ 29
- 0
tools/vagrant/ubuntu/README.md View File

@@ -0,0 +1,29 @@
1
+Note
2
+======
3
+
4
+Only tested on Vagrant 1.7.x + VirtualBox 4.3
5
+
6
+It will install JDK8, ElasticSeach, Kafka, Virtualenv, and VirtualenvWrapper for you.
7
+
8
+Usage
9
+======
10
+
11
+Create your own Vagrant config. file
12
+
13
+```
14
+  cp ubuntu-virtualbox.yml.sample ubuntu-virtualbox.yml
15
+```
16
+
17
+You can change VM memory, Kafka, or ElasticSearch package URL.
18
+
19
+```
20
+  vagrant up
21
+```
22
+
23
+Under /vagrant folder you can find kiloeyes project and Kafka uncompress folders.
24
+
25
+Use below command to start ElasticSearch:
26
+
27
+```
28
+  sudo /etc/init.d/elasticsearch start
29
+```

+ 50
- 0
tools/vagrant/ubuntu/Vagrantfile View File

@@ -0,0 +1,50 @@
1
+# -*- mode: ruby -*-
2
+# vi: set ft=ruby :
3
+require 'yaml'
4
+
5
+config_file=File.expand_path(File.join(File.dirname(__FILE__), 'ubuntu-virtualbox.yml'))
6
+settings=YAML.load_file(config_file)
7
+
8
+VM_MEM = settings['vm_memory']
9
+KAFKA_URL = settings['kafka_url']
10
+# ElasticSearch URL
11
+ES_URL = settings['elasticsearch_url']
12
+
13
+# All Vagrant configuration is done below. The "2" in Vagrant.configure
14
+# configures the configuration version (we support older styles for
15
+# backwards compatibility). Please don't change it unless you know what
16
+# you're doing.
17
+Vagrant.configure(2) do |config|
18
+  # The most common configuration options are documented and commented below.
19
+  # For a complete reference, please see the online documentation at
20
+  # https://docs.vagrantup.com.
21
+
22
+  # Every Vagrant development environment requires a box. You can search for
23
+  # boxes at https://atlas.hashicorp.com/search.
24
+  config.vm.box = "ubuntu/trusty64"
25
+
26
+  config.vm.provider "virtualbox" do |vb|
27
+  #   # Display the VirtualBox GUI when booting the machine
28
+  #   vb.gui = true
29
+  #
30
+  #   # Customize the amount of memory on the VM:
31
+     vb.memory = VM_MEM
32
+     config.vm.network "private_network", ip: "192.168.0.10"
33
+   end
34
+  
35
+   config.vm.provision "shell", inline: <<-SHELL
36
+     echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | sudo tee /etc/apt/sources.list.d/webupd8team-java.list
37
+     echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | sudo tee -a /etc/apt/sources.list.d/webupd8team-java.list
38
+     sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886
39
+     sudo apt-get update
40
+     sudo apt-get install -y git build-essential python-pip python-dev vim 
41
+     sudo apt-get install -y virtualenvwrapper
42
+     cd /vagrant && sudo git clone https://github.com/openstack/kiloeyes.git
43
+     echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections
44
+     echo debconf shared/accepted-oracle-license-v1-1 seen true | sudo debconf-set-selections
45
+     sudo apt-get install -y oracle-java8-installer
46
+     cd /vagrant && wget #{KAFKA_URL} -O - | tar -zxvf - -C /vagrant 
47
+     wget #{ES_URL} -O /tmp/es.deb && sudo dpkg -i /tmp/es.deb
48
+     echo source /usr/share/virtualenvwrapper/virtualenvwrapper_lazy.sh | tee -a ~/.profile
49
+   SHELL
50
+end

+ 6
- 0
tools/vagrant/ubuntu/ubuntu-virtualbox.yml.sample View File

@@ -0,0 +1,6 @@
1
+---
2
+
3
+vm_memory: 8192
4
+kafka_url: http://apache.stu.edu.tw/kafka/0.9.0.0/kafka_2.11-0.9.0.0.tgz 
5
+elasticsearch_url: https://download.elasticsearch.org/elasticsearch/release/org/elasticsearch/distribution/deb/elasticsearch/2.1.0/elasticsearch-2.1.0.deb
6
+

Loading…
Cancel
Save