Author: riverma
Date: Mon Jun 16 19:36:07 2014
New Revision: 1602971

URL: http://svn.apache.org/r1602971
Log:
OODT-676: Simplify OODT RADiX setup: provide pre-configured RADiX via Vagrant

Added:
    oodt/trunk/vagrant/
    oodt/trunk/vagrant/radix/
    oodt/trunk/vagrant/radix/README.txt
    oodt/trunk/vagrant/radix/Vagrantfile
    oodt/trunk/vagrant/radix/vagrant/
    oodt/trunk/vagrant/radix/vagrant/conf/
    oodt/trunk/vagrant/radix/vagrant/conf/terminal/
    oodt/trunk/vagrant/radix/vagrant/conf/terminal/bashrc
    oodt/trunk/vagrant/radix/vagrant/env.sh
    oodt/trunk/vagrant/radix/vagrant/provision.sh

Added: oodt/trunk/vagrant/radix/README.txt
URL: 
http://svn.apache.org/viewvc/oodt/trunk/vagrant/radix/README.txt?rev=1602971&view=auto
==============================================================================
--- oodt/trunk/vagrant/radix/README.txt (added)
+++ oodt/trunk/vagrant/radix/README.txt Mon Jun 16 19:36:07 2014
@@ -0,0 +1,51 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+##################################################################################
+#
+# README.txt
+#
+# @author [email protected]
+#
+# @description This README describes how to setup, install, and run 
radix-vagrant. 
+# After completing these steps, you will have a fully configured Ubuntu 
Virtual 
+# Machine* running a fresh version of OODT RADiX.
+##################################################################################
+
+
+Requirements:
+1. 5GB of space to install VM on
+2. Vagrant: see http://www.vagrantup.com/
+3. VirtualBox: see https://www.virtualbox.org/wiki/Downloads
+
+Setup:
+1. Modify the contents of vagrant/env.sh to reflect your desired configuration
+   - add your project name etc here
+   - configure which type of RADiX build you want here (e.g. solr-enabled)
+2. Modify the Vagrantfile VM_NAME to name your VM (VM names must be unique)
+3. vagrant up
+NOTE: The above command will take up to 15 minutes the first time you run it.
+NOTE: All source files will be placed within /usr/local/src within the VM.
+
+Start:
+* NOTE: The provisioning script auto starts OODT, so you may skip to step 2
+1. (optional) Launch OODT if not already running below
+   > cd $OODT_HOME/bin
+   > ./oodt start
+2. Navigate to: http://localhost:8080/opsui
+
+-----
+* You can learn more about how to use your newly created virtual machine at: 
+http://www.vagrantup.com/

Added: oodt/trunk/vagrant/radix/Vagrantfile
URL: 
http://svn.apache.org/viewvc/oodt/trunk/vagrant/radix/Vagrantfile?rev=1602971&view=auto
==============================================================================
--- oodt/trunk/vagrant/radix/Vagrantfile (added)
+++ oodt/trunk/vagrant/radix/Vagrantfile Mon Jun 16 19:36:07 2014
@@ -0,0 +1,129 @@
+# -*- mode: ruby -*-
+# vi: set ft=ruby :
+
+# Virtual machine name
+VM_NAME = "oodt_radix_vm"
+
+# Vagrantfile API/syntax version. Don't touch unless you know what you're 
doing!
+VAGRANTFILE_API_VERSION = "2"
+
+Vagrant.configure(VAGRANTFILE_API_VERSION) 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.
+
+  # Every Vagrant virtual environment requires a box to build off of.
+  config.vm.box = "chef/ubuntu-13.10"
+
+  config.vm.define VM_NAME do |oodt_radix|
+  end
+  config.vm.provider :virtualbox do |vb|
+      vb.name = VM_NAME
+  end
+
+  # 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://domain.com/path/to/above.box";
+
+  # 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.
+  config.vm.network "forwarded_port", guest: 8080, host: 8080
+
+  config.vm.provision :shell, :path => "vagrant/provision.sh"
+
+  # Create a private network, which allows host-only access to the machine
+  # using a specific IP.
+  # config.vm.network "private_network", ip: "192.168.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"
+
+  # If true, then any SSH connections made will enable agent forwarding.
+  # Default value: false
+  # config.ssh.forward_agent = true
+
+  # 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.
+
+  # Enable provisioning with Puppet stand alone.  Puppet manifests
+  # are contained in a directory path relative to this Vagrantfile.
+  # You will need to create the manifests directory and a manifest in
+  # the file base.pp in the manifests_path directory.
+  #
+  # An example Puppet manifest to provision the message of the day:
+  #
+  # # group { "puppet":
+  # #   ensure => "present",
+  # # }
+  # #
+  # # File { owner => 0, group => 0, mode => 0644 }
+  # #
+  # # file { '/etc/motd':
+  # #   content => "Welcome to Apache OODT RADiX! Built by Vagrant. 
+  # #               Managed by Puppet.\n"
+  # # }
+  #
+  # config.vm.provision "puppet" do |puppet|
+  #   puppet.manifests_path = "manifests"
+  #   puppet.manifest_file  = "site.pp"
+  # end
+
+  # Enable provisioning with chef solo, specifying a cookbooks path, roles
+  # path, and data_bags path (all relative to this Vagrantfile), and adding
+  # some recipes and/or roles.
+  #
+  # config.vm.provision "chef_solo" do |chef|
+  #   chef.cookbooks_path = "../my-recipes/cookbooks"
+  #   chef.roles_path = "../my-recipes/roles"
+  #   chef.data_bags_path = "../my-recipes/data_bags"
+  #   chef.add_recipe "mysql"
+  #   chef.add_role "web"
+  #
+  #   # You may also specify custom JSON attributes:
+  #   chef.json = { :mysql_password => "foo" }
+  # end
+
+  # Enable provisioning with chef server, specifying the chef server URL,
+  # and the path to the validation key (relative to this Vagrantfile).
+  #
+  # The Opscode Platform uses HTTPS. Substitute your organization for
+  # ORGNAME in the URL and validation key.
+  #
+  # If you have your own Chef Server, use the appropriate URL, which may be
+  # HTTP instead of HTTPS depending on your configuration. Also change the
+  # validation key to validation.pem.
+  #
+  # config.vm.provision "chef_client" do |chef|
+  #   chef.chef_server_url = "https://api.opscode.com/organizations/ORGNAME";
+  #   chef.validation_key_path = "ORGNAME-validator.pem"
+  # end
+  #
+  # If you're using the Opscode platform, your validator client is
+  # ORGNAME-validator, replacing ORGNAME with your organization name.
+  #
+  # If you have your own Chef Server, the default validation client name is
+  # chef-validator, unless you changed the configuration.
+  #
+  #   chef.validation_client_name = "ORGNAME-validator"
+end

