The i-Technology Media!
Register | Log in
   
 
.NET  ·  AJAX  ·  CLOUD  ·  ECLIPSE  ·  FLEX  ·  OPEN WEB  ·  iPHONE  ·  JAVA  ·  LINUX  ·  OPEN SOURCE  ·  ORACLE  ·  PBDJ  ·  SEARCH  ·  SILVERLIGHT  ·  SOA  ·  VIRTUALIZATION  ·  WEB 2.0  ·  WIRELESS  ·  XML
Comments
Drool, Britannia? Is the UK Failing the Cloud?
By Roger Strukhoff
Richard Davies wrote: The UK has a good crop of technology pioneers in cloud computing - for example ElasticHosts, FlexiScale, Flexiant, OnApp - and also some strong government initiatives such as G-Cloud. We will have to see whether this kind of technical leadership converts into swift mass-market adoption or not.
Jan. 8, 2012 11:38 AM EST
read more & respond »
Cloud Expo on Google News
Did you read today's front page stories & breaking news?

Cloud Expo & Virtualization 2011 West
Keynotes
Oracle
Opening Keynote | An Enterprise Cloud for Business-Critical Applications
Abiquo
Day 2 Keynote | The Enterprise Cloud Tightrope - Balancing for Success
Akamai
Day 3 Keynote | The DNA of an Enterprise Cloud
DIAMOND SPONSOR:
Oracle
Many Clouds, Many Choices'Cloud
PLATINUM PLUS SPONSORS:
Abiquo
Enterprise Cloud Best Practices - Town Hall - Join the discussion…
PLATINUM SPONSORS:
Intel
Progressing Toward the Federated, Automated and Client-Aware Cloud
New Relic
How to build an app with Twitter-like throughput
Rackspace
Computing in the Cloud Era
GOLD SPONSORS:
Gale Technologies
Practical Cloud Migration
IBM
Re-think IT. Re-inventing Business.
Intel/McAfee
Identity Driven Security in the Cloud
PerspecSys
Hackers Hackers Everywhere, Is My Public Cloud That Safe?
Red Hat
Unlock the Value of the Cloud
SHI
Mission Critical Applications and the Cloud - Myth or Reality?
SoftLayer
Not Your Grandpa's Cloud
Terremark
Integrating Enterprise Clouds
VMware
Upgrade to a vCloud
POWER PANELS:
Cloud Expo Silicon Valley: CTO Power Panel
Cloud Expo Silicon Valley: CEO Power Panel
Cloud Expo Silicon Valley: Cloud SuperStars Panel
Cloud Expo Silicon Valley: CloudNOW Panel
Click For 2010 West
Event Webcasts
Cloud Expo & Virtualization 2011 East
DIAMOND SPONSOR:
Dell
Dell & VMware Deliver the Enterprise Hybrid Cloud
PLATINUM PLUS SPONSORS:
Abiquo
Are Financial Services Organizations Risking Security by Avoiding Cloud Computing?
Oracle
From Consolidation to Enterprise Private PaaS
PLATINUM SPONSORS:
Intel
Driving the Transformation to Next Generation Cloud Data Centers
Rackspace
The Inevitability of an Open Cloud
GOLD SPONSORS:
CA Technologies
Follow YOUR path to Cloud Computing
Interxion
Who Keeps the Cloud in the Air?
Microsoft
Patterns for Cloud Computing
PerspecSys
War in the Clouds: Are you ready?
ServiceMesh
The Big Win: Stop Playing Small-Ball with Your Cloud Strategy
Terremark
Evaluating Enterprise Clouds
Xiotech
Cloud Storage: Myths and Realities
POWER PANELS:
Cloud Expo New York: CTO Power Panel
Cloud Expo New York: CEO Power Panel
Cloud Expo New York: CMO Power Panel
Cloud Expo New York: Wrap-Up Power Panel
Click For 2010 West
Event Webcasts
Live Google News by SYS-CON!
Top Three Links You Must Click On


Application Deployment on EC2 made easier using Smart EC2 Tool

By: Ezhil Arasan Babaraj
May. 29, 2008 10:36 AM

Those who have worked on EC2 must be familiar with the deployment issues, due to the dynamic nature of the EC2 environment. Since we have been working with EC2 for a long time, we have come up with a tool to manage our application deployment using ANT(ANT is a build tool hosted in APACHE projects) and we are sure that the rest of the world can also use it.

This tool is generic enough to be used in a non EC2 environment, but in this article, we focus only on EC2.

About SmartEC2 Tool

This tool has bunch of ant tasks which can be used in the EC2 environment.

BaseTask - This is the base for all the other tasks. Has a method to save files to a given location.

S3Download - Helps to download objects from S3 buckets. This tool uses Jets3t for this task.

