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.
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.
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.
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.
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.
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.
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: