<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>PiCloud Blog</title>
	<atom:link href="http://blog.picloud.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.picloud.com</link>
	<description>Cloud Computing. Simplified.</description>
	<lastBuildDate>Fri, 13 Aug 2010 05:09:03 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Running a Twitter Bot with Cloud-based Crons</title>
		<link>http://blog.picloud.com/2010/08/12/making-a-twitter-bot/</link>
		<comments>http://blog.picloud.com/2010/08/12/making-a-twitter-bot/#comments</comments>
		<pubDate>Fri, 13 Aug 2010 00:06:05 +0000</pubDate>
		<dc:creator>Ken Elkabany</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://blog.picloud.com/?p=292</guid>
		<description><![CDATA[
Two days ago, we released our latest feature: Crons. In short, you&#8217;re able to register a function to be run periodically on PiCloud. Today, we wanted to give you an example of crons in action by making an automatic retweeter bot.


We&#8217;ve setup a twitter account, @picloudrt, that will automatically retweet any message that includes the [...]]]></description>
			<content:encoded><![CDATA[<p>
Two days ago, we released our latest feature: <a href="http://blog.picloud.com/2010/08/10/crons-in-the-cloud/">Crons</a>. In short, you&#8217;re able to register a function to be run periodically on PiCloud. Today, we wanted to give you an example of crons in action by making an <strong>automatic retweeter bot</strong>.
</p>
<p>
We&#8217;ve setup a twitter account, <a href="http://twitter.com/picloudrt">@picloudrt</a>, that will automatically retweet any message that includes the word &#8220;picloud&#8221; within a minute of its posting. We accomplish this by running a cron every minute that uses the Twitter API to search for new &#8220;picloud&#8221; tweets. As with our previous <a href="http://blog.picloud.com/2010/07/21/how-to-encode-all-of-your-videos-fast/">video encoding tutorial</a>, we&#8217;ll first demonstrate how to run the retweeter locally, and then show how to move it to the cloud.
</p>
<p><strong>What can I do with a retweeting bot?</strong></p>
<p>
Your retweeting bot has several uses. First, you can follow it to get a consolidated view of what people are saying about your company or product. Second, you can use it to keep a comprehensive history of tweets, rather than the temporally finite (~1.5 weeks) results provided by <a href="http://search.twitter.com/">Twitter Search</a>. Third, you can augment the code to filter tweets and report findings as you see fit.  For example, rather than re-tweeting, you can use <a href="http://docs.python.org/library/smtplib.html">smtplib</a> to alert yourself of new tweets via e-mail. This will get you functionality similar to that of a service like <a href="http://tweetbeep.com/">TweetBeep</a>.
</p>
<p><strong>Prerequisite Libraries</strong></p>
<p>
<code>cloud</code> &#8211; Version >= 2.0.0 of our library. You&#8217;ll need to <a href="https://www.picloud.com/accounts/register/">sign up</a> (it&#8217;s free!) to download it.<br />
<code><a href="http://code.google.com/p/tweepy/">tweepy</a></code> &#8211; Twitter API for Python.
</p>
<h3>Local Version</h3>
<p>
We have a function called <code>retweeter()</code>, which does the following:
</p>
<ol>
<li>Uses the <code>tweepy</code> library to search twitter for posts.</li>
<li>Determines which tweets are new, and not from the retweeting account, picloudrt.</li>
<li>Uses <code>tweepy</code> to retweet.</li>
</ol>
<p>
The details are best understood by examining the comments embedded in the code below.
</p>
<p>
<strong>Updated</strong>: <code>retweeter()</code> has been improved. The old method assumed that Twitter search would instantaneously display new tweets, when in fact the tweets can be delayed by over 10 seconds. Rather than using specific time intervals, we now use the last retweet as a marker for determining what tweets are new.<br />
</p>
<pre class="brush: python">
import tweepy
import datetime

username = &#039;picloudrt&#039; # put your twitter handle here
password = &#039;XXXX&#039; # put your password here
keyword = &#039;picloud&#039; # the word we&#039;re tracking

def retweeter():
    &quot;&quot;&quot;Searches for the picloud key term on twitter and retweets
    any new tweets tweeted since our last retweet.&quot;&quot;&quot;

    # create api object (authentication needed for retweeting)
    auth = tweepy.BasicAuthHandler(username, password)
    api = tweepy.API(auth)

    # find the most recent tweet we&#039;ve retweeted, so that
    # when we search for the latest tweets, we know only
    # to retweet messages that were created_after
    retweets = api.retweeted_by_me()
    if retweets:
        created_after = retweets[0].retweeted_status.created_at
    else:
        # if we&#039;ve never retweeted before, then we&#039;re going to
        # retweet all msgs created after the 20th century, ie. all of them
        created_after = datetime.datetime(year=2000, month=1, day=1)

    # grab all tweets that include our keyword (default: picloud)
    tweets = api.search(keyword)
    # reverse them to get the oldest first
    tweets.reverse()
    for tweet in tweets:
        # if the tweet is new, and was not made from our account, retweet it
        if tweet.created_at &gt; created_after and tweet.from_user != username:
            api.retweet(tweet.id)
</pre>
<p>To run the function on your local machine, you simply call it, <code>retweeter()</code>.</p>
<h3>Cloud Version</h3>
<p>To run <code>retweeter()</code> periodically on PiCloud, you register it as a cron:</p>
<pre class="brush: python">
import cloud
cloud.cron.register(retweeter, &#039;picloud_retweeter&#039;, &#039;* * * * *&#039;)
</pre>
<p>
That&#8217;s it! Note that while you had to install <code>tweepy</code> locally, you did not have to install it on PiCloud. Our <code>cloud</code> library automatically extracts dependencies, such as <code>tweepy</code>, from your machine, and deploys them on PiCloud.
</p>
<p>
We labeled the newly registered cron &#8216;picloud_retweeter&#8217;; labels make it easy to refer to the cron in the web interface, and in other functions, eg. <code>cloud.cron.deregister()</code>. The expression, &#8216;* * * * *&#8217;, is the UNIX crontab way of saying that <code>retweeter()</code> should be run every minute. You can find more details on specifying the periodicity at the <a href="http://unixhelp.ed.ac.uk/CGI/man-cgi?crontab+5">unix man page for crontab</a>.
</p>
<p>
Here&#8217;s what the cron dashboard now shows:
</p>
<p><a href="http://media.picloud.com/img/blog/cron_dashboard.png"><br />
<img src="http://media.picloud.com/img/blog/cron_dashboard.png" alt="Cron Dashboard" /><br />
</a><br />
</p>
<p>
If you click on &#8220;View Jobs,&#8221; you&#8217;ll be taken to our jobs dashboard, which will automatically filter for jobs created by the cron. Jobs spawned by a cron are labeled with the cron&#8217;s label prefixed with &#8216;cron_&#8217;. In this case, the jobs are labeled as &#8216;cron_picloud_retweeter&#8217;.
</p>
<p><a href="http://media.picloud.com/img/blog/cron_jobs_dashboard.png"><br />
<img src="http://media.picloud.com/img/blog/cron_jobs_dashboard.png" alt="Cron Dashboard" /><br />
</a></p>
<p>
As you can see, your cron is creating a new job every minute. For testing purposes, you can manually run a cron at any time using the cron dashboard. You can also remove the cron using the dashboard, or using our library.
</p>
<pre class="brush: python">
cloud.cron.deregister(&#039;picloud_retweeter&#039;)
</pre>
<h3>Cost</h3>
<p>
Assuming that your custom twitter bot takes about a second to scrape and process data, we can estimate your monthly cost. The function will be run approximately (60 minutes) * (24 hours) = 1440 times a day, for a total of (1440 times a day)*(30 days)=43,200 times per month. If it takes one second to execute each time, that&#8217;s 43,200 compute seconds, or 43,200/(3,600 seconds per hour) = 12 compute hours. The total cost is therefore (12 compute hours) * ($0.05 per compute hour) = <strong>$0.60</strong>. Compare that with the $5-$20/month charge for some Twitter alert services, or the $20-$68 price of bringing up an instance from Amazon or Rackspace, directly.
</p>
<h3>Conclusion: Why PiCloud should be your go-to Cron Artist</h3>
<p><strong>Easy</strong>: All you need is one line of code: <code>cloud.cron.register()</code>.<br />
<strong>Fire-and-forget</strong>: Once you&#8217;ve registered a cron, we&#8217;ll make sure it works until the end of time.<br />
<strong>Scalable</strong>: If you have a lot of crons, we&#8217;ll automatically distribute them across multiple machines in our cluster.<br />
<strong>Monitoring</strong>: Ever wonder how your cron is doing, but can&#8217;t find the logs? Would you like to know exactly when your script stopped working? Just check your job dashboard to see a full history of your computation for easy debugging.<br />
<strong>Inexpensive</strong>: For basic usage, you could be charged less than a dollar per month!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.picloud.com/2010/08/12/making-a-twitter-bot/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Crons in the Cloud!</title>
		<link>http://blog.picloud.com/2010/08/10/crons-in-the-cloud/</link>
		<comments>http://blog.picloud.com/2010/08/10/crons-in-the-cloud/#comments</comments>
		<pubDate>Wed, 11 Aug 2010 02:04:02 +0000</pubDate>
		<dc:creator>Ken Elkabany</dc:creator>
				<category><![CDATA[What's New]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[new features]]></category>

		<guid isPermaLink="false">http://blog.picloud.com/?p=273</guid>
		<description><![CDATA[We&#8217;re pleased to announce the addition of crons to the PiCloud platform. A cron is a simple way to schedule a function to be run periodically. Time and dates are specified using the standard crontab format. Crons can be triggered as often as every minute, and there&#8217;s no limit to the number of functions you [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;re pleased to announce the addition of crons to the PiCloud platform. A <a href="http://en.wikipedia.org/wiki/Cron">cron</a> is a simple way to schedule a function to be run periodically. Time and dates are specified using the standard <a href="http://unixhelp.ed.ac.uk/CGI/man-cgi?crontab+5">crontab format</a>. Crons can be triggered as often as every minute, and there&#8217;s no limit to the number of functions you can register as crons. You will be billed for the amount of compute time consumed by the function triggered by your cron&#8211;just like if you were running a function on PiCloud. We have also added a tab to the web interface for managing crons.</p>
<p>Here&#8217;s how to register a cron:</p>
<pre class="brush: python">
# registers function ping_webserver with the label heartbeat
# this function could be checking whether a webservice is active
cloud.cron.register(ping_webserver, &#039;heartbeat&#039;, &#039;* * * * *&#039;) # runs every minute
</pre>
<p>When you no longer need a cron, you can deregister it via our web interface or using the following:</p>
<pre class="brush: python">
# deregister function ping_webserver with the label heartbeat
cloud.cron.deregister(&#039;ping_webserver&#039;)
</pre>
<p>Here&#8217;s a function that runs once a day at noon.</p>
<pre class="brush: python">
# 19 is the 19th GMT hour, which translates to 12pm PDT (GMT -7)
cloud.cron.register(sudo_make_me_a_sandwich, &#039;lunch&#039;, &#039;0 19 * * *&#039;)
</pre>
<p>That&#8217;s all it takes! See our <a href="http://docs.picloud.com/moduledoc.html#module-cloud.cron">documentation for the full cron specification</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.picloud.com/2010/08/10/crons-in-the-cloud/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How to encode all of your videos, quickly and cheaply!</title>
		<link>http://blog.picloud.com/2010/07/21/how-to-encode-all-of-your-videos-fast/</link>
		<comments>http://blog.picloud.com/2010/07/21/how-to-encode-all-of-your-videos-fast/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 04:35:55 +0000</pubDate>
		<dc:creator>Ken Elkabany</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[ffmpeg]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[video encoding]]></category>

		<guid isPermaLink="false">http://blog.picloud.com/?p=153</guid>
		<description><![CDATA[With the ubiquity of video on the web, it&#8217;s important that services be able to encode their videos in a variety of formats to maximize their viewership. Specific formats are necessary for displaying content on certain mediums, most notably, flv for flash videos and mp4 for the iPhone. Video encoding is a time consuming and [...]]]></description>
			<content:encoded><![CDATA[<p>With the ubiquity of video on the web, it&#8217;s important that services be able to encode their videos in a variety of formats to maximize their viewership. Specific formats are necessary for displaying content on certain mediums, most notably, flv for flash videos and mp4 for the iPhone. <a href="http://blog.brightcove.com/en/2009/10/video-encoding-101-beginning">Video encoding</a> is a time consuming and computationally intensive task, which makes the computing power of the cloud ideal for the job. This post will cover how to use PiCloud to offload encoding to the cloud using our <code>cloud</code> library and <a href="http://www.ffmpeg.org/">ffmpeg</a>, a popular video encoding tool. With just a couple lines of code, you&#8217;ll be able to leverage the compute power of hundreds of cores on Amazon Web Services without touching a single server at a fraction of the cost (3%-20%) of <a href="http://www.encoding.com">encoding.com</a>.</p>
<p><strong>Source Video</strong></p>
<p>You can use any avi file as the &#8220;source video.&#8221; If you want to follow this post to the letter, you can download what we used: <a href="http://www.2shared.com/file/4342892/37658c0c/Rick_Astley_-_Never_gonna_give_you_up_RICKROLL.html">rickroll.avi</a>. Use the &#8220;Save file to your PC&#8221; link (BEWARE: The &#8220;Download Now&#8221; graphics are ads).</p>
<p><strong>ffmpeg Basics</strong></p>
<p>ffmpeg provides a command-line interface for manipulating videos. Since it&#8217;s not our purpose to teach ffmpeg in this post, here are the two command strings we&#8217;ll be using:</p>
<p>1. Converting to flv: &#8216;ffmpeg -i source_video.avi -y -b 200000 -r 25 -s 320&#215;240 -ab 56 -ar 44100 -f flv output_video.flv&#8217;<br />
2. Converting to mp4: &#8216;ffmpeg -i source_video.avi -y -b 200000 -r 25 -s 320&#215;240 -acodec aac -ab 128kb -vcodec mpeg4 -b 1200kb -mbd 2 -flags +4mv -cmp 2 -subcmp 2 -s 320&#215;180 output_video.mp4&#8242;</p>
<p>For more useful commands, check out the <a href="http://www.catswhocode.com/blog/19-ffmpeg-commands-for-all-needs">19 ffmpeg commands for all needs</a>.</p>
<h3>Example 1: Encoding a video locally</h3>
<p>Assuming you have ffmpeg installed, the function below, <code>ffmpeg_exec()</code>, will encode a specified source video on your local machine.</p>
<pre class="brush: python">
from subprocess import Popen, PIPE

encoding_cmd_strings = {
&#039;flv&#039;: &#039;ffmpeg -i {0} -y -b 200000 -r 25 -s 320x240 -ab 56 -ar 44100 -f flv {1}&#039;,
&#039;mp4&#039;: &#039;ffmpeg -i {0} -y -b 200000 -r 25 -s 320x240 -acodec aac -ab 128kb -vcodec mpeg4 -b 1200kb -mbd 2 -flags +4mv -cmp 2 -subcmp 2 -s 320x180 {1}&#039;
}

def ffmpeg_exec(source, target, encoding):
    &quot;&quot;&quot;Uses a shell call to ffmpeg to convert a video
    to the desired encoding&quot;&quot;&quot;

    # Popen calls the ffmpeg process, and collects the standard out/error
    p = Popen(encoding_cmd_strings[encoding].format(source, target),
                  stdout=PIPE,
                  stderr=PIPE,
                  shell=True)
    stdout, stderr = p.communicate(input=None)

    # return these for debugging purposes
    return stdout, stderr
</pre>
<p>Running the function <code>ffmmpeg_exec('rickroll.avi', 'rickroll.flv', 'flv')</code> produces a flash video of the rickroll.avi source file. Likewise, <code>ffmmpeg_exec('rickroll.avi', 'rickroll.mp4', 'mp4')</code> produces an mpeg4 encoding.</p>
<h3>Example 2: Retrieving a file from the cloud, encoding it locally, and then putting it on the cloud.</h3>
<p>We&#8217;ll define a function, <code>convert_video()</code>, to download the source video, encode it using <code>ffmpeg_exec()</code>, and then put the encoded file on the cloud. For convenience, we&#8217;ll use the <code>cloud.files</code> module to get and put your video files, but you could use other storage locations such as Amazon S3 (via <a href="http://code.google.com/p/boto/">boto</a>), a database, or even a website.</p>
<p>If you have downloaded the rick roll video, you can store it on the cloud from the Python console:</p>
<pre class="brush: python">
&gt;&gt;&gt; import cloud
&gt;&gt;&gt; cloud.files.put(&#039;rickroll.avi&#039;)
</pre>
<p><code>convert_video()</code>  uses <code>cloud.files.get()</code> to retrieve the source video that we&#8217;ve stored on the cloud, encodes it, and then puts the encoded file on the cloud with <code>cloud.files.put()</code>. </p>
<pre class="brush: python">
import os
import cloud

def convert_video(source, encoding):
    &quot;&quot;&quot;Gets the source file, converts it to the specified encoding,
    and puts it on the cloud&quot;&quot;&quot;

    # automatically generate target name, ie. video.avi -&gt; video.flv
    basename, ext = os.path.splitext(source)
    target = &#039;%s.%s&#039; % (basename, encoding)

    # gets the source file from the cloud and saves it to the
    # current directory with the same name
    cloud.files.get(source, source)

    # execute ffmpeg (Example 1)
    ret = ffmpeg_exec(source, target, encoding)

    # store output file on the cloud
    cloud.files.put(target)

    return ret
</pre>
<p>You can verify that <code>convert_video('rickroll.avi', 'flv')</code> adds &#8216;rickroll.flv&#8217; to your cloud files collection.</p>
<pre class="brush: python">
&gt;&gt;&gt; convert_video(&#039;rickroll.avi&#039;, &#039;flv&#039;)
&gt;&gt;&gt; cloud.files.list()
[&#039;rickroll.avi&#039;, &#039;rickroll.flv&#039;]
</pre>
<h3>Example 3: Encoding a video with PiCloud</h3>
<p>Now that we&#8217;ve created the functions to encode a video locally, we want to move the computation to the cloud. We&#8217;ll use our <code>cloud</code> library to do this. The most basic function in the library is <code>cloud.call()</code>, which takes a function as its argument, and returns a job id (an integer). <code>cloud.call()</code> inspects the execution state of the Python interpreter and copies everything it needs to execute the given function on PiCloud&#8217;s cluster. The only change we&#8217;ll need to make is the following: Instead of calling <code>convert_video()</code> directly, we&#8217;ll instead pass the function into <code>cloud.call()</code>.</p>
<pre class="brush: python">
# executes convert_video(&#039;rickroll.avi&#039;, &#039;flv&#039;) on the cloud
# _high_cpu mode dedicates 2.5 compute units to the task (2.5-3.0ghz core)
jid = cloud.call(convert_video, &#039;rickroll.avi&#039;, &#039;flv&#039;, _high_cpu=True)
</pre>
<p>The function is now running on PiCloud. You can check the jobs panel in the web interface to see its status.<br />
<center><img src="http://media.staging.picloud.net/img/blog/video_encoding_job_panel.png" alt="" /></center><br />
Alternatively, you can use <code>cloud.status(jid)</code> to see when the function is done.</p>
<pre class="brush: python">
&gt;&gt;&gt; cloud.status(jid)
&#039;processing&#039;
&gt;&gt;&gt; cloud.status(jid)   # after some time has passed
&#039;done&#039;
</pre>
<p>If you check the result of the function using <code>cloud.result()</code> (blocks until completion), you&#8217;ll get this:</p>
<pre><code>
FFmpeg version SVN-r22379, Copyright (c) 2000-2010 the FFmpeg developers
  built on Mar  9 2010 12:45:06 with gcc 4.4.1
  libavutil     50.11. 0 / 50.11. 0
  libavcodec    52.58. 0 / 52.58. 0
  libavformat   52.55. 0 / 52.55. 0
  libavdevice   52. 2. 0 / 52. 2. 0
  libswscale     0.10. 0 /  0.10. 0
Input #0, avi, from 'rickroll.avi':
  Duration: 00:03:34.96, start: 0.000000, bitrate: 2108 kb/s
    Stream #0.0: Video: mpeg4, yuv420p, 704x544 [PAR 1:1 DAR 22:17], 25 tbr,
 25 tbn, 25 tbc
    Stream #0.1: Audio: mp3, 48000 Hz, 2 channels, s16, 128 kb/s
Output #0, flv, to 'rickroll.flv':
  Metadata:
    encoder         : Lavf52.55.0
    Stream #0.0: Video: flv, yuv420p, 320x240 [PAR 33:34 DAR 22:17],
q=2-31, 200 kb/s, 1k tbn, 25 tbc
    Stream #0.1: Audio: libmp3lame, 44100 Hz, 2 channels, s16, 0 kb/s
Stream mapping:
  Stream #0.0 -&gt; #0.0
  Stream #0.1 -&gt; #0.1
Press [q] to stop encoding
[mp3 @ 0x1adfe70]incomplete frame   8785kB time=211.24 bitrate= 340.7kbits/s
frame= 5374 fps=177 q=2.0 Lsize=    8877kB time=214.96 bitrate= 338.3kbits/s
video:5305kB audio:3359kB global headers:0kB muxing overhead 2.456632%
</code></pre>
<p>Congrats! You&#8217;re now officially encoding on the cloud.</p>
<h3>Example 4: Leveraging Parallelism to Batch Process a Large Video Collection</h3>
<p>While encoding a dozen hours of videos using the above functions may be tractable on a single machine, encoding an entire library composed of thousands of hours is not. This is where the elasticity of the cloud shines. Using PiCloud, you can easily leverage the parallel computing power of hundreds of cores on Amazon. Instead of using cloud.call to run a function once in the cloud, use cloud.map to run the same encoding function on all videos.</p>
<p>To encode all videos in both flv and mp4 locally, we can do the following:</p>
<pre class="brush: python">
# this list can contain as many source files as you want
source_names = [&#039;rickroll.avi&#039;, &#039;source1.avi&#039;, &#039;source2.avi&#039;]
source_args = 2*source_names
encoding_args = [&#039;flv&#039;]*len(source_args)+[&#039;mp4&#039;]*len(source_args)

# expands to: map(convert_video, [&#039;rickroll.avi&#039;, &#039;source1.avi&#039;, &#039;source2.avi&#039;, &#039;rickroll.avi&#039;, &#039;source1.avi&#039;, &#039;source2.avi&#039;], [&#039;flv&#039;, &#039;flv&#039;, &#039;flv&#039;, &#039;mp4&#039;, &#039;mp4&#039;, &#039;mp4&#039;]
map(convert_video, source_args, encoding_args)
</pre>
<p>To move the work to PiCloud, change the map function to the cloud.map function:</p>
<pre class="brush: python">
jids = cloud.map(convert_video, source_args, encoding_args, _high_cpu=True)
</pre>
<p>That&#8217;s all it takes to offload your encoding to our cluster! We&#8217;ll automatically scale up the number of Amazon EC2 instances in our cluster depending on how much workload you give us (we estimate this on the fly). Here&#8217;s a graph demonstrating the speed gains from this one-line change:<br />
<center><img src="http://media.staging.picloud.net/img/blog/video_encoding_results.png" alt="" /></center><br />
The local machine is equivalent to a single 2.5Ghz Core i7 Intel processor. If you&#8217;re still thinking, &#8220;but I need to process videos even faster,&#8221; then check out our <a href="http://www.picloud.com/pricing/#realtime">real time compute units feature</a>.</p>
<h3>How much did that cost?</h3>
<p>According to my account, encoding 30 3-minute videos, which took about 120 seconds total, cost me <strong>$0.073</strong>. Each video took about 70 seconds to get, encode, and save, for a total of 30*70=2100 seconds or (2100 seconds)/(3600 seconds/hour)*(2.5 compute units)=1.46 compute hours. At the rate of $0.05/compute unit/hour, and noting that I was using high cpu mode (2.5 compute units), the total cost was 1.46 compute hours * $0.05/compute unit/hour = $0.073.</p>
<p>With <a href="http://www.encoding.com">encoding.com</a>, the same task would cost $2.97 at their cheapest high-volume tier. This was derived from $1.80/GB * (55 mb/Rick Roll) * (30 Rick Rolls). That makes PiCloud less than 3% the cost of encoding.com! To be fair, if you aren&#8217;t storing your videos on Amazon, you&#8217;ll have to pay bandwidth costs, which will be (1.65GB Data In)*($0.15/GB) + (1.65GB Data Out)*($0.16/GB) = $0.512. PiCloud&#8217;s total cost would be $0.512+$0.073=$0.585, which is still only 20% of the cost of encoding.com. Extra point for PiCloud: We didn&#8217;t include the amount you&#8217;d have to pay for bandwidth to send and receive videos files with encoding.com. Needless to say, they do have a full video encoding service with a wide range of options and customer support, whereas we&#8217;re showing you a building block that could be used to replicate their service. But, this does give you an idea of the premium they are charging for their service.</p>
<h3><strong>Summary (TL;DR)</strong></h3>
<ul>
<li>ffmpeg is a tool for encoding videos, and is available on PiCloud.</li>
<li>PiCloud offers the <code>cloud.files</code> module, a simple file storage service, as an easy way to get and put files on the cloud. Using <code>cloud.files</code> is completely optional&#8211;use whatever other data store you want&#8211;but it&#8217;s there when you need it.</li>
<li>Getting on the cloud with PiCloud is easy!
<ul>
<li>Passing <code>convert_video()</code> into <code>cloud.call()</code> is all you need to do to offload your encoding to the cloud.</li>
<li>If you want to encode a lot of videos, use <code>cloud.map()</code> instead of <code>map()</code>, and all of it will be pushed to the cloud for processing.</li>
</ul>
<li>We&#8217;re inexpensive!</li>
</ul>
<p>Take it from here, Rick!<br />
<center><br />
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="385" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/dQw4w9WgXcQ&amp;hl=en_US&amp;fs=1" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="480" height="385" src="http://www.youtube.com/v/dQw4w9WgXcQ&amp;hl=en_US&amp;fs=1" allowscriptaccess="always" allowfullscreen="true"></embed></object><br />
</center></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.picloud.com/2010/07/21/how-to-encode-all-of-your-videos-fast/feed/</wfw:commentRss>
		<slash:comments>46</slash:comments>
		</item>
		<item>
		<title>Public Beta Launch!</title>
		<link>http://blog.picloud.com/2010/07/19/public-beta-launch/</link>
		<comments>http://blog.picloud.com/2010/07/19/public-beta-launch/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 22:29:12 +0000</pubDate>
		<dc:creator>Ken Elkabany</dc:creator>
				<category><![CDATA[Press Release]]></category>

		<guid isPermaLink="false">http://blog.picloud.com/?p=158</guid>
		<description><![CDATA[After five months in private beta, we&#8217;re ready to open up PiCloud to the rest of the world. We would like to thank all of our private beta users who&#8217;ve contributed their time, effort, and insight to get PiCloud to where it is today. To celebrate, we&#8217;ve credited all beta accounts with 5 additional free [...]]]></description>
			<content:encoded><![CDATA[<p>After five months in private beta, we&#8217;re ready to open up PiCloud to the rest of the world. We would like to thank all of our private beta users who&#8217;ve contributed their time, effort, and insight to get PiCloud to where it is today. To celebrate, we&#8217;ve credited all beta accounts with 5 additional free compute unit hours (on top of the 5 trial hours). Thank you!</p>
<p><strong>Update #1</strong>: <a href="http://www.techcrunchit.com/2010/07/19/picloud-launches-serverless-computing-platform-to-the-public/">Article on TechCrunch</a><br />
<strong>Update #2</strong>: <a href="http://venturebeat.com/2010/07/19/picloud/">Article on VentureBeat</a></p>
<p>Our official press release:<br />
<center><br />
<iframe src="http://www.prlog.org/10804395-picloud-announces-public-availability-of-its-serverless-computing-platform.html?embed" width="600px" height="600px" frameborder="1"></iframe><br />
</center></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.picloud.com/2010/07/19/public-beta-launch/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Our Pricing Model</title>
		<link>http://blog.picloud.com/2010/06/04/our-pricing-model/</link>
		<comments>http://blog.picloud.com/2010/06/04/our-pricing-model/#comments</comments>
		<pubDate>Sat, 05 Jun 2010 00:39:20 +0000</pubDate>
		<dc:creator>Ken Elkabany</dc:creator>
				<category><![CDATA[What's New]]></category>
		<category><![CDATA[pricing]]></category>

		<guid isPermaLink="false">http://blog.picloud.com/?p=141</guid>
		<description><![CDATA[Since the beginning of the year, we&#8217;ve been tweaking our pricing scheme to no avail. Just last month we published a new pricing page that we admitted wasn&#8217;t perfect, but was, we felt, as good as it would ever get. A key attribute of that system was the &#8220;parallelism limit,&#8221; the total number of cores [...]]]></description>
			<content:encoded><![CDATA[<p>Since the beginning of the year, we&#8217;ve been tweaking our pricing scheme to no avail. Just last month we published a new pricing page that we admitted wasn&#8217;t perfect, but was, we felt, as good as it would ever get. A key attribute of that system was the &#8220;parallelism limit,&#8221; the total number of cores we would devote to your computation at any one time. The higher the parallelism limit, the more we would charge per compute unit hour.</p>
<p>We quickly realized that our users weren&#8217;t fans of this. It&#8217;s roughly equivalent to Amazon charging a higher hourly rate for every additional instance booted up, which is a disincentive to users looking to use hundreds of cores of processing power. Some users cleverly created multiple accounts, each with the cheapest 10 compute unit parallelism limit, and used them in concert to run their computation with a very high parallelism limit.</p>
<p>We weren&#8217;t fans either. We had users choose their parallelism limit so we could provision enough servers ahead of time to respond quickly to their computational demands. That was good in theory, but it meant that we had to maintain a large pool of servers even when our users weren&#8217;t running functions. Wasted compute cycles meant that we had to raise all of our prices, even for users who didn&#8217;t need immediate response times.</p>
<p><strong>New Model</strong><br />
Our solution was to drop the idea of a parallelism limit altogether.</p>
<p>Now, our vanilla service doesn&#8217;t guarantee when functions will begin processing. In the background, we&#8217;re adding our users&#8217; functions to a fair-queuing scheduler. We estimate the amount of workload in the queue, and automatically scale our cluster as we see fit. Most functions don&#8217;t wait very long; you can see <a href="http://www.picloud.com/product/#delayed_execution">empirical data on our product page</a>. If you&#8217;re looking for a cheap and effective batch-processing solution, this is it.</p>
<p>Real time compute units now serve a clear purpose. These are compute units that we reserve just for you. When you make a <code>cloud.call()</code>, your function will run immediately if you have any real time compute units available (not allocated to another one of your functions). If your real time compute units are fully utilized, then your function will wait until a real time compute unit becomes available, or if room exists in our fair-queuing system. This is the ideal solution for those who need real time response requirements, or simply want to accelerate their processing time. We charge a minimal amount ($0.015 per compute unit hour) to reserve real time units in hourly increments. This minimal cost exists to protect ourselves in case you don&#8217;t run any functions, since we&#8217;re reserving space on Amazon instances for you.</p>
<p>I hope this sheds light on why our pricing model has been in flux. Our team is genuinely happy with this latest pricing model, because it accurately structures the value we provide our customers. If you have any questions, thoughts, or concerns, we&#8217;d love to hear what you have to say in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.picloud.com/2010/06/04/our-pricing-model/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Store your files with PiCloud!</title>
		<link>http://blog.picloud.com/2010/05/03/store-your-files-with-picloud/</link>
		<comments>http://blog.picloud.com/2010/05/03/store-your-files-with-picloud/#comments</comments>
		<pubDate>Tue, 04 May 2010 00:24:53 +0000</pubDate>
		<dc:creator>Ken Elkabany</dc:creator>
				<category><![CDATA[What's New]]></category>
		<category><![CDATA[new features]]></category>

		<guid isPermaLink="false">http://blog.picloud.com/?p=101</guid>
		<description><![CDATA[One of the most frequent questions we get is &#8220;where do I put my data?&#8221; To this, we&#8217;ve always had the same answer: Anywhere you want. Unlike other platforms, we&#8217;ve never believed in locking in your data into our proprietary data store. Our users keep data in all sorts of different places (AWS, Rackspace, or [...]]]></description>
			<content:encoded><![CDATA[<p>One of the most frequent questions we get is &#8220;where do I put my data?&#8221; To this, we&#8217;ve always had the same answer: Anywhere you want. Unlike other platforms, we&#8217;ve never believed in locking in your data into our proprietary data store. Our users keep data in all sorts of different places (AWS, Rackspace, or on their local machines), and in all different forms (flat files, relational databases, and key stores). We don&#8217;t plan to change this, because we don&#8217;t believe we can provide the single best data storage solution to satisfy everyone&#8217;s needs. We&#8217;re big fans of using the correct tool for every problem.</p>
<p>So what is our new file storage solution? It&#8217;s a simple and easy way for our users to get their data on the cloud to be crunched by PiCloud. We don&#8217;t pretend that it&#8217;s the holy grail of data storage solutions, but it&#8217;s a solid answer for users who don&#8217;t already have a data store setup. If you don&#8217;t need it, you won&#8217;t be affected.</p>
<p>The module is included in our <code>cloud</code> library as <code>cloud.files</code>. Here&#8217;s the most basic way to use it:<br />
<code><br />
cloud.files.put('data.txt')   # stores data.txt on the cloud<br />
cloud.files.get('data.txt')   # saves data.txt onto your machine<br />
cloud.files.getf('data.txt')  # gets a stream of the contents of data.txt<br />
</code></p>
<p>See our documentation for the <a href="http://docs.picloud.com/moduledoc.html#module-cloud.files">full specification</a> and <a href="http://docs.picloud.com/basic_examples.html#cloud-files">examples</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.picloud.com/2010/05/03/store-your-files-with-picloud/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PiCloud Named A “Cool Vendor” in Application Platforms by Gartner</title>
		<link>http://blog.picloud.com/2010/04/08/picloud-named-a-%e2%80%9ccool-vendor%e2%80%9d-in-application-platforms-by-gartner/</link>
		<comments>http://blog.picloud.com/2010/04/08/picloud-named-a-%e2%80%9ccool-vendor%e2%80%9d-in-application-platforms-by-gartner/#comments</comments>
		<pubDate>Fri, 09 Apr 2010 01:37:44 +0000</pubDate>
		<dc:creator>Ken Elkabany</dc:creator>
				<category><![CDATA[Press Release]]></category>
		<category><![CDATA[gartner]]></category>

		<guid isPermaLink="false">http://blog.picloud.com/?p=122</guid>
		<description><![CDATA[We&#8217;re excited to announce that Gartner has selected PiCloud as a &#8220;Cool Vendor&#8221; in Application Platforms as a Service. Their report examined platforms that &#8220;offer a bridge between the programming practices of familiar application servers (platforms) and the new realities of cloud deployment using application platforms as a service (APaaS)&#8221;1, and was &#8220;designed to highlight [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;re excited to announce that Gartner has selected PiCloud as a &#8220;Cool Vendor&#8221; in Application Platforms as a Service. Their report examined platforms that &#8220;offer a bridge between the programming practices of familiar application servers (platforms) and the new realities of cloud deployment using application platforms as a service (APaaS)&#8221;<sup>1</sup>, and was &#8220;designed to highlight interesting, new and innovative vendors, products and services.&#8221;<sup>1</sup> If you have access to Gartner&#8217;s extensive research database, you can find the report <a href="http://www.gartner.com/DisplayDocument?id=1332919">here</a>.</p>
<p>We see this as a validation of our approach and execution. By abstracting away servers with our cloud library, we&#8217;ve simplified the process of orchestrating hundreds of cores of computing power for scientists, developers, and engineers. No IT team necessary. While our product is still relatively young, the 4 million functions we have processed for our users has confirmed to us that there is a large and growing demand for cloud computing, simplified.</p>
<p><strong>About Gartner&#8217;s Cool Vendors Selection Process</strong></p>
<p>Gartner&#8217;s listing does not constitute an exhaustive list of vendors in any given technology area, but rather is designed to highlight interesting, new and innovative vendors, products and services. Gartner disclaims all warranties, expressed or implied, with respect to this research, including any warranties of merchantability or fitness of a particular purpose.</p>
<p>Gartner defines a cool vendor as a company that offers technologies or solutions that are: Innovative, enable users to do things they couldn&#8217;t do before; Impactful, have, or will have, business impact (not just technology for the sake of technology); Intriguing, have caught Gartner&#8217;s interest or curiosity in approximately the past six months.</p>
<p><span style="color: #666"><sup>1</sup> Gartner “Cool Vendors in Application Platforms as a Service, 2010,” by Yefim V. Natis, Eric Knipp, Massimo Pezzini, Ray Valdes, April 1, 2010.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.picloud.com/2010/04/08/picloud-named-a-%e2%80%9ccool-vendor%e2%80%9d-in-application-platforms-by-gartner/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PyCon Aftermath</title>
		<link>http://blog.picloud.com/2010/03/03/pycon-aftermath/</link>
		<comments>http://blog.picloud.com/2010/03/03/pycon-aftermath/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 19:36:06 +0000</pubDate>
		<dc:creator>Ken Elkabany</dc:creator>
				<category><![CDATA[Aftermath]]></category>
		<category><![CDATA[pycon]]></category>

		<guid isPermaLink="false">http://blog.picloud.com/?p=96</guid>
		<description><![CDATA[Thanks to everyone who stopped by our poster session on Sunday after our lightning talk. In our effort to contribute to the community and shed more light on PiCloud&#8217;s systems, we&#8217;ve decided to share our posters publicly.
Overview of the PiCloud Platform:

Inner workings of our cloud library:

Shout out: Thanks to those who got us on the [...]]]></description>
			<content:encoded><![CDATA[<p>Thanks to everyone who stopped by our poster session on Sunday after our lightning talk. In our effort to contribute to the community and shed more light on PiCloud&#8217;s systems, we&#8217;ve decided to share our posters publicly.</p>
<p><strong>Overview of the PiCloud Platform:</strong><br />
<embed src="http://embedit.in/5rMnePjG5o.swf" height="350" width="590" type="application/x-shockwave-flash" allowFullScreen="true"></p>
<p><strong>Inner workings of our cloud library:</strong><br />
<embed src="http://embedit.in/n9rAyas6bj.swf" height="350" width="590" type="application/x-shockwave-flash" allowFullScreen="true"></p>
<p>Shout out: Thanks to those who got us on the <a href="http://www.reddit.com/r/programming/comments/b78bk/picloud_cloud_computing_simplified/">front page of Reddit</a> and the <a href="http://news.ycombinator.com/item?id=1155635">top post on Hacker News</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.picloud.com/2010/03/03/pycon-aftermath/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Users, New Features, and PyCon!</title>
		<link>http://blog.picloud.com/2010/02/19/new-users-new-features-and-pycon/</link>
		<comments>http://blog.picloud.com/2010/02/19/new-users-new-features-and-pycon/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 08:00:48 +0000</pubDate>
		<dc:creator>Ken Elkabany</dc:creator>
				<category><![CDATA[What's New]]></category>
		<category><![CDATA[new features]]></category>
		<category><![CDATA[pycon]]></category>

		<guid isPermaLink="false">http://blog.picloud.com/?p=83</guid>
		<description><![CDATA[Wait no longer! We&#8217;ve opened up PiCloud to another batch of users today, and from now onward, we promise to accelerate the roll out of PiCloud to new users. For users, both new and old, I wanted to highlight some of the many changes we&#8217;ve made in the past month that haven&#8217;t necessarily been the [...]]]></description>
			<content:encoded><![CDATA[<p>Wait no longer! We&#8217;ve opened up PiCloud to another batch of users today, and from now onward, we promise to accelerate the roll out of PiCloud to new users. For users, both new and old, I wanted to highlight some of the many changes we&#8217;ve made in the past month that haven&#8217;t necessarily been the most visible.</p>
<p><strong>Variable Compute Units</strong><br />
We had customers asking us for more powerful CPUs, and so we&#8217;ve delivered. With a simple keyword argument change, you can now switch between using 1 Compute Unit (1-1.2 ghz Xeon) to 2.5 Compute Units (2.5-3ghz Xeon). Check it out (code):</p>
<p><code>cloud.call(cpu_intensive_func, _high_cpu=True) # uses 2.5 compute units</code></p>
<p><strong>Profiler Option</strong><br />
While we&#8217;ve gotten great feedback for profiling functions that run on PiCloud, we&#8217;ve also received requests to have the ability to turn off the profiler. After all, the deterministic profiler does have overhead that scales with the number of function calls in a script. To turn off the profiler, it&#8217;s simply another keyword argument _profile.</p>
<p><code>cloud.call(foo, _profiler=False)</code></p>
<p><strong>Drop in for multiprocessing</strong><br />
If you&#8217;re already using Python multiprocessing, but want to run your computation across our cluster, now you can. Check out our <a href="http://docs.picloud.com/client_adv.html#multiprocessing-pool-interface">docs</a> to see how.</p>
<p><strong>cloud library is now open source</strong><br />
We told users before that the client library was not open sourced, because frankly, we didn&#8217;t believe it was stable enough to deserve the attention of developers in the community. We are now at that point, so the client library has been released with an LGPL license.</p>
<p><strong>Inclusion in the Enthought Python Distribution (EPD)</strong><br />
<a href="http://www.enthought.com/products/epd.php">EPD</a> is ideal for scientists and engineers looking for an easy, standardized way to deploy a powerful set of scientific tools on their own computer or across a whole organization. As of the latest EPD release, 6.0, the cloud library is now included in the distribution. Welcome EPD customers!</p>
<p><strong>Bug fixes</strong><br />
Having hundreds of users using our platform is the easiest way to expose all the nitty-gritty bugs and race conditions that are lurking in our system. We would like to thank our ever-growing community for the many bug reports and critical fixes we have had over the past month.</p>
<p>Lastly, our CTO, Aaron Staley, and I will be at PyCon this weekend. Hope to see you all there!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.picloud.com/2010/02/19/new-users-new-features-and-pycon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cheers to our partnership with Enthought, Inc.</title>
		<link>http://blog.picloud.com/2010/02/04/cheers-to-our-partnership-with-enthought-inc/</link>
		<comments>http://blog.picloud.com/2010/02/04/cheers-to-our-partnership-with-enthought-inc/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 04:35:07 +0000</pubDate>
		<dc:creator>Ken Elkabany</dc:creator>
				<category><![CDATA[Press Release]]></category>
		<category><![CDATA[Enthought]]></category>
		<category><![CDATA[partnership]]></category>

		<guid isPermaLink="false">http://blog.picloud.com/?p=62</guid>
		<description><![CDATA[We&#8217;re excited to announce our partnership with the team over at Enthought.  Enthought is the de facto curator of the Python scientific community, having significantly supported the development and maintenance of both NumPy and SciPy.  In fact, Enthought&#8217;s President Travis Oliphant was one of the initial developers of NumPy.  We see the PiCloud platform as [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;re excited to announce our partnership with the team over at <a href="http://www.enthought.com">Enthought</a>.  Enthought is the de facto curator of the Python scientific community, having significantly supported the development and maintenance of both NumPy and SciPy.  In fact, Enthought&#8217;s President Travis Oliphant was one of the initial developers of NumPy.  We see the PiCloud platform as an incredible tool enabling scientists and engineers in industry and academia alike to seamlessly access a powerful, elastic, and on-demand pool of computing resources.  With this partnership, the PiCloud Python library will be included in the market-leading Enthought Python Distribution, instantly giving their scientific customers access to the cloud.  The official press release is <a href="http://www.prnewswire.com/news-releases/enthought-inc-and-picloud-announce-cloud-computing-partnership-83539042.html">here</a>.</p>
<p><strong>PiCloud Webinar Tomorrow!</strong><br />
Tomorrow, February 5th, at 11am PST (1pm CST), we will be presenting a webinar on PiCloud through Enthought.  The online talk is available to the public.  If you would like to attend, please register <a href="http://www.enthought.com/training/webinars.php">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.picloud.com/2010/02/04/cheers-to-our-partnership-with-enthought-inc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