HttpDownload - Simple HTTP file download task. It does not support HTTPS and HTTP based authentication. Used only for public URL's.

MetadataDownload - This downloads all metadata related to the instance and stores it as a property file in the given location. EC2 Meta data is available as a tree structure. This task downloads all the metadata in one short and makes it available as a linear property file.

A typical EC2 Metadata request would provide the following list.

ami-id
ami-launch-index
ami-manifest-path
block-device-mapping/
hostname
instance-id
instance-type
local-hostname
local-ipv4
placement/
public-hostname
public-ipv4
public-keys/
reservation-id
security-groups


The translated Metadata file contains data in the following fashion.


ami-id = ami-sdfes213
ami-launch-index = 0
ami-manifest-path = ?
block-device-mapping/0 = ?
block-device-mapping/1 = ?
hostname = ec2-67-202-43-212.compute-1.amazonaws.com
instance-id = i-qwewq132
instance-type = ?
local-hostname = ec2-67-202-43-212.compute-1.local
local-ipv4 = ?
public-hostname = ?
public-ipv4 = ?
public-keys/0 = sdfdsfsd-sdfsdf34543-#
reservation-id = ?



ReplaceProperty - This task helps you to replace any properties in the corresponding target file. At this point it can replace any one of the properties at a time.

Smart EC2 tool contains all of the tasks listed above and a default build.xml file.


<?xml version="1.0" encoding="UTF-8"?>

<project name="Ec2Ant" basedir="." default="execBuild">

<property name="localFolder" value="${basedir}"/>

<property name="s3buildPath" value="${localFolder}/s3build"/>

<property environment="env"/>

<path id="csslab.lib">

<fileset dir="lib">

<include name="**/*.jar"/>

</fileset>

</path>

<typedef name="s3download" classname="com.csslab.s3ant.s3.S3Download" classpathref="csslab.lib"/>

<typedef name="HttpDownload" classname="com.csslab.s3ant.core.HttpDownload" classpathref="csslab.lib"/>

<typedef name="ec2metadata" classname="com.csslab.ec2.MetadataDownload" classpathref="csslab.lib"/>

<typedef name="replaceproperty" classname="com.csslab.ec2.ReplaceProperty" classpathref="csslab.lib"/>

<target name="execBuild">

<mkdir dir="${s3buildPath}"/>

<echo>Using build path ${s3buildPath}</echo>

<HttpDownload fileUrl="http://169.254.169.254/1.0/user-data" localFolder="${s3buildPath}"/> <loadproperties srcFile="${s3buildPath}/user-data"/>

<s3download accessKey="${accessKey}" secretKey="${secretKey}" bucketName="${bucketName}" S3ObjectPath="${buildFile}" localFolder="${s3buildPath}" saveFileAs="build.xml"/><ant antfile="${s3buildPath}/build.xml" dir="${s3buildPath}" inheritrefs="true"/>

<delete dir="${s3buildPath}"/>

<echo>Build completed successfully.</echo>

</target>

</project>


First section contains declaration for some of the properties used by the targets.
Next you will find the definition for all the four ant tasks.
Then you will see a target that gets executed when the ANT starts.

