Tuesday, July 3, 2012

Slides for Cloud Hands-on Tutorial in IEEE Cloud 2012

Following are the slides I used for the tutorial. As the sample, we deployed a Web Service and a Web Application. When deployed, users access the web application, which will do a call to the Web Service and show the results.

Hands on deployed the service and webapp in three setup.
  1. In the local machine
  2. In the Amazon EC2 (IaaS)
  3. In the WSO2 Stratos (PaaS)
The script for the demo can be found below. Please note it is only  a rough script. 




Abstract

When cloud computing was introduced a few years ago, it promised many advantages including self-service, elasticity, pay as you go, improved accessibility to computation resources, and full deployment automation. Few years down the line, now we can see many ideas, architectures, and systems shaping up providing more clarity and understanding into cloud computing landscape. Among them, there are many cloud computing systems that enable users to build systems in the cloud with minimal effort. Understanding those systems could provide great insights and understanding into both “cloud promise” and “cloud reality”. This tutorial will provide a brief introduction to the cloud, and discuss how to use some of the existing cloud computing systems with hands-on. We will demonstrate how to develop and run a SOA application in an Infrastructure as a Service platform (IaaS) as well as in a Platform as a Service Platform (PaaS).

Script 


As a demo, we will deploy a Web Service and a Web Application. When deployed, users access the web application, which will do a call to the Web Service and show the results. You can download the sample code from http://people.apache.org/~hemapani/dist/clouddemo/HelloStratos.zip. Download and unzip the distribution.
  1. webapp folder will have the Web app, and you can build the HelloStratosWebapp.war file by running the ant command from the webapp folder.
  2. services folder has the Web service, and you can build theHelloStratos-1.0.aar file by running mvn clean install

Local Hello Stratos Demo

  1. Edit the webapp/src/main/resources/index.jsp to do the service call to 127.0.0.1. Rebuild the webapp by running ant from webapp directory.
  2. Download WSO2 AS
  3. Running following commands to install WSO2 AS
    unzip wso2as-4.1.2.zip
    cd /Users/srinath/playground/cloud-2012-tutorial/wso2as-4.1.0
    cp /Users/srinath/playground/cloud-2012-tutorial/HelloStratos/webapp/target/HelloStratosWebapp.war repository/deployment/server/webapps/
    cp /Users/srinath/playground/cloud-2012-tutorial/HelloStratos/service/target/HelloStratos-1.0.aar repository/deployment/server/axis2services/
    
    
    
  4. Start the WSO2 AS via following commands.
    cd bin/
    ./wso2server.sh
    
    
    
  5. Go to the admin console and login via https://127.0.0.1:9443/carbon/admin/login.jsp, username password are admin, admin.
  6. Try out the service. 
  7. Show soap traces.
  8. Show Web app.
  9. Try out the Web app 

EC2 Demo

  1. Create AWS account
  2. Go to management console
  3. Create instance(Base AMI ami-2ab91843 and AMI with all setup AMI: Unnamed (ami-5805a731)) Create key pair in the process, save the key pair
  4. Connect to instance (srinath-2012.pem is the keypair in this case)

  5. ssh -i ~/.ssh/ec2/srinath-2012.pem ubuntu@ec2-23-22-125-63.compute-1.amazonaws.com

  6. Create a folder ieee-clouddemo
  7. Download WSO2 AS and install following command

  8. wget http://people.apache.org/~hemapani/dist/wso2as-4.1.2.zip
    sudo apt-get install unzip  
    
    Unzip WSAS distribution
    
    wget http://download.java.net/jdk6/6u34/promoted/b03/binaries/jdk-6u34-ea-bin-b03-linux-amd64-20_jun_2012.bin (direct link http://jdk6.java.net/download.html)
    
    ./jdk-6u34-ea-bin-b03-linux-amd64-20_jun_2012.bin
    
    export JAVA_HOME=/home/ubuntu/jdk1.6.0_34
    

  9. Edit Host name in carbon.xml
  10. Access Admin console via https://ec2-107-20-54-230.compute-1.amazonaws.com:9443/carbon/admin/login.jsp
  11. Upload the service via admin console
  12. tryout the service
  13. Download the HelloStratosWebapp.war from
  14. Upload the war file
  15. try out the war file
  16. Save the AMI

Stratos Demo

  1. Create an account from https://stratoslive.wso2.com/
  2. Login to Application Service in Stratos https://stratoslive.wso2.com/t/ieeecloud1.org/carbon/ (replace the ieeecloud1.org with your tenant.)
  3. Show services and compare with the standalone version
  4. Upload the service to stratos
  5. try it out
  6. Login to windows VM and upload the Web app
  7. Try the demo
  8. Enable security via uncommenting commented parts in web.xml
  9. Re-upload the services
  10. Try the Web app, it will ask for passwords. Login via admin admin.