Added: oodt/trunk/vagrant/radix/vagrant/conf/terminal/bashrc
URL: 
http://svn.apache.org/viewvc/oodt/trunk/vagrant/radix/vagrant/conf/terminal/bashrc?rev=1602971&view=auto
==============================================================================
--- oodt/trunk/vagrant/radix/vagrant/conf/terminal/bashrc (added)
+++ oodt/trunk/vagrant/radix/vagrant/conf/terminal/bashrc Mon Jun 16 19:36:07 
2014
@@ -0,0 +1,110 @@
+# ~/.bashrc: executed by bash(1) for non-login shells.
+# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
+# for examples
+
+# If not running interactively, don't do anything
+[ -z "$PS1" ] && return
+
+# don't put duplicate lines or lines starting with space in the history.
+# See bash(1) for more options
+HISTCONTROL=ignoreboth
+
+# append to the history file, don't overwrite it
+shopt -s histappend
+
+# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
+HISTSIZE=1000
+HISTFILESIZE=2000
+
+# check the window size after each command and, if necessary,
+# update the values of LINES and COLUMNS.
+shopt -s checkwinsize
+
+# If set, the pattern "**" used in a pathname expansion context will
+# match all files and zero or more directories and subdirectories.
+#shopt -s globstar
+
+# make less more friendly for non-text input files, see lesspipe(1)
+[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
+
+# set variable identifying the chroot you work in (used in the prompt below)
+if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
+    debian_chroot=$(cat /etc/debian_chroot)
+fi
+
+# set a fancy prompt (non-color, unless we know we "want" color)
+case "$TERM" in
+    xterm-color) color_prompt=yes;;
+esac
+
+# uncomment for a colored prompt, if the terminal has the capability; turned
+# off by default to not distract the user: the focus in a terminal window
+# should be on the output of commands, not on the prompt
+#force_color_prompt=yes
+
+if [ -n "$force_color_prompt" ]; then
+    if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
+       # We have color support; assume it's compliant with Ecma-48
+       # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
+       # a case would tend to support setf rather than setaf.)
+       color_prompt=yes
+    else
+       color_prompt=
+    fi
+fi
+
+if [ "$color_prompt" = yes ]; then
+    
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$
 '
