Friday, July 08, 2011

A first trial with DotCloud

DotCloud claims to be One Platform - Any Stack Cloud solution
I decided to test it myself, read below.

1. Registration
Very easy and quick!

2. Setup
I used a Linux desktop (dream linux). I needed to install first Python´s ¨easy-install¨ which was missing. 

2.1 Installing easy_install
sudo apt-get update
sudo apt-get install python-setuptools

2.2 Dotcloud API installation
telzur@dream:~/Downloads/dotcloud$ sudo easy_install pip && sudo pip install dotcloud
Searching for pip
Best match: pip 1.0.1
Processing pip-1.0.1.tar.gz
Running pip-1.0.1/ -q bdist_egg --dist-dir /tmp/easy_install-XXryzJ/pip-1.0.1/egg-dist-tmp-f2uO_w
warning: no files found matching '*.html' under directory 'docs'
warning: no previously-included files matching '*.txt' found under directory 'docs/_build'
no previously-included directories found matching 'docs/_build/_sources'
Adding pip 1.0.1 to easy-install.pth file
Installing pip script to /usr/local/bin
Installing pip-2.6 script to /usr/local/bin

Installed /usr/local/lib/python2.6/dist-packages/pip-1.0.1-py2.6.egg
Processing dependencies for pip
Finished processing dependencies for pip
Downloading/unpacking dotcloud
  Downloading dotcloud-0.4.1.tar.gz
  Running egg_info for package dotcloud
Downloading/unpacking dotcloud.cli==0.4.1 (from dotcloud)
  Downloading dotcloud.cli-0.4.1.tar.gz
  Running egg_info for package dotcloud.cli
Installing collected packages: dotcloud, dotcloud.cli
  Running install for dotcloud
  Running install for dotcloud.cli
    changing mode of build/scripts-2.6/dotcloud from 644 to 755
    changing mode of build/scripts-2.6/__dotcloud_git_ssh from 644 to 755
    changing mode of /usr/local/bin/__dotcloud_git_ssh to 755
    changing mode of /usr/local/bin/dotcloud to 755
Successfully installed dotcloud dotcloud.cli
Cleaning up...

3. Enter API key:
telzur@dream:~/Downloads/dotcloud$ dotcloud setup

4. Test
I tried the easy example from dotcloud website
about deploying a basic WWW server.
I will not repeat here the code insertion since it is described in detail at the website therefore I will only enclose below the output so you will be able  to verify the process:

telzur@dream:~/Downloads/dotcloud$ mkdir simpleapp
telzur@dream:~/Downloads/dotcloud$ cd simpleapp/
telzur@dream:~/Downloads/dotcloud/simpleapp$ vi index.html
telzur@dream:~/Downloads/dotcloud/simpleapp$ dotcloud create helloworldapp
Created repos "helloworldapp"
telzur@dream:~/Downloads/dotcloud/simpleapp$ vi dotcloud.yml
telzur@dream:~/Downloads/dotcloud/simpleapp$ dotcloud push helloworldapp
# upload /home/telzur/Downloads/dotcloud/simpleapp ssh://
# rsync
Pseudo-terminal will not be allocated because stdin is not a terminal.
Warning: Permanently added '[]:21122,[]:21122' (RSA) to the list of known hosts.
building file list ... done

sent 265 bytes  received 53 bytes  57.82 bytes/sec
total size is 122  speedup is 0.38
Deployment for "helloworldapp" triggered. Will be available in a few seconds.
2011-07-07 18:41:50 [api] Waiting for the build. (It may take a few minutes)
2011-07-07 18:41:50 [www.0] Deploying...
2011-07-07 18:42:04 [www.0] Service booted
2011-07-07 18:42:04 [www.0] The build started
2011-07-07 18:42:05 [www.0] Fetched code revision rsync-1310064109.13
2011-07-07 18:42:08 [www.0] Reloading nginx configuration: nginx.
2011-07-07 18:42:08 [www.0] The build finished successfully
2011-07-07 18:42:08 [api] Deploy finished

Deployment finished. Your application is available at the following URLs

5. Verification
I opened the URL and got, as expected, the ¨Hello World!¨ from the cloud virtual web server. If you own a domain name you can forward it to point to this URL and you are done.

6. Conclusions
6.1 Very cool and a nice game for the afternoon to experience the power of the cloud.
6.2 I confirmed how easy it is to deploy a webserver as dotcloud had promised
6.3 There are still many open questions about how mature is this solution for  real heavy, scalable and secured web services.
6.4 It will be interesting to follow dotcloud and see how they evolve.