Deploying Smart EC2 on your AMI
Pre-requisite
Please download the following pre-requisites.
  • JDK 1.5 or later from Sun
  • Ant 1.7 from Apache
  • Download Smart EC2 from here (http://smartec2.s3.amazonaws.com/SmartEC2.zip). Unzip the file and you will find a lib folder and a build.xml file.
  • Setup your path to point to the Java and ANT binaries.

    How does it work?
    EC2 has a provision to launch AMI's by providing user-defined data as an input file. The build process expects certain important parameters like Access Key, Secure Key, build file path and bucket name where the build file is available. The user defined data should be in the below given format. The key names listed below are mandatory. But you are free to add your own keys for further build process.


    accessKey={your access Key}
    secretKey={your secret key}
    bucketName={your bucket name}
    buildFile={your build file path}


    A typical user-defined data file looks like the below one.

    accessKey=aaaaa2323123bcv
    secretKey=sce3434343#$$$$vvxcvx/sdfsdfs
    bucketName=mybucket
    buildFile=mybuild.xml


    Download the sample user data file here and store it locally. But you need to replace properties with the appropriate values.
    You can use putty to login to the instance once it is launched and change your directory to where you have installed Smart EC2. For the first time users, you need to install the tool and bundle your AMI. If you are not familiar with building AMI’s , you can use our Jboss AMI which is available for public. Please find the URL below.
    http://developer.amazonwebservices.com/connect/entry.jspa?externalID=1450
    Let’s assume you have installed Smart EC2 under /var/local. This is where the tool is installed on the above mentioned AMI.
    You will use the following command to go to the tools home.
    Cd /var/local/SmartEC2
    Execute the command ant.
    This will download the user defined data from the EC2 server and make it available as ANT properties. And then it will download the build file created by you for your project and executes it.

    How can you benefit out of this?
    As we know ant has a wide variety of tasks which can ease your deployment process such as executing shell scripts, deploying war, ear files on to the container etc. So sky is the limit.
    We have created couple of sample build files(Sample1 , Sample2) in our S3 bucket for your reference as well.
    Subscribe to this user group to get more updates.
    You can download the source and build on top of it.

    For your convenience we have created a step by step screen shots to showcase as how we deploy our applications using this solution.


    Read the original blog entry...

    Published May. 29, 2008— Reads 1,101
    Copyright © 2008 SYS-CON Media, Inc. — All Rights Reserved.
    Syndicated stories and blog feeds, all rights reserved by the author.
    About Ezhil Arasan Babaraj
    Ezhil Arasan is a research and development specialist at CSS Labs. One of his favorite platform is Cloud Computing and its related technologies. He has been involved in cloud computing for about two years and has led several projects in Amazon Web Services Platform.

    Subscribe to the World's Most Powerful Newsletters
    Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
    Click to Add our RSS Feeds to the Service of Your Choice:
    Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
    myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
    Publish Your Article! Please send it to editorial(at)sys-con.com!

    Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021

    SYS-CON Featured Whitepapers

    ADS BY GOOGLE

    Breaking Java News
    3 Ways to Reduce the Risk of Teen Car Accidents
    Premium Messaging (A2P SMS and P2A SMS) Market Volume Is Expected To Reach 1,134.2 Billion Globally By 2017: Transparency Market Research
    Premium Messaging (A2P SMS and P2A SMS) Market Volume Is Expected To Reach 1,134.2 Billion Globally By 2017: Transparency Market Research
    Americans Hard-Pressed to Find New PHILADELPHIA INDULGENCE on Valentine's Day; Brand Issues National Apology
    ADTRAN Named Best VoIP Channel Vendor by Business Solutions Magazine
    Leading Open Source Password Manager Password Safe Implements YubiKey Support
    Linde Extends Paragon Planning Across 50 Countries
    World Paint & Coatings Market
    Leading Microbiology Market Players: Insightful Profiles of Major Suppliers and Emerging Market Entrants

    ADVERTISE   |   MAGAZINE SUBSCRIPTIONS   |   FREE BREAKING-NEWSLETTERS!   |   SYS-CON.TV   |   BLOG-N-PLAY!   |   WEBCAST   |   EDUCATION   |   RESEARCH

    .NET Developer's Journal - .NETDJ   |   ColdFusion Developer's Journal - CFDJ   |   Eclipse Developer's Journal - EDJ   |   Enterprise Open Source Magazine - EOS
    Open Web Developer's Journal - OPENWEB   |   iPhone Developer's Journal - iPHONE   |   Virtualization - Virtualization   |   Java Developer's Journal - JDJ   |   Linux.SYS-CON.com
    PowerBuilder Developer's Journal - PBDJ   |   SEO / SEM Journal - SJ   |   SOAWorld Magazine - SOAWM   |   IT Solutions Guide - ITSG   |   Symbian Developer's Journal - SDJ
    WebLogic Developer's Journal - WLDJ   |   WebSphere Journal - WJ   |   Wireless Business & Technology - WBT   |   XML-Journal - XMLJ   |   Internet Video - iTV
    Flex Developer's Journal - Flex   |   AJAXWorld Magazine - AWM   |   Silverlight Developer's Journal - SLDJ   |   PHP.SYS-CON.com   |   Web 2.0 Journal - WEB2
    Apache   |   CMS   |   CRM   |   HP   |   Oracle Journal   |   Perl   |   Python   |   Red Hat   |   Ruby on Rails   |   SAP   |   SaaS

    SYS-CON MEDIA:   ABOUT US   |   CONTACT US   |   COMPANY NEWS   |   CAREERS   |   SITE MAP
    SYS-CON EVENTS:   |  AJAXWorld Conference & Expo  |  iPhone Developer Summit  |  Cloud Computing Conference & Expo  |  SOA World Conference & Expo  |  Virtualization Conference & Expo
    INTERNATIONAL SITES:   India  |  U.K.  |  Canada  |  Germany  |  France  |  Australia  |  Italy  |  Spain  |  Netherlands  |  Brazil  |  Belgium
     Terms of Use & Our Privacy Statement     About Newsfeeds / Video Feeds
    Copyright ©1994-2008 SYS-CON Publications, Inc. All Rights Reserved. All marks are trademarks of SYS-CON Media.
    Reproduction in whole or in part in any form or medium without express written permission of SYS-CON Publications, Inc. is prohibited.
     
    close this window