+else
+    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
+fi
+unset color_prompt force_color_prompt
+
+# If this is an xterm set the title to user@host:dir
+case "$TERM" in
+xterm*|rxvt*)
+    PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
+    ;;
+*)
+    ;;
+esac
+
+# enable color support of ls and also add handy aliases
+if [ -x /usr/bin/dircolors ]; then
+    test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval 
"$(dircolors -b)"
+    alias ls='ls --color=auto'
+    #alias dir='dir --color=auto'
+    #alias vdir='vdir --color=auto'
+
+    alias grep='grep --color=auto'
+    alias fgrep='fgrep --color=auto'
+    alias egrep='egrep --color=auto'
+fi
+
+# some more ls aliases
+alias ll='ls -alF'
+alias la='ls -A'
+alias l='ls -CF'
+
+# Add an "alert" alias for long running commands.  Use like so:
+#   sleep 10; alert
+alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || 
echo error)" "$(history|tail -n1|sed -e 
'\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
+
+# Alias definitions.
+# You may want to put all your additions into a separate file like
+# ~/.bash_aliases, instead of adding them here directly.
+# See /usr/share/doc/bash-doc/examples in the bash-doc package.
+
+if [ -f ~/.bash_aliases ]; then
+    . ~/.bash_aliases
+fi
+
+# enable programmable completion features (you don't need to enable
+# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
+# sources /etc/bash.bashrc).
+if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
+    . /etc/bash_completion
+fi
+
+# Export env.sh
+source /vagrant/vagrant/env.sh
\ No newline at end of file

Added: oodt/trunk/vagrant/radix/vagrant/env.sh
URL: 
http://svn.apache.org/viewvc/oodt/trunk/vagrant/radix/vagrant/env.sh?rev=1602971&view=auto
==============================================================================
--- oodt/trunk/vagrant/radix/vagrant/env.sh (added)
+++ oodt/trunk/vagrant/radix/vagrant/env.sh Mon Jun 16 19:36:07 2014
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+# CHANGE BELOW FOR YOUR PROJECT NEEDS!
+export PROJECT_GROUP_ID=com.mycompany.mydms
+export PROJECT_ARTIFACT_ID=mycompany-myoodt
+export BUILD_FLAGS=-Pfm-solr-catalog # NOTE: more flag options at 
http://s.apache.org/CJL
+export OODT_DEPLOYMENT_HOME=/usr/local/oodt
+
+# General configuration (probably don't need to modify)
+export OODT_SRC_REPO=https://svn.apache.org/repos/asf/oodt/trunk # NOTE: This 
should match the below OODT version
+export OODT_VERSION=0.7-SNAPSHOT
+export JAVA_HOME=/usr/lib/jvm/default-java
+

Added: oodt/trunk/vagrant/radix/vagrant/provision.sh
URL: 
http://svn.apache.org/viewvc/oodt/trunk/vagrant/radix/vagrant/provision.sh?rev=1602971&view=auto
==============================================================================
--- oodt/trunk/vagrant/radix/vagrant/provision.sh (added)
+++ oodt/trunk/vagrant/radix/vagrant/provision.sh Mon Jun 16 19:36:07 2014
@@ -0,0 +1,56 @@
+#!/bin/bash
+
+##################################################
+#                                                #
+#   OODT RADiX Vagrant Provision Script          #
+#                                                # 
+##################################################
+
+# Load config file
+source /vagrant/vagrant/env.sh
+
+echo "Update Ubuntu’s package index"
+sudo apt-get update
+
+# --------- GENERAL INSTALL/CONFIG 
---------------------------------------------------------
+sudo apt-get install -y vim 
+sudo apt-get install -y subversion
+sudo apt-get install -y git
+sudo apt-get install -y tree
+sudo apt-get install -y curl
+sudo apt-get install -y maven2
+sudo apt-get install -y default-jdk
+sudo apt-get install -y ack
+
+# --------- General config/install ----------
+sudo cp /vagrant/vagrant/conf/terminal/bashrc /home/vagrant/.bashrc
+source /home/vagrant/.bashrc
+sudo mkdir ${OODT_DEPLOYMENT_HOME}
+sudo chown -R vagrant:vagrant ${OODT_DEPLOYMENT_HOME}
+
+
+# ---------- OODT Installation --------------
+# NOTE: Checking out and installing OODT is only necessary for the SNAPSHOT 
versions of OODT
+# TO DO: Set up some logic for differentiating between SNAPSHOT (trunk) and 
tagged releases
+echo "Checking out latest (trunk) OODT from SVN"
+cd /usr/local/src
+sudo svn export ${OODT_SRC_REPO} oodt-${OODT_VERSION}
+sudo chown -R vagrant:vagrant oodt-${OODT_VERSION}
+echo "Build OODT and RADiX archetype"
+cd oodt-${OODT_VERSION}
+mvn -Dmaven.test.skip=true clean install
+cd mvn/archetypes/radix
+sudo mvn install
+
+# ---------- Setup new RADiX project --------
+cd /usr/local/src
+sudo mvn archetype:generate -DinteractiveMode=false 
-DarchetypeGroupId=org.apache.oodt -DarchetypeArtifactId=radix-archetype 
-DarchetypeVersion=${OODT_VERSION} -Doodt=${OODT_VERSION} 
-DgroupId=${PROJECT_GROUP_ID} -DartifactId=${PROJECT_ARTIFACT_ID} 
-Dversion=0.1-SNAPSHOT
+cd ${PROJECT_ARTIFACT_ID}
+sudo mvn package ${BUILD_FLAGS}
+tar zxf distribution/target/${PROJECT_ARTIFACT_ID}-distribution-*-bin.tar.gz 
-C ${OODT_DEPLOYMENT_HOME}
+
+# ---------- Start OODT ----------
+cd ${OODT_DEPLOYMENT_HOME}/bin
+./oodt start
+echo ""
+echo "OODT started, please navigate to: http://localhost:8080/opsui";


Reply via email to