aboutsummaryrefslogtreecommitdiff
path: root/bigtop-deploy
diff options
context:
space:
mode:
authorjay@apache.org <jay@apache.org>2014-09-30 21:46:40 -0400
committerjay@apache.org <jayunit100>2014-10-07 21:53:38 -0400
commit04802cc5960c06108219e1ec886c895367798f7b (patch)
tree28a45701ffbce89baa92271fb78d134553872796 /bigtop-deploy
parentcff10fbe2a70a729591d5ab88a32917e4e858ab3 (diff)
BIGTOP-1449. Add RC Testing to vagrant recipe.
Diffstat (limited to 'bigtop-deploy')
-rwxr-xr-xbigtop-deploy/vm/vagrant-puppet/Vagrantfile32
-rwxr-xr-xbigtop-deploy/vm/vagrant-puppet/provision.sh9
-rwxr-xr-xbigtop-deploy/vm/vagrant-puppet/smoke-tests.sh21
3 files changed, 50 insertions, 12 deletions
diff --git a/bigtop-deploy/vm/vagrant-puppet/Vagrantfile b/bigtop-deploy/vm/vagrant-puppet/Vagrantfile
index c6825ad8..ffe23a92 100755
--- a/bigtop-deploy/vm/vagrant-puppet/Vagrantfile
+++ b/bigtop-deploy/vm/vagrant-puppet/Vagrantfile
@@ -20,14 +20,16 @@ VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
vmbox = "puppetlab-centos-64-nocm"
+ # Repository
+ # Example for testing a Release candidate.
+ repo = "http://bigtop01.cloudera.org:8080/view/Releases/job/Bigtop-0.8.0/label=centos6/6/artifact/output/"
+ # repo = "http://bigtop.s3.amazonaws.com/releases/0.7.0/redhat/6/x86_64"
+
# Virtual box implementation
vmboxurl = "http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210-nocm.box"
# number of instances
- num_instances = 3
-
- # the bigtop puppet recipes
- bigtop_puppet = "../../puppet"
+ num_instances = 1
# manage /etc/hosts by hostmanager plugin(https://github.com/smdahlen/vagrant-hostmanager)
# use vagrant-cachier to cache packages at local(https://github.com/fgrehm/vagrant-cachier)
@@ -56,29 +58,39 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
end
bigtop.vm.provider :virtualbox do |vb|
- vb.customize ["modifyvm", :id, "--memory", "1024"]
+ vb.customize ["modifyvm", :id, "--memory", "10024"]
end
bigtop.vm.network :private_network, ip: bigtop_ip
bigtop.vm.hostname = bigtop_hostname
- bigtop.vm.synced_folder bigtop_puppet, "/bigtop-puppet"
+ # three levels up is the bigtop "home" directory.
+ # the current directory has puppet recipes which we need for provisioning.
+ bigtop.vm.synced_folder "../../../", "/bigtop-home"
# shell provisioner to setup basic vm environment
bigtop.vm.provision :shell do |shell|
shell.path = "provision.sh"
- shell.args = bigtop_master
+ shell.args = [ bigtop_master , repo ]
end
bigtop.vm.provision :hostmanager
# deploy Apache Hadoop and it's ecosystem
bigtop.vm.provision :puppet do |puppet|
- puppet.module_path = bigtop_puppet + "/modules"
- puppet.manifests_path = bigtop_puppet + "/manifests"
+ puppet.module_path = "../../puppet/modules/"
+ puppet.manifests_path = "../../puppet/manifests/"
puppet.manifest_file = "site.pp"
- puppet.options = "--debug --confdir=/bigtop-puppet"
+ puppet.options = "--debug --confdir=/bigtop-home/bigtop-deploy/puppet/"
end
+
+ if i==num_instances then
+ puts "creating provisioner directive for running tests"
+ bigtop.vm.provision "shell", path: "smoke-tests.sh"
+ else
+ puts "Not creating provisioner directive for tests yet... only on vm #{i} of #{num_instances}"
+ end
+
end
end
diff --git a/bigtop-deploy/vm/vagrant-puppet/provision.sh b/bigtop-deploy/vm/vagrant-puppet/provision.sh
index 1cf37246..fa0571b3 100755
--- a/bigtop-deploy/vm/vagrant-puppet/provision.sh
+++ b/bigtop-deploy/vm/vagrant-puppet/provision.sh
@@ -23,11 +23,13 @@ service iptables stop
chkconfig iptables off
cat /dev/null > /etc/hosts
+echo "Bigtop yum repo = $2"
+
# Prepare puppet configuration file
-cat > /bigtop-puppet/config/site.csv << EOF
+cat > /bigtop-home/bigtop-deploy/puppet/config/site.csv << EOF
hadoop_head_node,$1
hadoop_storage_dirs,/data/1,/data/2
-bigtop_yumrepo_uri,http://bigtop.s3.amazonaws.com/releases/0.7.0/redhat/6/x86_64
+bigtop_yumrepo_uri,$2
jdk_package_name,java-1.7.0-openjdk-devel.x86_64
components,hadoop,hbase,yarn,mapred-app
EOF
@@ -39,3 +41,6 @@ mkdir -p /data/{1,2}
yum -y install rng-tools
sed -i.bak 's/EXTRAOPTIONS=\"\"/EXTRAOPTIONS=\"-r \/dev\/urandom\"/' /etc/sysconfig/rngd
service rngd start
+
+echo "Now installing gradle"
+cd /bigtop-home && puppet apply --modulepath=./ -e "include bigtop_toolchain::gradle" # alias gradle=/usr/local/gradle/bin/gradle
diff --git a/bigtop-deploy/vm/vagrant-puppet/smoke-tests.sh b/bigtop-deploy/vm/vagrant-puppet/smoke-tests.sh
new file mode 100755
index 00000000..d02c128d
--- /dev/null
+++ b/bigtop-deploy/vm/vagrant-puppet/smoke-tests.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+HCFS_USER="hdfs"
+gradle="/usr/local/gradle/bin/gradle"
+
+export HADOOP_CONF_DIR=/etc/hadoop/conf/
+export BIGTOP_HOME=/bigtop-home/
+export HADOOP_MAPRED_HOME=/usr/lib/hadoop-mapreduce/
+export HIVE_HOME=/usr/lib/hive/
+export PIG_HOME=/usr/lib/pig/
+export FLUME_HOME=/usr/lib/flume/
+export HIVE_CONF_DIR=/etc/hive/conf/
+export JAVA_HOME="/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.65.x86_64/"
+export MAHOUT_HOME="/usr/lib/mahout"
+export ITEST="0.7.0"
+
+su -s /bin/bash $HCFS_USER -c '/usr/bin/hadoop fs -mkdir /user/vagrant /user/root'
+su -s /bin/bash $HCFS_USER -c 'hadoop fs -chmod 777 /user/vagrant'
+su -s /bin/bash $HCFS_USER -c 'hadoop fs -chmod 777 /user/root'
+
+yum install -y pig hive flume mahout
+cd /bigtop-home/bigtop-tests/smoke-tests && $gradle compileGroovy test -Dsmoke.tests=pig --info