From: <dme...@us...> - 2014-01-04 02:38:38
|
Revision: 7713 http://bigdata.svn.sourceforge.net/bigdata/?rev=7713&view=rev Author: dmekonnen Date: 2014-01-04 02:38:30 +0000 (Sat, 04 Jan 2014) Log Message: ----------- initial commit of a vagrant provisioner. Added Paths: ----------- trunk/src/resources/deployment/ trunk/src/resources/deployment/vagrant/ trunk/src/resources/deployment/vagrant/systap-bigdata/ trunk/src/resources/deployment/vagrant/systap-bigdata/Berksfile trunk/src/resources/deployment/vagrant/systap-bigdata/Berksfile.lock trunk/src/resources/deployment/vagrant/systap-bigdata/CHANGELOG.md trunk/src/resources/deployment/vagrant/systap-bigdata/Gemfile trunk/src/resources/deployment/vagrant/systap-bigdata/README.md trunk/src/resources/deployment/vagrant/systap-bigdata/Thorfile trunk/src/resources/deployment/vagrant/systap-bigdata/Vagrantfile trunk/src/resources/deployment/vagrant/systap-bigdata/attributes/ trunk/src/resources/deployment/vagrant/systap-bigdata/attributes/default.rb trunk/src/resources/deployment/vagrant/systap-bigdata/chefignore trunk/src/resources/deployment/vagrant/systap-bigdata/definitions/ trunk/src/resources/deployment/vagrant/systap-bigdata/files/ trunk/src/resources/deployment/vagrant/systap-bigdata/files/default/ trunk/src/resources/deployment/vagrant/systap-bigdata/files/default/test/ trunk/src/resources/deployment/vagrant/systap-bigdata/files/default/test/default_test.rb trunk/src/resources/deployment/vagrant/systap-bigdata/libraries/ trunk/src/resources/deployment/vagrant/systap-bigdata/metadata.rb trunk/src/resources/deployment/vagrant/systap-bigdata/providers/ trunk/src/resources/deployment/vagrant/systap-bigdata/recipes/ trunk/src/resources/deployment/vagrant/systap-bigdata/recipes/configure.rb trunk/src/resources/deployment/vagrant/systap-bigdata/recipes/default.rb trunk/src/resources/deployment/vagrant/systap-bigdata/resources/ trunk/src/resources/deployment/vagrant/systap-bigdata/templates/ trunk/src/resources/deployment/vagrant/systap-bigdata/templates/default/ Added: trunk/src/resources/deployment/vagrant/systap-bigdata/Berksfile =================================================================== --- trunk/src/resources/deployment/vagrant/systap-bigdata/Berksfile (rev 0) +++ trunk/src/resources/deployment/vagrant/systap-bigdata/Berksfile 2014-01-04 02:38:30 UTC (rev 7713) @@ -0,0 +1,7 @@ +site :opscode + +cookbook "apt" +cookbook "java", "~> 1.14.0" +cookbook "tomcat" + +metadata Added: trunk/src/resources/deployment/vagrant/systap-bigdata/Berksfile.lock =================================================================== --- trunk/src/resources/deployment/vagrant/systap-bigdata/Berksfile.lock (rev 0) +++ trunk/src/resources/deployment/vagrant/systap-bigdata/Berksfile.lock 2014-01-04 02:38:30 UTC (rev 7713) @@ -0,0 +1,28 @@ +{ + "sources": { + "apt": { + "locked_version": "2.2.0" + }, + "java": { + "locked_version": "1.14.0" + }, + "tomcat": { + "locked_version": "0.15.2" + }, + "systap-bigdata": { + "path": "." + }, + "windows": { + "locked_version": "1.10.0" + }, + "chef_handler": { + "locked_version": "1.1.4" + }, + "aws": { + "locked_version": "1.0.0" + }, + "openssl": { + "locked_version": "1.1.0" + } + } +} Added: trunk/src/resources/deployment/vagrant/systap-bigdata/CHANGELOG.md =================================================================== --- trunk/src/resources/deployment/vagrant/systap-bigdata/CHANGELOG.md (rev 0) +++ trunk/src/resources/deployment/vagrant/systap-bigdata/CHANGELOG.md 2014-01-04 02:38:30 UTC (rev 7713) @@ -0,0 +1,8 @@ +# CHANGELOG for systap-bigdata + +This file is used to list changes made in each version of systap-bigdata. + +## 0.1.0: + +* Initial release of systap-bigdata + Added: trunk/src/resources/deployment/vagrant/systap-bigdata/Gemfile =================================================================== --- trunk/src/resources/deployment/vagrant/systap-bigdata/Gemfile (rev 0) +++ trunk/src/resources/deployment/vagrant/systap-bigdata/Gemfile 2014-01-04 02:38:30 UTC (rev 7713) @@ -0,0 +1,3 @@ +source 'https://rubygems.org' + +gem 'berkshelf' Added: trunk/src/resources/deployment/vagrant/systap-bigdata/README.md =================================================================== --- trunk/src/resources/deployment/vagrant/systap-bigdata/README.md (rev 0) +++ trunk/src/resources/deployment/vagrant/systap-bigdata/README.md 2014-01-04 02:38:30 UTC (rev 7713) @@ -0,0 +1,114 @@ +systap-bigdata Cookbook +====================== +This cookbook provides [http://www.bigdata.com/bigdata/blog/](bigdata v1.3.0) under Tomcat 7 (latest), with Oracle JDK 7 (latest) within an Ubuntu 12.0.4 VM. + +Typical synopsis: + + % vagrant up + + The bigdata service is then available at: http://33.33.33.10:8080/bigdata/ + + +Requirements +------------ + +#### packages +In a stand alone context, this cookbook assumes the following resources have been installed: + +* `VirtualBox` - Virtual machine provider [http://virtualbox.org/](http://virtualbox.org/) +* `Vagrant` - Environment assembler [http://vagrantup.com/](http://vagrantup.com/) +* `Berkshelf` - The Berkshelf cookbook manager [http://berkshelf.com/](http://berkshelf.com/). + + +#### cookbook dependencies +Chef 10.14.2 or higher - has not been tested with previous versions. + +The following Opscode cookbooks are dependencies (automatically retrieved by `Berkshelf`): + +* apt +* java +* tomcat + + + +Attributes +---------- + + +#### systap-bigdata::default +<table> + <tr> + <th>Key</th> + <th>Type</th> + <th>Description</th> + <th>Default</th> + </tr> + <tr> + <td><tt>url</tt></td> + <td>String</td> + <td>where to download the bigdata.war file form</td> + <td><tt>http://sourceforge.net/projects/bigdata/ + files/bigdata/1.3.0/bigdata.war/download</tt></td> + </tr> + <tr> + <td><tt>home</tt></td> + <td>String</td> + <td>where the extracted bigdata.war contents are found</td> + <td>Default: <tt>/var/lib/tomcat7/webapps/bigdata</tt></td> + </tr> + <tr> + <td><tt>etc</tt></td> + <td>String</td> + <td>Where under the tomcat root the log files and the bigdata.jni should reside. Discussed in <a href="http://sourceforge.net/apps/mediawiki/bigdata/index.php?title=NanoSparqlServer#Common_Startup_Problems">"Common Startup Problmems</a></td> + <td>Default: <tt>/var/lib/tomcat7/webapps/bigdata/etc</tt></td> + </tr> +</table> + + +Usage +----- +### Stand Alone Context +To bring the VM up the first time, or any future time after a `halt`, invoke from the cookbook directory: + + % vagrant up + +The cookbbok will retrieve the Ubuntu 12.04 VM, Oracle's JDK 7, Apahce's Tomcat 7 and the Bigdata WAR file. These downloads may take a significant amount of time to complete. Should a download be interupted or some other error occur, continue with: + + % vagrant provision + +Once complete, the bigdata server will be available under: + [http://33.33.33.10:8080/bigdata/](http://33.33.33.10:8080/bigdata/) + +To halt the VM: + + % vagrant halt + +To delete the VM and from VirtualBox: + + % vagrant destroy + +To login into the VM: + + % vagrant ssh + + +### Cookbook Context + +To use as a reciple in new cookbook, just include `systap-bigdata` in your node's `run_list` in the standard way: + +``` + "run_list": [ + "recipe[systap-bigdata::default]", + ... + ] + +``` + + +License and Authors +------------------- +Author:: Daniel Mekonnen [daniel<no-spam-at>systap.com] + +``` +This pakcage may be resiributed under the same terms and conditions as the Bigdata project that it is a part of. +``` Added: trunk/src/resources/deployment/vagrant/systap-bigdata/Thorfile =================================================================== --- trunk/src/resources/deployment/vagrant/systap-bigdata/Thorfile (rev 0) +++ trunk/src/resources/deployment/vagrant/systap-bigdata/Thorfile 2014-01-04 02:38:30 UTC (rev 7713) @@ -0,0 +1,5 @@ +# encoding: utf-8 + +require 'bundler' +require 'bundler/setup' +require 'berkshelf/thor' Added: trunk/src/resources/deployment/vagrant/systap-bigdata/Vagrantfile =================================================================== --- trunk/src/resources/deployment/vagrant/systap-bigdata/Vagrantfile (rev 0) +++ trunk/src/resources/deployment/vagrant/systap-bigdata/Vagrantfile 2014-01-04 02:38:30 UTC (rev 7713) @@ -0,0 +1,94 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : +Vagrant.require_plugin "vagrant-berkshelf" + +Vagrant.configure("2") do |config| + # All Vagrant configuration is done here. The most common configuration + # options are documented and commented below. For a complete reference, + # please see the online documentation at vagrantup.com. + + config.vm.hostname = "systap-bigdata" + + # Every Vagrant virtual environment requires a box to build off of. + config.vm.box = "precise64" + + # The url from where the 'config.vm.box' box will be fetched if it + # doesn't already exist on the user's system. + # config.vm.box_url = "http://repo.px.net/vagrant/#{config.vm.box}.box" + config.vm.box_url = "http://files.vagrantup.com/precise64.box" + + # Assign this VM to a host-only network IP, allowing you to access it + # via the IP. Host-only networks can talk to the host machine as well as + # any other machines on the same network, but cannot be accessed (through this + # network interface) by any external networks. + config.vm.network :private_network, ip: "33.33.33.10" + + # Create a public network, which generally matched to bridged network. + # Bridged networks make the machine appear as another physical device on + # your network. + + # config.vm.network :public_network + + # Create a forwarded port mapping which allows access to a specific port + # within the machine from a port on the host machine. In the example below, + # accessing "localhost:8080" will access port 80 on the guest machine. + + # Share an additional folder to the guest VM. The first argument is + # the path on the host to the actual folder. The second argument is + # the path on the guest to mount the folder. And the optional third + # argument is a set of non-required options. + # config.vm.synced_folder "../data", "/vagrant_data" + + # Provider-specific configuration so you can fine-tune various + # backing providers for Vagrant. These expose provider-specific options. + # Example for VirtualBox: + # + # config.vm.provider :virtualbox do |vb| + # # Don't boot with headless mode + # vb.gui = true + # + # # Use VBoxManage to customize the VM. For example to change memory: + # vb.customize ["modifyvm", :id, "--memory", "1024"] + # end + # + # View the documentation for the provider you're using for more + # information on available options. + + # The path to the Berksfile to use with Vagrant Berkshelf + # config.berkshelf.berksfile_path = "./Berksfile" + + # Enabling the Berkshelf plugin. To enable this globally, add this configuration + # option to your ~/.vagrant.d/Vagrantfile file + config.berkshelf.enabled = true + + # An array of symbols representing groups of cookbook described in the Vagrantfile + # to exclusively install and copy to Vagrant's shelf. + # config.berkshelf.only = [] + + # An array of symbols representing groups of cookbook described in the Vagrantfile + # to skip installing and copying to Vagrant's shelf. + # config.berkshelf.except = [] + + config.vm.provision :chef_solo do |chef| + chef.json = { + "systap-bigdata" => { + # "1.3.0" => { :version => "1.3.5", :url => "http://repo.px.net/software/bigdata-1.3.0.war" + }, + :tomcat => { + :base_version => "7" + }, + :java => { + "install_flavor" => "oracle", + :jdk_version => "7", + :oracle => { 'accept_oracle_download_terms' => true } + } + } + + chef.run_list = [ + "recipe[apt]", + "recipe[java]", + "recipe[tomcat::default]", + "recipe[systap-bigdata::default]" + ] + end +end Added: trunk/src/resources/deployment/vagrant/systap-bigdata/attributes/default.rb =================================================================== --- trunk/src/resources/deployment/vagrant/systap-bigdata/attributes/default.rb (rev 0) +++ trunk/src/resources/deployment/vagrant/systap-bigdata/attributes/default.rb 2014-01-04 02:38:30 UTC (rev 7713) @@ -0,0 +1,6 @@ +default['tomcat']['base_version'] = 7 +default['systap-bigdata'][:url] = "http://sourceforge.net/projects/bigdata/files/bigdata/1.3.0/bigdata.war/download" + +webapp_dir = node['tomcat']['webapp_dir'] +default['systap-bigdata'][:home] = webapp_dir + "/bigdata" +default['systap-bigdata'][:etc] = webapp_dir + "/bigdata/etc" Added: trunk/src/resources/deployment/vagrant/systap-bigdata/chefignore =================================================================== --- trunk/src/resources/deployment/vagrant/systap-bigdata/chefignore (rev 0) +++ trunk/src/resources/deployment/vagrant/systap-bigdata/chefignore 2014-01-04 02:38:30 UTC (rev 7713) @@ -0,0 +1,96 @@ +# Put files/directories that should be ignored in this file when uploading +# or sharing to the community site. +# Lines that start with '# ' are comments. + +# OS generated files # +###################### +.DS_Store +Icon? +nohup.out +ehthumbs.db +Thumbs.db + +# SASS # +######## +.sass-cache + +# EDITORS # +########### +\#* +.#* +*~ +*.sw[a-z] +*.bak +REVISION +TAGS* +tmtags +*_flymake.* +*_flymake +*.tmproj +.project +.settings +mkmf.log + +## COMPILED ## +############## +a.out +*.o +*.pyc +*.so +*.com +*.class +*.dll +*.exe +*/rdoc/ + +# Testing # +########### +.watchr +.rspec +spec/* +spec/fixtures/* +test/* +features/* +Guardfile +Procfile + +# SCM # +####### +.git +*/.git +.gitignore +.gitmodules +.gitconfig +.gitattributes +.svn +*/.bzr/* +*/.hg/* +*/.svn/* + +# Berkshelf # +############# +Berksfile +Berksfile.lock +cookbooks/* +tmp + +# Cookbooks # +############# +CONTRIBUTING +CHANGELOG* + +# Strainer # +############ +Colanderfile +Strainerfile +.colander +.strainer + +# Vagrant # +########### +.vagrant +Vagrantfile + +# Travis # +########## +.travis.yml Added: trunk/src/resources/deployment/vagrant/systap-bigdata/files/default/test/default_test.rb =================================================================== --- trunk/src/resources/deployment/vagrant/systap-bigdata/files/default/test/default_test.rb (rev 0) +++ trunk/src/resources/deployment/vagrant/systap-bigdata/files/default/test/default_test.rb 2014-01-04 02:38:30 UTC (rev 7713) @@ -0,0 +1,6 @@ +require 'minitest/spec' +describe_recipe 'systap-bigdata::test' do + it "is running the tomcat server" do + service('tomcat').must_be_running + end +end Added: trunk/src/resources/deployment/vagrant/systap-bigdata/metadata.rb =================================================================== --- trunk/src/resources/deployment/vagrant/systap-bigdata/metadata.rb (rev 0) +++ trunk/src/resources/deployment/vagrant/systap-bigdata/metadata.rb 2014-01-04 02:38:30 UTC (rev 7713) @@ -0,0 +1,10 @@ +name 'systap-bigdata' +maintainer 'Daniel Mekonnen' +maintainer_email 'daniel<no-spam-at>systap.com' +license 'All rights reserved' +description 'Installs/Configures systap-bigdata' +long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +version '0.1.0' +depends 'apt' +depends 'java' +depends 'tomcat' Added: trunk/src/resources/deployment/vagrant/systap-bigdata/recipes/configure.rb =================================================================== --- trunk/src/resources/deployment/vagrant/systap-bigdata/recipes/configure.rb (rev 0) +++ trunk/src/resources/deployment/vagrant/systap-bigdata/recipes/configure.rb 2014-01-04 02:38:30 UTC (rev 7713) @@ -0,0 +1,48 @@ +# +# Cookbook Name:: systap-bigdata +# Recipe:: configure +# +# Copyright 2013, Systap +# +# +include_recipe "tomcat" + +directory node['systap-bigdata'][:etc] do + owner node['tomcat']['user'] + group node['tomcat']['group'] + mode 00755 + action :create + # + # This is a little hackish. We need to wait for tomcat to extract the bigdata.war file before we can modify + # resources within the bigdata folder. We'll attempt to update this to use the chef notification system later. + # + retries 3 + retry_delay 10 +end + +execute "set absolute path for RWStore.properties" do + cwd "#{node['systap-bigdata'][:home]}/WEB-INF" + command "sed -i 's|<param-value>../webapps/bigdata/RWStore.properties|<param-value>#{node['systap-bigdata'][:home]}/RWStore.properties|' web.xml" +end + +execute "set path for bigdata.jnl file" do + cwd "#{node['systap-bigdata'][:home]}" + command "sed -i 's|=bigdata.jnl|=#{node['systap-bigdata'][:etc]}/bigdata.jnl|' RWStore.properties" +end + + +execute "set ruleLog in log4j.properties " do + cwd "#{node['systap-bigdata'][:home]}/WEB-INF/classes" + command "sed -i 's|log4j.appender.queryLog.File=queryLog.csv|log4j.appender.queryLog.File=#{node['systap-bigdata'][:etc]}/queryLog.csv|' log4j.properties" +end + +execute "set ruleLog in log4j.properties " do + cwd "#{node['systap-bigdata'][:home]}/WEB-INF/classes" + command "sed -i 's|log4j.appender.ruleLog.File=rules.log|log4j.appender.ruleLog.File=#{node['systap-bigdata'][:etc]}/rules.log|' log4j.properties" +end + +execute "set ruleLog in log4j.properties " do + cwd "#{node['systap-bigdata'][:home]}/WEB-INF/classes" + command "sed -i 's|log4j.appender.queryRunStateLog.File=queryRunStateLog.csv|log4j.appender.queryRunStateLog.File=#{node['systap-bigdata'][:etc]}/queryRunStateLog.csv|' log4j.properties" +end + Added: trunk/src/resources/deployment/vagrant/systap-bigdata/recipes/default.rb =================================================================== --- trunk/src/resources/deployment/vagrant/systap-bigdata/recipes/default.rb (rev 0) +++ trunk/src/resources/deployment/vagrant/systap-bigdata/recipes/default.rb 2014-01-04 02:38:30 UTC (rev 7713) @@ -0,0 +1,60 @@ +# +# Cookbook Name:: systap-bigdata +# Recipe:: default +# +# Copyright 2013, Systap +# +# +include_recipe "tomcat" + +# +# Install the WAR file: +# +remote_file "#{node['tomcat']['webapp_dir']}/bigdata.war" do + source node['systap-bigdata'][:url] + owner node['tomcat']['user'] + group node['tomcat']['group'] +end + + +# +# Configuration for Tomcat on Ubuntu: +# +directory node['systap-bigdata'][:etc] do + owner node['tomcat']['user'] + group node['tomcat']['group'] + mode 00755 + action :create + # + # This is a little hackish. We need to wait for tomcat to extract the bigdata.war file before we can modify + # resources within the bigdata folder. We'll attempt to update this to use the chef notification system later. + # + retries 3 + retry_delay 10 +end + +execute "set absolute path for RWStore.properties" do + cwd "#{node['systap-bigdata'][:home]}/WEB-INF" + command "sed -i 's|<param-value>../webapps/bigdata/RWStore.properties|<param-value>#{node['systap-bigdata'][:home]}/RWStore.properties|' web.xml" +end + +execute "set path for bigdata.jnl file" do + cwd "#{node['systap-bigdata'][:home]}" + command "sed -i 's|=bigdata.jnl|=#{node['systap-bigdata'][:etc]}/bigdata.jnl|' RWStore.properties" +end + + +execute "set ruleLog in log4j.properties " do + cwd "#{node['systap-bigdata'][:home]}/WEB-INF/classes" + command "sed -i 's|log4j.appender.queryLog.File=queryLog.csv|log4j.appender.queryLog.File=#{node['systap-bigdata'][:etc]}/queryLog.csv|' log4j.properties" +end + +execute "set ruleLog in log4j.properties " do + cwd "#{node['systap-bigdata'][:home]}/WEB-INF/classes" + command "sed -i 's|log4j.appender.ruleLog.File=rules.log|log4j.appender.ruleLog.File=#{node['systap-bigdata'][:etc]}/rules.log|' log4j.properties" +end + +execute "set ruleLog in log4j.properties " do + cwd "#{node['systap-bigdata'][:home]}/WEB-INF/classes" + command "sed -i 's|log4j.appender.queryRunStateLog.File=queryRunStateLog.csv|log4j.appender.queryRunStateLog.File=#{node['systap-bigdata'][:etc]}/queryRunStateLog.csv|' log4j.properties" +end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |