Kristian Kraljić You may compare programming with poetry,
a harmonic script is a piece of creativity which will last forever.
- Kristian Kraljić

TyphoonAE (App Engine) in the Amazon (EC2) Cloud

by Kristian Kraljic, November 18, 2011

Ever wanted to run your own private platform service, but didn’t know how? Using and developing on the Google App Engine is already a great experience. It is very easy and straight forward to develop, run and deploy projects to the Google App Engine, such as my demo application Cloududoku, which was entirely written in Python. But especially for larger or confidential projects it is not always the best solution to run the application live in the public Google App Engine.

Therefore private platform services such as the Typhoon App Engine (TyphoonAE) have been developed. TyphoonAE is a full-featured and productive serving environment to run Google App Engine (Python) applications. Normally you would install TyphoonAE on a dedicated Linux or MacOSX server. My thought was, why not combine the ease of the Google App Engine (a private platform service) and the power of the Amazon EC2 Cloud services?

The Amazon Elastic Compute Cloud is a true virtual computing environment, providing quick, scalable and reliable computing power. Therefore a so called “EC2 Instance” can be launched using the Amazon Web Services or the AWS Management Console. An EC2 Instance is a fully functional Windows or Linux environment running in the cloud. The cool thing: Cost are calculated hourly. So you pay only for what you need. For example the smallest Linux instance (micro.t1) costs only $0.02 per hour. So you get a full featured Linux system in the cloud for only $14.40 per month.

To run TyphoonAE in the Amazon Cloud I have created a so called custom Amazon Machine Image (AMI). An AMI is basically the base image to boot up your instance. I have created such an AMI and installed all required packages to run TyphoonAE in the cloud. The following packages have been installed, on the basis of the regular Basic 64-bit Amazon Linux AMI 2011.09:

  • gcc, gcc-c++
  • make
  • libxslt
  • fop
  • ncurses-devel
  • openssl-devel
  • *openjdk-devel
  • unixODBC, unixODBC-devel
  • patch
  • libxslt.x86_64
  • mesa-libGL.x86_64, mesa-libGL-devel.x86_64, mesa-libGLU.x86_64, mesa-libGLU-devel.x86_64
  • gtk2.x86_64, gtk2-devel.x86_64
  • python26.x86_64, python26-devel.x86_64, python.x86_64, python-devel.x86_64
  • mysql.x86_64, mysql-devel.x86_64
  • expat.x86_64, expat-devel.x86_64
  • libevent.x86_64, libevent-devel.x86_64
  • xlib, xterm, xauth
  • lynx.x86_64

Also a supported version of Erlang (R14B02) was compiled and installed on the instance. TyphoonAE version 0.2.0 was installed and tested on the system. To launch your own instance using the Amazon TyphoonAE AMI you will need to perform the following steps:

  1. Log on to the Amazon AWS Management Console or use any 3rd party tool to launch an instance.
  2. Launch a new instance using the following AMI:
    • AMI ID: ami-13bd757a
    • AMI Name: amazon_linux_ami_typhoonae
    • Source: 015012755119/amazon_linux_ami_typhoonae
  3. Logon to your instance using the ec2-user. Now you are able to run a great demo application or install your own application to your private platform service, by doing the following:
    1. To start the demo application use the following commands:
      cd ~/typhoonae-buildout-0.2.0
      ./bin/supervisord

      Use your browser to connect to your application, by entering your public DNS name and using port 8080. Do not forget to add the port to the security group of your instance.

    2. To install your own application (for example the helloworld application of TyphoonAE) use the following commands:
      cd ~/typhoonae-buildout-0.2.0
      rm -f etc/1.latest.cloududoku-supervisor.conf
      ./bin/apptool parts/helloworld

      It is necessary to remove the old *supervisor.conf every time you upload a different application, or you have to use the ‐‐multiple flag of the apptool.

  4. Congratulations! You are now running your own private platform service using the Typhoon App Engine! To shut down your service use the following command:
    cd ~/typhoonae-buildout-0.2.0
    ./bin/supervisorctl shutdown

    You can also use supervisorctl to check if all applications/services are up and running. Connect to port 9190 to access the RPC-like interface of TyphoonAE.

I think the TyphoonAE is a great piece of software and the TyphoonAE AMI is very useful to quickly launch and test your private platform service. Feel free to review the AMI, comment and give feedback. I will try to provide updated AMI’s every once in a while, especially if new versions of TyphoonAE will be released. Check back on this block to stay up to date (May our new “subscribe” feature comes in handy here)!

Comments