<?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>Wed, 25 Jan 2012 01:15:07 +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>How to Get More Parallel Computing Power</title>
		<link>http://blog.picloud.com/2011/11/16/how-to-get-more-parallel-computing-power/</link>
		<comments>http://blog.picloud.com/2011/11/16/how-to-get-more-parallel-computing-power/#comments</comments>
		<pubDate>Wed, 16 Nov 2011 22:49:10 +0000</pubDate>
		<dc:creator>Ken Elkabany</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[realtime]]></category>

		<guid isPermaLink="false">http://blog.picloud.com/?p=759</guid>
		<description><![CDATA[
We often get asked how much parallel computing power each user on our platform gets. The short answer is that it&#8217;s variable and left up to our algorithms by default, but if you need, it&#8217;s easy to specify that you want exactly N cores using our Realtime Cores feature&#8212;a couple of clicks on our web [...]]]></description>
			<content:encoded><![CDATA[<p>
We often get asked how much parallel computing power each user on our platform gets. The short answer is that it&#8217;s variable and left up to our algorithms by default, but if you need, it&#8217;s easy to specify that you want exactly <i>N</i> cores using our Realtime Cores feature&mdash;a couple of clicks on our web dashboard, or one line of code.
</p>
<h3>Standard Service (w/o Realtime)</h3>
<p>
By default, your jobs take advantage of cores that are shared by all of our users. We do not have a set number of total cores in our system, and there are no set number of cores per user. Instead, PiCloud continually and automatically estimates the workload we have and will have in the next hour. There are two components to this estimation:
</p>
<ol>
<li><b>Periodic Jobs</b>: A large class of users runs jobs periodically, whether it&#8217;s every minute, hour, or day. Over time our system learns the amount of load each of these users contributes, and increases server capacity in anticipation of periodic jobs.</li>
<li><b>Aperiodic Jobs</b>: For users who do not have a predictable pattern, we scale our worker nodes once their jobs have been added to our queue. The number of workers we bring up depends on how long we estimate their jobs will take.</li>
</ol>
<p><b>How do we estimate the runtime of a job?</b></p>
<p>
We estimate the runtime of enqueued jobs by the average and variance of runtimes of similar completed jobs; a similar job is any job by the user that executed the same Python function with the same PiCloud-specific reserved keyword arguments. Keyword arguments such as <code>_type</code> are important since they could affect the speed at which a job is processed.
</p>
<p><b>How does your workload affect the number of workers we bring up?</b></p>
<p>
Since we use Amazon Web Service&#8217;s servers, we are charged for every hour we have a server up. To manage our costs, we try to make sure our servers spend as much time as possible processing jobs, rather than sitting idle. Here&#8217;s a rule of thumb for how this affects you: If each of your jobs takes an hour to process, PiCloud will automatically scale such that all of your jobs are running simultaneously in parallel. We&#8217;re happy to bring up as many as you need since you&#8217;re keeping our servers busy for the full hour increment that we rent from Amazon. If each of your jobs takes a half hour, we&#8217;ll run about half of your jobs in parallel at a time, so that each core will be busy for the full hour running two jobs each. In practice, our scaling algorithm is more liberal than this, but this should give you a good conservative ballpark.
</p>
<p><b>How much compute power should you expect?</b></p>
<p>
If you&#8217;re just running a small batch of short jobs, you&#8217;ll generally get less than 10 cores. If you&#8217;re running a large number of long-running jobs, then using the above algorithm, we could potentially bring up hundreds of cores for you.
</p>
<h3>Realtime Service</h3>
<p>
The model of our standard service is ideal for users trying out PiCloud for the first time, users with relaxed response-time requirements, and users with large batch jobs. Our realtime service is for our other class of users who need <i>N</i> cores to be ready at a moment&#8217;s notice, even if that means those cores will be sitting idle at times.
</p>
<p><b>How it Works</b></p>
<p>
You tell us the type of core you want, and the number you want, and we&#8217;ll bring them online just for you. Your jobs will be placed in both your own realtime queue, as well as our general queue. So if you have reserved 80 cores, and you check in 200 jobs, at least 80 jobs will be immediately be dequeued and begin processing on your realtime cores. Potentially more than 80 may run simultaneously since you still have access to the cores available in our standard service.
</p>
<p><b>How we (want to) Charge</b></p>
<p>
Right now, we charge a fixed cost for every core hour (rounded up). If you reserve realtime cores, and you run no jobs, you&#8217;ll be charged that amount. If you run jobs, you&#8217;ll be charged both the cost of the realtime cores, as well as the cost of our standard service for the number of compute hours your jobs run for. For example, if you reserve 10 c1 cores for an hour, and run 1 compute hour worth of jobs on c1 cores during that time, you&#8217;ll pay $0.15 + $0.05 = $0.20 cents total (See our <a href="http://www.picloud.com/pricing/">pricing</a> page). The problem we have with this is two fold:
</p>
<ol>
<li>The fixed cost of each realtime reservation needs to be sufficiently high to cover our expenses in the event a user does not run any jobs. Charging our elastic rate on top of that is unfairly expensive.</li>
<li>If our standard service scaled a user to 100 cores, and the user then reserved 30 cores, they would not see any additional compute power, while paying substantially more. While it&#8217;s true that they would be guaranteed that compute power without any risk of crowding from other users, we don&#8217;t believe users were getting the best bang for their buck.</li>
</ol>
<p>
We love users who use realtime because they offer our automatically-scaling system a level of predictability; we don&#8217;t want to dis-incentivize this behavior. So we&#8217;re going to change our policy as follows: Each realtime core, rather than being an hourly charge, will instead be an hourly minimum. Hypothetically, if you reserved a realtime core that has a minimum of $0.10/hour, then after an hour you would be charged the greater of $0.10 or the bill you accrued from using our standard service. If you don&#8217;t run any jobs, that&#8217;s $0.10. If you run some jobs, but the standard service bill doesn&#8217;t exceed $0.10, then you pay $0.10. If you run enough jobs to exceed $0.10, say $0.15, then you pay just $0.15. We&#8217;ll let you all know when we&#8217;ve made this change to our pricing!
</p>
<p><b>How to Reserve Realtime Cores</b></p>
<p>
Go to the realtime tab on our web dashboard.
</p>
<p><img src="http://media.picloud.com/img/blog/realtime_before_reservation.png" /></p>
<p>
Select the type of core, and the number of cores you want for us to keep available for you, and then hit submit.
</p>
<p><img src="http://media.picloud.com/img/blog/realtime_after_reservation.png" /></p>
<p>
When the cores are ready, you&#8217;ll receive an email and the &#8220;start time&#8221; will be set.
</p>
<p><img src="http://media.picloud.com/img/blog/realtime_after_allocation.png" /></p>
<p>
When you run jobs, make sure that you set the <code>_type</code> keyword to the core type that you have reserved. In this example, we reserved 160 c2 cores.
</p>
<pre class="brush: python; title: ; notranslate">
cloud.call(f, _type='c2')
</pre>
<p>
Alternatively, reserving realtime cores will be possible through the Python console using the <code>cloud</code> library in its next release:
</p>
<pre class="brush: python; title: ; notranslate">
cloud.realtime.request('c2', 160)
</pre>
<p><b>How long does it take to allocate Realtime Cores?</b></p>
<p>
We&#8217;ve been working hard making allocation time faster and more consistent, which has been a common issue raised by users. With our latest design, it should take no more than 15 minutes for cores to be provisioned!
</p>
<p><b>How many cores can you allocate?</b></p>
<p>
We have users who provision hundreds and thousands of cores using our realtime service. If you&#8217;re worried you might break our backs, file a support ticket and let us know what you&#8217;re up to.
</p>
<h3>Conclusion</h3>
<p>
The takeaway we want to leave with you is as follows: The PiCloud platform will not only get you up and running in no time with no configuration, but will also be able to meet your exact computational requirements if necessary&mdash;even if you need 1000 cores in 15 minutes. It&#8217;s not a question of <i>if</i>, but <i>how</i>, and we&#8217;re working to make <i>how</i> as easy as possible.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.picloud.com/2011/11/16/how-to-get-more-parallel-computing-power/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Academic Research Program Grant Recipients</title>
		<link>http://blog.picloud.com/2011/11/04/academic-research-program-grant-recipients/</link>
		<comments>http://blog.picloud.com/2011/11/04/academic-research-program-grant-recipients/#comments</comments>
		<pubDate>Fri, 04 Nov 2011 22:28:52 +0000</pubDate>
		<dc:creator>Ken Elkabany</dc:creator>
				<category><![CDATA[Academic Research Program]]></category>
		<category><![CDATA[academic research program recipients]]></category>

		<guid isPermaLink="false">http://blog.picloud.com/?p=735</guid>
		<description><![CDATA[
We are excited to announce the recipients of the $500 (10,000 c1 core hours) Academic Research Program Grant. While we had originally planned to award only two grants, we were pleasantly surprised by the level of interest our program received from highly-qualified individuals. In response, we decided to award nine grants!


We&#8217;ve included a list of [...]]]></description>
			<content:encoded><![CDATA[<p>
We are excited to announce the recipients of the $500 (10,000 c1 core hours) Academic Research Program Grant. While we had originally planned to award only two grants, we were pleasantly surprised by the level of interest our program received from highly-qualified individuals. In response, we decided to <b>award nine grants</b>!
</p>
<p>
We&#8217;ve included a list of recipients below so you can see some of the great work that will be benefiting from our platform.
</p>
<p>
If you missed out on our first cycle of grants, don&#8217;t sweat! We plan on having a second cycle in the near future.
</p>
<h3>List of Recipients</h3>
<p>
<b>Chris Beaumont</b><br />
PhD candidate at the Institute for Astronomy<br />
University of Hawaii at Manoa
</p>
<p style="font-style: italic">
Developing an automated technique to search astrophysical images for &#8220;bubbles&#8221; blown by massive young stars. This will help astronomers handle their rapidly growing datasets, which we currently examine by eye when looking for morphologically complex objects.
</p>
<p>
<b>Damian Borth</b><br />
PhD candidate<br />
University of Kaiserslautern<br />
German Research Center for Artificial Intelligence (DFKI)
</p>
<p style="font-style: italic">
Video concept detection using web-based training sources like YouTube. I particularly focus my interest on developing learning approaches which adopt to weak labels and deal with the domain change problem.
</p>
<p>
<b>Liang Yuxian Eugene</b><br />
Research Assistant<br />
National Cheng Chi University
</p>
<p style="font-style: italic">
Modeling the Lifecycle of Natural Disasters.
</p>
<p>
<b>Patrick Henaff</b><br />
Associate Professor of Finance<br />
Institut d&#8217;Administration des Entreprises, Université Paris I Panthéon-Sorbonne
</p>
<p style="font-style: italic">
Motivated by the current financial crisis, my research focus is to understand and measure model risk in computational finance, ie. the risk associated with the use of an inappropriate model to price and manage financial derivatives. Inspired by other scientific disciplines, in particular computational biology, this research project will also experiment with a new type of scientific production, based on the publication and peer review of of self-contained, reproducible experimental protocols, as opposed to summary results.
</p>
<p>
<b>Roy Keyes</b><br />
Phd candidate in the Department of Physics and Astronomy<br />
University of New Mexico
</p>
<p style="font-style: italic">
Developing faster, more accurate methods of calculating radiation dose to improve cancer treatment along with associated research tools.
</p>
<p>
<b>Meredith Lehmann</b><br />
La Jolla High School
</p>
<p style="font-style: italic">
SARS and the swine flu rekindled interest in the spread of epidemics and a large literature appeared to conclusively prove the intuitive proposition that modern epidemics spread disproportionately through large hub airports near large population centers. My research challenges the conventional wisdom using a different model of the US transportation network. A different picture of epidemic propagation in the continental US emerges from this analysis. Primarily auto, not air, travel seeds counties with a modest number of infecteds and the subsequent explosion at the county level dominates further seeding by infected travelers. No preferred epidemic pathways arise in my simulated world and may not be present in the real world either.
</p>
<p>
<b>Eric Lofgren</b><br />
PhD candidate in the Department of Epidemiology, Gillings School of Global Public Health<br />
University of North Carolina at Chapel Hill
</p>
<p style="font-style: italic">
The mathematical modeling and simulation of the transmission of Clostridium difficile in healthcare settings.
</p>
<p>
<b>Ariel Rokem</b><br />
Post-Doctoral Researcher at the Department of Psychology under Professor Brian Wandell<br />
Stanford University
</p>
<p style="font-style: italic">
Using Magnetic Resonance Imaging (MRI) to measure physiological and anatomical properties of the human visual system. In particular, trying to understand the biological underpinnings of differences in perception between the center of the visual field and the periphery.
</p>
<p>
<b>Thomas Wiecki</b><br />
PhD candidate under Professor Michael J. Frank<br />
Brown University
</p>
<p style="font-style: italic">
My research aims at elucidating the cognitive and neurobiological mechanisms underlying decision making in the healthy and diseased brain. Towards this goal I am simulating parts of the intact brain in the computer and model how different brain lesions and psychiatric diseases influence brain activity and behavior. Ultimately, this research will help in developing better diagnosis and treatment options for brain disorders such as schizophrenia and Parkinson&#8217;s disease.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.picloud.com/2011/11/04/academic-research-program-grant-recipients/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>20 Free Core Hours Every Month!</title>
		<link>http://blog.picloud.com/2011/10/24/20-free-core-hours-every-month/</link>
		<comments>http://blog.picloud.com/2011/10/24/20-free-core-hours-every-month/#comments</comments>
		<pubDate>Mon, 24 Oct 2011 23:31:04 +0000</pubDate>
		<dc:creator>Ken Elkabany</dc:creator>
				<category><![CDATA[What's New]]></category>
		<category><![CDATA[free core hours]]></category>

		<guid isPermaLink="false">http://blog.picloud.com/?p=729</guid>
		<description><![CDATA[
Starting this month, all users will get 20 c1 core hours worth of credits each and every month.


If you ran out of your original 5 core hour credits, you can come back and play around some more!
If you have minimal computing needs, this means that you can now use PiCloud regularly without even having to [...]]]></description>
			<content:encoded><![CDATA[<p>
Starting this month, all users will get 20 c1 core hours worth of credits each and every month.
</p>
<ul>
<li>If you ran out of your original 5 core hour credits, you can come back and play around some more!</li>
<li>If you have minimal computing needs, this means that you can now use PiCloud regularly without even having to enter a credit card.</li>
</ul>
<p>
Looking for more? Don&#8217;t forget, we&#8217;re giving away $500 worth of credits as part of our <a href="http://blog.picloud.com/2011/10/20/introducing-free-core-hours-for-academic-research/">Academic Research Program</a>. Applications are due this Thursday, October 27th.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.picloud.com/2011/10/24/20-free-core-hours-every-month/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Introducing Free Core Hours for Academic Research</title>
		<link>http://blog.picloud.com/2011/10/20/introducing-free-core-hours-for-academic-research/</link>
		<comments>http://blog.picloud.com/2011/10/20/introducing-free-core-hours-for-academic-research/#comments</comments>
		<pubDate>Thu, 20 Oct 2011 22:48:46 +0000</pubDate>
		<dc:creator>Ken Elkabany</dc:creator>
				<category><![CDATA[Academic Research Program]]></category>
		<category><![CDATA[What's New]]></category>
		<category><![CDATA[free core hours]]></category>

		<guid isPermaLink="false">http://blog.picloud.com/?p=718</guid>
		<description><![CDATA[
From the beginning, we&#8217;ve prided ourselves on bringing the cloud to scientists and engineers who don&#8217;t have access to a major compute cluster or lack the system administration know-how to operate one. And we&#8217;re indebted to the research groups around the world who quickly understood our value proposition, and enthusiastically adopted our platform. We could [...]]]></description>
			<content:encoded><![CDATA[<p>
From the beginning, we&#8217;ve prided ourselves on bringing the cloud to scientists and engineers who don&#8217;t have access to a major compute cluster or lack the system administration know-how to operate one. And we&#8217;re indebted to the research groups around the world who quickly understood our value proposition, and enthusiastically adopted our platform. We could not have gotten to where we are today without them. To return the favor, today we&#8217;re introducing the PiCloud Academic Research Program to grant <b>$500</b> (10,000 c1 core hours)<b> free</b> to two researchers.
</p>
<p>
Since this is the first time we&#8217;re doing this, we want to keep it simple. If you wish to apply, send an e-mail to <a href="mailto:research-funding@picloud.com?subject=Application for the PiCloud Academic Research Program">research-funding@picloud.com</a> by <b>Thursday, October 27th</b> with the following:
</p>
<ol>
<li>Full name</li>
<li>Organization or educational Institution</li>
<li>Your position</li>
<li>Short biography</li>
<li>A summary of your research field and project. Feel free to include conference papers, publications, and links to project websites. Please emphasize how PiCloud&#8217;s compute power will facilitate your research.</li>
</ol>
<p>
We will be awarding two submissions with free core hours. Winning researchers will also have an opportunity to get larger exposure for their projects on our blog and website. We&#8217;re looking forward to your submissions!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.picloud.com/2011/10/20/introducing-free-core-hours-for-academic-research/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Determining the Life Cycles of Natural Disasters with PiCloud</title>
		<link>http://blog.picloud.com/2011/10/11/determining-life-cycles-of-natural-disasters-with-picloud/</link>
		<comments>http://blog.picloud.com/2011/10/11/determining-life-cycles-of-natural-disasters-with-picloud/#comments</comments>
		<pubDate>Tue, 11 Oct 2011 20:04:55 +0000</pubDate>
		<dc:creator>Liang Yuxian Eugene, Research Assistant at National Cheng-Chi University</dc:creator>
				<category><![CDATA[Success Story]]></category>
		<category><![CDATA[mongo]]></category>
		<category><![CDATA[natural disasters]]></category>
		<category><![CDATA[s1]]></category>

		<guid isPermaLink="false">http://blog.picloud.com/?p=647</guid>
		<description><![CDATA[This is the second in a series of guest blog posts that will be showcasing successful uses of the PiCloud Platform. The first was Building a Biological Database and Doing Comparative Genomics in the Cloud.
Background Information
We are developing various models that help define the life cycles of natural disasters. In order to develop these models, [...]]]></description>
			<content:encoded><![CDATA[<p><em>This is the second in a series of guest blog posts that will be showcasing successful uses of the PiCloud Platform. The first was <a href="http://blog.picloud.com/2011/09/27/building-a-biological-database-and-doing-comparative-genomics-in-the-cloud/">Building a Biological Database and Doing Comparative Genomics in the Cloud</a>.</em></p>
<h3>Background Information</h3>
<p>We are developing various models that help define the life cycles of natural disasters. In order to develop these models, we need to process large amounts of data; the data comes from social networks such as Twitter and official government sources.</p>
<p>As you can imagine, computing and comparing data across different sources can be difficult, not to mention the scale of the data that needs to be processed in a moment&#8217;s notice. In addition, the research project is undertaken by social scientists; there&#8217;s a constraint in terms of budget and technical personnel; I am one of the few technical personnel working on this research project.</p>
<p>My objective is to develop a software system that helps discover and detect the life cycles of natural disasters, all within the constraints mentioned above.</p>
<p>The general process of my software system is as such:</p>
<ol>
<li>Scrape data and store it in a MongoDB cluster hosted on Amazon EC2.</li>
<li>Retrieve the data and perform analysis on it, such as natural language processing.</li>
<li>Store the results of step 2.</li>
</ol>
<p>I am currently running my application on Ubuntu 10.04 and using MongoDB as my main data store. Python is my primary programming language. I&#8217;ll be sharing two ways in which PiCloud helped me cut down development time and costs <strong>tremendously</strong>.</p>
<h3>How PiCloud Saved My Day with the s1 Core Type</h3>
<p>As mentioned earlier, I am required to scrape data using Twitter&#8217;s API. I originally used PiCloud&#8217;s c1 core type; it worked for a while but it quickly ran into throttling issues. Fortunately, PiCloud announced the s1 core type just a day before I faced throttling issues.</p>
<p>PiCloud&#8217;s s1 core type is optimized for mining and scraping operations since each core uses a different IP address; the effects of IP throttling limits are minimal. Should I attempt to replicate a similar architecture to perform mining operations, I might not be able to complete the alpha version of the software system.</p>
<p>I now find myself leveraging the s1 core type; which helps me to scrape and mine for various data sources, in particular Twitter and other news sources.</p>
<p>Switching to s1 core type is extremely easy, all we needed to do is change the <code>type</code> keyword:</p>
<pre class="brush: python; title: ; notranslate">
# from
_type = 'c1'
# to
_type = 's1'
</pre>
<p>Thanks to PiCloud&#8217;s s1 core type, I can continue to collect data with minimal worries.</p>
<h3>How PiCloud&#8217;s Serverless Architecture Saves Development Time</h3>
<p>As I am storing my data on Amazon EC2 via a MongoDB cluster, I need a way to for PiCloud to &#8217;speak&#8217; with my database. My initial application has a REST interface that allows PiCloud to &#8217;speak&#8217; with MongoDB; each REST endpoints represents a cost in terms of development time, and ongoing maintenance.</p>
<p>On average, I need to spend 20 minutes or more to develop a specific REST endpoint for a specific use. Now using PiCloud, I do not even need to develop or maintain these REST endpoints. PiCloud&#8217;s serverless paradigm means all I need to do is allow PiCloud to read my database directly and calculations can be performed immediately. Here&#8217;s how it works:</p>
<p>We typically connect to MongoDB on a <code>localhost</code> by doing the following:</p>
<pre class="brush: python; title: ; notranslate">
from pymongo import Connection
connection = Connection('localhost')
</pre>
<p>However, we can run the above code on PiCloud by simply changing <code>localhost</code> to the external IP address of the Mongo server so that PiCloud knows how to reach it.</p>
<pre class="brush: python; title: ; notranslate">
from pymongo import Connection
# 'xxx.xxx.xxx.xxx' is the IP address and 12345 is the port number
connection = Connection('xxx.xxx.xx.xxx', 123456)
</pre>
<p>If we want the same code to work both locally and on PiCloud, we use <code>cloud.running_on_cloud()</code> to check how we should connect to MongoDB.</p>
<pre class="brush: python; title: ; notranslate">
from pymongo import Connection
if cloud.running_on_cloud():
    # 'xxx.xxx.xxx.xxx' is the IP address and 12345 is the port number
    connection = Connection('xxx.xxx.xx.xxx', 123456)
else:
    connection = Connection('localhost')
</pre>
<p>This means that I can leverage hundreds of cores automatically without any server management or configuration on my part. All I need to do is to write Python code and PiCloud takes care of the rest.</p>
<p>I am also leveraging PiCloud&#8217;s other core types, which includes c1, c2 and m1 core types, depending on the amount of computing required. As I am required to compute the data frequency, keyword frequency (and many other metrics) within a moments notice, PiCloud&#8217;s serverless paradigm fits perfectly as I do not need to spin up an entire EC2 cluster or even a single instance just to perform my calculations.</p>
<h3>Summary</h3>
<p>PiCloud has taken care of my server management and configuration needs. The ability to call up computing power without the need to spin up new EC2 instances is a huge time saver. It has saved me tremendous amount of time and effort, allowing me to focus on what is truly important, algorithms and calculations of data.</p>
<p><em><br />
Eugene enjoys solving difficult problems creatively in the form of building web applications using Python/Django and JavaScript/JQuery. He also enjoys doing research related to the areas of social computing, social media analysis, recommendation algorithms, link analysis, data visualization, data mining, information retrieval, business intelligence, and intelligent user interfaces. You can find him at <a href="http://www.liangeugene.com">http://www.liangeugene.com</a>.<br />
</em></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.picloud.com/2011/10/11/determining-life-cycles-of-natural-disasters-with-picloud/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introducing Scraping-Optimized Cores</title>
		<link>http://blog.picloud.com/2011/10/10/introducing-scraping-optimized-cores/</link>
		<comments>http://blog.picloud.com/2011/10/10/introducing-scraping-optimized-cores/#comments</comments>
		<pubDate>Mon, 10 Oct 2011 22:01:29 +0000</pubDate>
		<dc:creator>Ken Elkabany</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[new features]]></category>
		<category><![CDATA[s1]]></category>
		<category><![CDATA[scraping]]></category>

		<guid isPermaLink="false">http://blog.picloud.com/?p=690</guid>
		<description><![CDATA[
For users who aggregate data from around the web, you&#8217;ll find our latest core to be an integral part of your toolbox. s1 cores are comparable in performance to c1 cores with one extra trick up their sleeve: each job running in parallel will have a different IP.

Why is this important?

Using unique IPs is necessary [...]]]></description>
			<content:encoded><![CDATA[<p>
For users who aggregate data from around the web, you&#8217;ll find our latest core to be an integral part of your toolbox. <b>s1</b> cores are comparable in performance to <b>c1</b> cores with one extra trick up their sleeve: each job running in parallel will have a different IP.
</p>
<h3>Why is this important?</h3>
<p>
Using unique IPs is necessary to minimize the automated throttling most sites will impose when seeing fast, repeated access from a single IP.
</p>
<h3>How do I use it?</h3>
<p>
If you&#8217;re already using our <b>c1</b> cores, all you&#8217;ll need to do is set the <code>_type</code> keyword.
</p>
<p class="code" style="font-size:13px; color:#202020">
<font face="Courier New">cloud.call(func, _type=&#8217;s1&#8242;)</font>
</p>
<h3>How much?</h3>
<p>
$0.04/core/hour
</p>
<h3>Why don&#8217;t other cores have individual IPs?</h3>
<p>
For other core types, such as <b>c2</b>, multiple cores may be running on a single machine that is assigned only a single IP address. When using <b>s1</b> cores, you&#8217;re guaranteed that each core sits on a different machine.
</p>
<h3>Suggestions?</h3>
<p>
We&#8217;re excited to move the <b>s1</b> core type out of beta for our customers. If you have any suggestions for other core types you would like to see, please let us know.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.picloud.com/2011/10/10/introducing-scraping-optimized-cores/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building a Biological Database and Doing Comparative Genomics in the Cloud</title>
		<link>http://blog.picloud.com/2011/09/27/building-a-biological-database-and-doing-comparative-genomics-in-the-cloud/</link>
		<comments>http://blog.picloud.com/2011/09/27/building-a-biological-database-and-doing-comparative-genomics-in-the-cloud/#comments</comments>
		<pubDate>Tue, 27 Sep 2011 19:19:10 +0000</pubDate>
		<dc:creator>Joemar Taganna, PhD candidate at the Flanders Institute for Biotechnology (VIB)</dc:creator>
				<category><![CDATA[Success Story]]></category>
		<category><![CDATA[biological database]]></category>
		<category><![CDATA[comparative genomics]]></category>
		<category><![CDATA[sequence alignment]]></category>

		<guid isPermaLink="false">http://blog.picloud.com/?p=606</guid>
		<description><![CDATA[This is the first in a series of guest blog posts that will be showcasing successful uses of the PiCloud Platform.

Cloud computing is a revolutionizing technology. It sidesteps the need for buying, setting up and maintaining powerful computers for people who would rather spend time and effort directly on their high-level innovations.


In our particular use [...]]]></description>
			<content:encoded><![CDATA[<p><i>This is the first in a series of guest blog posts that will be showcasing successful uses of the PiCloud Platform.</i></p>
<p>
Cloud computing is a revolutionizing technology. It sidesteps the need for buying, setting up and maintaining powerful computers for people who would rather spend time and effort directly on their high-level innovations.
</p>
<p>
In our particular use case, we are using cloud computing for bioinformatics, specifically on building a database and in developing a pipeline for comparative analysis of a subset of genes across different E. coli genomes. I work in a lab that does not do bioinformatics as a primary research interest so I don’t have immediate access to an in-house computer cluster to do some computationally intensive tasks. This led me to explore cloud computing, and since I write scripts in Python, a search on “cloud computing” and “Python” in Google led me to PiCloud.
</p>
<p><a href="http://media.picloud.com/img/blog/biodb_alignment.png"><br />
<img src="http://media.picloud.com/img/blog/biodb_alignment.png"  style="width: 90%; display: block; margin-left: auto; margin-right: auto;"><br />
</a></p>
<p>
After experimenting with Amazon EC2 myself trying to figure out how to build a smooth interface to it from my pipeline, it was a sigh of relief to know about a Python library that does exactly this…and it does it in a distinctly Pythonic way – simple and elegant. With PiCloud’s library, you can deploy your computations to the cloud, in a massively parallel mode if need be, with minimal modifications to your Python code.
</p>
<p>
At the moment, I mainly use PiCloud on two fronts. I am using it for some critical functions in a web-based biological database of our genes/proteins of interest.  The database is running on Google App Engine (which in itself is another breed of cloud computing service). App Engine is great but it has certain limitations that prevent biological databases from running in its platform alone. I needed to use NumPy, matplotlib and Biopython among other Python packages as well as command line programs written in C and C++ (e.g. <a href="http://www.clustal.org/">ClustalW</a>, <a href="http://emboss.sourceforge.net">EMBOSS</a> and <a href="http://hmmer.janelia.org">HMMER</a>). All of which I couldn’t install or use in App Engine. In the pipeline development aspect of my work, which I do on my laptop; while I do have all these packages and programs installed, certain computations take a lot of time and can slow down my system. I now submit these tasks to the cloud for processing where I can choose to run them a lot faster.
</p>
<p>
Python packages and/or programs written in other languages that you need can be used within PiCloud with their Environments feature. Configuring an environment is essentially setting up a filesystem to include all of the packages and programs you need. You configure a filesystem by SSH-ing into a Linux virtual machine, where you can install packages and programs through the command line as you would on any machine. After you log off of the machine, you save the environment, and then you’re ready for action. As long as you’ve installed all the things you need, you never have to do the configuration again. However, if you need to install more, you just connect again to the VM through SSH and modify it…it’s that easy.
</p>
<p><a href="http://media.picloud.com/img/blog/biodb_environment_ui_panel.png"><br />
<img src="http://media.picloud.com/img/blog/biodb_environment_ui_panel.png"  style="width: 90%; display: block; margin-left: auto; margin-right: auto;"><br />
</a></p>
<p>
Running functions on PiCloud is just as easy as calling:
</p>
<pre class="brush: python; title: ; notranslate">
&gt;&gt;&gt; cloud.call(your_function, 'argument')
</pre>
<p>
and if you need to use your preconfigured environment you just add the _env keyword argument:
</p>
<pre class="brush: python; title: ; notranslate">
&gt;&gt;&gt; cloud.call(your_function, 'argument', _env='your_saved_environment')
</pre>
<p>
For our database that runs on Google App Engine, invoking cloud.call() won’t work because, just like the other Python packages mentioned, I also can’t install the PiCloud library there. Luckily, PiCloud has a way to talk with any web app through its REST API. For this you need to register functions that you would like to call through REST:
</p>
<pre class="brush: python; title: ; notranslate">
&gt;&gt;&gt; cloud.rest.register(your_function, 'name_of_your_function')
</pre>
<p>
which will give you the URL where you will send your HTTP GET or POST requests to invoke the function, which then returns the job ID as a response. The status of the job and the results are fetched by making GET requests to another set of URLs given the job ID as a parameter. (Please refer to the docs for more details.)
</p>
<p>
In our database, we use the REST API for generating operon maps and for fetching sequences from databases both using functions that depend on Biopython. We also have REST functions for doing sequence alignment (using ClustalW or EMBOSS) in the cloud from inputs received from the web app. With PiCloud’s REST API and Google App Engine, being both cloud-based platforms, we made ourselves a working prototype of how to leverage cloud computing for building biological databases that can potentially scale without the need for a major rewrite of the code to adapt to any future spike in usage and traffic.
</p>
<p></p>
<blockquote><p><span style="font-size: 18px; color: #666666; font-style: italic;">&#8220;this would normally take 20 to 25 hours&#8230; I was able to run it in PiCloud in only 50 minutes&#8221;</span></p></blockquote>
<p></p>
<p>
In my latest run of our offline bioinformatics pipeline, I analysed more than a 100 E. coli genomes where we found around 1400 of our protein of interest, in total. I needed to do sequence alignment of all the pairwise combinations of those 1400 proteins which is around a million protein pairs. In my laptop (2.26 GHz Intel Core 2 Duo with 4GB RAM), this would normally take 20 to 25 hours to complete without parallelization. I was able to run it in PiCloud in only 50 minutes and I could have run it faster with a more optimized code. All steps in the pipeline can be done from a web app, again through the REST API. Therefore, a plan for the final “publicly consumable” form of the program is to make it completely web-based…completely running on the cloud.
</p>
<p><a href="http://media.picloud.com/img/blog/biodb_submitted.png"><br />
<img src="http://media.picloud.com/img/blog/biodb_submitted.png"  style="width: 90%; display: block; margin-left: auto; margin-right: auto;"><br />
</a></p>
<p>
With an easy access to the cloud, the possibilities are unlimited. Now, ordinary biologists can do computationally demanding tasks without the need to delve deep into server and database management and without the complexities and hassles of running jobs in grids and clusters.
</p>
<p>
<i><br />
Joemar Taganna is a PhD candidate at the <a href="http://www.vib.be">Flanders Institute for Biotechnology (VIB)</a> in Belgium. He works in a collaborative project between the Laboratory of Structural and Molecular Microbiology in Vrije Universiteit Brussel and the Laboratory of Medical Biotechnology in Universiteit Gent. The project aims to have a holistic view of the major adhesive protein arsenal of various E. coli pathotypes in order to elucidate pathogen-specific targets for anti-adhesive therapeutics.<br />
</i></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.picloud.com/2011/09/27/building-a-biological-database-and-doing-comparative-genomics-in-the-cloud/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Introducing Environments &#8212; Run Anything on PiCloud</title>
		<link>http://blog.picloud.com/2011/09/26/introducing-environments-run-anything-on-picloud/</link>
		<comments>http://blog.picloud.com/2011/09/26/introducing-environments-run-anything-on-picloud/#comments</comments>
		<pubDate>Mon, 26 Sep 2011 23:45:47 +0000</pubDate>
		<dc:creator>Ken Elkabany</dc:creator>
				<category><![CDATA[What's New]]></category>
		<category><![CDATA[environment]]></category>
		<category><![CDATA[new features]]></category>

		<guid isPermaLink="false">http://blog.picloud.com/?p=511</guid>
		<description><![CDATA[
Environments mark an important milestone for PiCloud. Whereas Function Publishing makes the computing power of PiCloud accessible to all programming languages, Environments enable you to use any library or binary you need in your computation. The possibilities are limitless, but here are a couple examples of what you can do with environments:



Install any non-Python software [...]]]></description>
			<content:encoded><![CDATA[<p>
Environments mark an important milestone for PiCloud. Whereas <a href="http://blog.picloud.com/2011/09/14/introducing-function-publishing-via-rest/">Function Publishing</a> makes the computing power of PiCloud accessible to all programming languages, Environments enable you to use <b>any</b> library or binary you need in your computation. The possibilities are limitless, but here are a couple examples of what you can do with environments:
</p>
<p></p>
<ol>
<li>Install any non-Python software package you need via apt-get or make.</li>
<li>Install any Python module that we do not automatically extract from your machines, which are typically those that require compilation or depend on external libraries.</li>
</ol>
<p>In this post, we&#8217;ll show you how to create and use your first environment. We&#8217;ll be installing the <a href="http://obspy.org/">ObsPy</a> package, which is a Python toolbox for processing seismological data.</p>
<h3>Why Environments?</h3>
<p>
We strive to make moving your computation to the cloud as easy as possible. That&#8217;s why our <code>cloud</code> Python package automatically detects and transfers dependencies over to our cloud.
</p>
<pre class="brush: python; title: ; notranslate">
import cloud
from your_expansive_library_of_functions import complex_function
# cloud.call transfers all the modules needed to run complex_function on PiCloud
cloud.call(complex_function)
</pre>
<p>
Unfortunately, automatic dependency transfer only works for pure Python modules. The <code>ObsPy</code> package requires both a .pth file and C-code compilation for proper operation. So the following simple function quickly runs into problems:
</p>
<pre class="brush: python; title: ; notranslate">
def simple_function():
    import obspy
</pre>
<pre class="brush: python; title: ; notranslate">
&gt;&gt;&gt; jid = cloud.call(simple_function)
&gt;&gt;&gt; cloud.result(jid)
[Mon Sep 19 16:39:13 2011] - [WARNING] - Cloud: Job 1337 threw exception:
 Could not depickle job
Traceback (most recent call last):
  File &quot;/usr/local/lib/python2.7/dist-packages/cloud/serialization/cloudpickle.py&quot;, line 679, in subimport
    __import__(name)
ImportError: No module named obspy
</pre>
<p>
Importing <code>ObsPy</code> fails because it could not be transferred to PiCloud in working form. You might be wondering how you&#8217;ve been able to use NumPy, SciPy, and other natively-compiled libraries on PiCloud. The answer is we have many libraries pre-installed on our systems. Here are the respective links for what we have pre-installed for <a href="http://www.picloud.com/docs/base_environment/1/installed/">Python 2.6</a>, and <a href="http://www.picloud.com/docs/base_environment/2/installed/">Python 2.7</a>.
</p>
<h3>Creating a new Environment</h3>
<p>
<b>Step 1: Go to the Environments tab in the Control Panel.</b>
</p>
<p><a href="http://media.picloud.com/img/blog/environment_blank_ui_panel.png"><br />
<img src="http://media.picloud.com/img/blog/environment_blank_ui_panel.png" /><br />
</a></p>
<p></p>
<p>
<b>Step 2: Click &#8220;create new environment&#8221;.</b>
</p>
<p><a href="http://media.picloud.com/img/blog/environment_create_ui_panel.png"><br />
<img src="http://media.picloud.com/img/blog/environment_create_ui_panel.png" style="width: 90%; display: block; margin-left: auto; margin-right: auto; border: 2px solid #ccc;" /><br />
</a></p>
<p>
A popup box will appear. The <i>Base Environment</i> option allows you to choose what distribution of <a href="http://www.ubuntu.com">Ubuntu Linux</a> you would like to use as the base filesystem. It&#8217;s important to understand why we give you this option. If you use Python 2.7 on your local machine to offload computation to PiCloud, we will run your functions in the Python 2.7 interpreter from the Ubuntu 11.04 (Natty) base. If you use Python 2.6 on your local machine to offload computation to PiCloud, we will run your functions in the Python 2.6 interpreter from the Ubuntu 10.10 (Maverick) base. We are consistent about which interpreter we use since the modules you install in your environment may compile against a specific version of Python. In short, if you&#8217;re using Python 2.6 on your machines, but you use the Natty base, or vice versa, you will most likely run into compatibility issues.
</p>
<p>
The <i>Environment Name</i> is the name you&#8217;ll use to reference the environment in your jobs. The <i>Environment Description</i> is for yourself and/or your team to keep track of the purpose and contents of each environment.
</p>
<p></p>
<p>
<b>Step 3: Click submit.</b>
</p>
<p>
When you click submit, your environment will appear under the &#8220;Environments being configured&#8221; tab. You may have to wait a minute or two while we boot and configure a server with the appropriate base environment for you.
</p>
<p><img src="http://media.picloud.com/img/blog/environment_setup_ui_panel.png" /></p>
<p>
For our example, we&#8217;ve named the environment <b>seismology_env</b>.
</p>
<h3>Connecting to your Environment Setup Server</h3>
<p>
When the server is ready, click the connect link. Note that the instructions are currently tailored towards *nix environments. If you are using Windows and do not have an SSH client, we recommend <a href="http://www.bitvise.com/tunnelier">Tunnelier</a>.
</p>
<p><a href="http://media.picloud.com/img/blog/environment_connect_ui_panel.png"><br />
<img src="http://media.picloud.com/img/blog/environment_connect_ui_panel.png" style="width: 90%; display: block; margin-left: auto; margin-right: auto; border: 2px solid #ccc;" /><br />
</a></p>
<p>
Download the private key we have generated for you. You will use this same private key for all future environment setup servers. SSH enforces that only the owner should have access to the file, which is why we instruct you to run <code>chmod 400 privatekey.pem</code>. Once you&#8217;ve done that, SSH into the provided server using the private key by using the <code>-i</code> flag as shown in the instructions.
</p>
<h3>Getting Around Your Environment</h3>
<p>Once you&#8217;ve SSH-ed in, you&#8217;ll find yourself in a Ubuntu Linux filesystem environment.</p>
<pre class="brush: bash; title: ; notranslate">
picloud@ip-10-46-223-4:~$ ls /
bin  boot  dev  etc  home  lib  lib64  media  mnt  opt  proc  root  sbin  selinux  srv  sys  tmp  usr  var
</pre>
<p>
Your current working directory is <code>/home/picloud</code>:
</p>
<pre class="brush: bash; title: ; notranslate">
picloud@ip-10-46-223-4:~$ pwd
/home/picloud
</pre>
<p>
You can verify the distribution of Ubuntu you&#8217;re using:
</p>
<pre class="brush: bash; title: ; notranslate">
picloud@ip-10-46-223-4:~$ cat /etc/issue
Ubuntu 11.04 \n \l
</pre>
<p>
We give you sudo access so that you have the freedom to install anything anywhere.
</p>
<pre class="brush: bash; title: ; notranslate">
# this does not produce an error
picloud@ip-10-46-223-4:~$ sudo touch /root/i_can_be_root
</pre>
<p>
<b>Important</b>: The owner and group for files and directories in your environment do not matter. While you&#8217;ll be using the <code>setup</code> and <code>root</code> user accounts, your jobs will be run with an entirely different user account that will have access to the entire filesystem environment.
</p>
<h3>Setting Up Your Environment</h3>
<p>
We&#8217;ll use <code>sudo</code> access to install the ObsPy library.
</p>
<pre class="brush: bash; title: ; notranslate">
picloud@ip-10-46-223-4:~$ sudo pip install obspy.core obspy.signal
Downloading/unpacking obspy.core
  Downloading obspy.core-0.4.8.zip (186Kb): 186Kb downloaded
  Running setup.py egg_info for package obspy.core

    no previously-included directories found matching 'docs/other/*'
Downloading/unpacking obspy.signal
  Downloading obspy.signal-0.4.9.zip (4.0Mb): 4.0Mb downloaded
  Running setup.py egg_info for package obspy.signal

Requirement already satisfied (use --upgrade to upgrade): numpy&gt;1.0.0 in /usr/local/lib/python2.7/dist-packages (from obspy.core)
Requirement already satisfied (use --upgrade to upgrade): scipy in /usr/local/lib/python2.7/dist-packages (from obspy.signal)
Installing collected packages: obspy.core, obspy.signal
  Running setup.py install for obspy.core

    no previously-included directories found matching 'docs/other/*'
    Skipping installation of /usr/local/lib/python2.7/dist-packages/obspy/__init__.py (namespace package)
    Installing /usr/local/lib/python2.7/dist-packages/obspy.core-0.4.8-nspkg.pth
    Installing obspy-runtests script to /usr/local/bin
  Running setup.py install for obspy.signal

    building 'libsignal' extension
    gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/local/lib/python2.7/dist-packages/numpy/core/include -I/usr/include/python2.7 -c obspy/signal/src/recstalta.c -o build/temp.linux-x86_64-2.7/obspy/signal/src/recstalta.o
    gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/local/lib/python2.7/dist-packages/numpy/core/include -I/usr/include/python2.7 -c obspy/signal/src/xcorr.c -o build/temp.linux-x86_64-2.7/obspy/signal/src/xcorr.o
    ...
I/usr/include/python2.7 -c obspy/signal/src/fft/fftpack_litemodule.c -o build/temp.linux-x86_64-2.7/obspy/signal/src/fft/fftpack_litemodule.o
    gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions build/temp.linux-x86_64-2.7/obspy/signal/src/recstalta.o build/temp.linux-x86_64-2.7/obspy/signal/src/xcorr.o build/temp.linux-x86_64-2.7/obspy/signal/src/coordtrans.o build/temp.linux-x86_64-2.7/obspy/signal/src/pk_mbaer.o build/temp.linux-x86_64-2.7/obspy/signal/src/filt_util.o build/temp.linux-x86_64-2.7/obspy/signal/src/arpicker.o build/temp.linux-x86_64-2.7/obspy/signal/src/bbfk.o build/temp.linux-x86_64-2.7/obspy/signal/src/fft/fftpack.o build/temp.linux-x86_64-2.7/obspy/signal/src/fft/fftpack_litemodule.o -o build/lib.linux-x86_64-2.7/obspy/signal/lib/libsignal.so
    Skipping installation of /usr/local/lib/python2.7/dist-packages/obspy/__init__.py (namespace package)
    Installing /usr/local/lib/python2.7/dist-packages/obspy.signal-0.4.9-nspkg.pth
Successfully installed obspy.core obspy.signal
Cleaning up...
</pre>
<p>
As you can see, installing <code>obspy.signal</code> requires compiling C code with references to the NumPy library. We would not have been able to automatically extract this package from your machine.
</p>
<h3>Save the Environment</h3>
<p>
When you click &#8220;save&#8221; from the Environment Panel, your SSH connection will be closed. The length of time it takes to save your environment depends on how much you&#8217;ve installed. Once it&#8217;s ready, your new Environment will be listed under the &#8220;Your environments&#8221; section.
</p>
<h3>Using Your Environment</h3>
<p>
To use an environment, use the <code>_env</code> keyword argument to specify the environment you want to use by name. <code>_env</code> is valid for <code>cloud.call</code>, <code>cloud.map</code>, <code>cloud.cron.register</code>, or <code>cloud.rest.publish</code>.
</p>
<p>
To demonstrate, we will run a beamforming algorithm using the ObsPy library that we just installed. Beamforming is a technique used in seismology for geolocating seismic events. In this case, the event is the <a href="http://www.youtube.com/watch?v=oolfRoxta-E">demolition of the AGFA skyscraper in Munich</a>. We&#8217;ve derived the example from <a href="http://docs.obspy.org/tutorial/beamforming-fk-analysis.html">here</a>.
</p>
<p></p>
<p>
<b>Step 1: Upload the recorded <a href="http://examples.obspy.org/agfa.dump">dataset from the demolition</a> to <code>cloud.files</code></b>
</p>
<pre class="brush: python; title: ; notranslate">
cloud.files.put('agfa.dump')
</pre>
<p></p>
<p>
<b>Step 2: Define the beamforming function.</b>
</p>
<p>
Note that our version pulls the data from <code>cloud.files</code> directly into memory using the <code>getf</code> function.
</p>
<pre class="brush: python; title: ; notranslate">
import cloud
import pickle, urllib
from obspy.core import UTCDateTime
from obspy.signal.array_analysis import sonic
from obspy.signal import cornFreq2Paz

def beamforming(file_name):
    st = pickle.loads(cloud.files.getf(file_name).read())

    # Instrument correction to 1Hz corner frequency
    paz1hz = cornFreq2Paz(1.0, damp=0.707)
    st.simulate(paz_remove='self', paz_simulate=paz1hz)

    # Execute sonic
    kwargs = dict(
	# slowness grid: X min, X max, Y min, Y max, Slow Step
	sll_x=-3.0, slm_x=3.0, sll_y=-3.0, slm_y=3.0, sl_s=0.03,
	# sliding window propertieds
	win_len=1.0, win_frac=0.05,
	# frequency properties
	frqlow=1.0, frqhigh=8.0, prewhiten=0,
	# restrict output
	semb_thres=-1e9, vel_thres=-1e9, verbose=True, timestamp='mlabhour',
	stime=UTCDateTime(&quot;20080217110515&quot;), etime=UTCDateTime(&quot;20080217110545&quot;)
    )

    return sonic(st, **kwargs)
</pre>
<p></p>
<p>
<b>Step 3: Run it on PiCloud using the <code>_env</code> keyword.</b>
</p>
<p>
Since this is a computationally intensive task, we use the <b>c2</b> core type to take advantage of 2.5 compute units of power.
</p>
<pre class="brush: python; title: ; notranslate">
&gt;&gt;&gt; jid = cloud.call(beamforming, 'agfa.dump', _env='seismology_env', _type='c2')
&gt;&gt;&gt; out = cloud.result(jid)
&gt;&gt;&gt; out
array([[  7.33088462e+05,   6.52313948e-01,   4.77909058e-17,
          1.63009177e+02,   1.12929181e+00],
       [  7.33088462e+05,   6.54728115e-01,   4.92721051e-17,
          1.58838740e+02,   9.97246208e-01],
       [  7.33088462e+05,   6.65887892e-01,   5.40099541e-17,
          1.58552264e+02,   9.02496537e-01],
       ...,
       [  7.33088462e+05,   7.97200561e-01,   2.54941247e-16,
          1.84349488e+01,   1.23328829e+00],
       [  7.33088462e+05,   7.93642402e-01,   2.90117096e-16,
         -1.20947571e+01,   8.59069264e-01],
       [  7.33088462e+05,   8.08987796e-01,   3.06803433e-16,
         -2.65650512e+01,   8.72066511e-01]])
</pre>
<p>
To better visualize the result, we can plot the output:
</p>
<p><a href="http://media.picloud.com/img/blog/environment_beamforming_output.png"><br />
<img src="http://media.picloud.com/img/blog/environment_beamforming_output.png" style="width: 100%; display: block; margin-left: auto; margin-right: auto;" /><br />
</a></p>
<p>
The following code was used to generate the plot:
</p>
<pre class="brush: python; title: ; notranslate">
import matplotlib.pyplot as plt
labels = 'rel.power abs.power baz slow'.split()

fig = plt.figure()
for i, lab in enumerate(labels):
    ax = fig.add_subplot(4, 1, i + 1)
    ax.scatter(out[:, 0], out[:, i + 1], c=out[:, 1], alpha=0.6,
               edgecolors='none')
    ax.set_ylabel(lab)
    ax.xaxis_date()

fig.autofmt_xdate()
fig.subplots_adjust(top=0.95, right=0.95, bottom=0.2, hspace=0)
</pre>
<h3>Pricing</h3>
<p>
Creating environments is <b>free</b>. There are no additional charges associated with this feature. From our perspective, environments allow you to run more cycles on PiCloud, which is where we get our pay off.
</p>
<h3>Conclusion</h3>
<p>
With Environments, every programming language and software package is now a viable tool to use on PiCloud. While we love Python, we&#8217;re excited that it is no longer the &#8220;sole language of the PiCloud Platform.&#8221; Coupled with our function publishing feature, we envision Python serving as the glue language through which users can orchestrate their computation on our otherwise language-agnotistic platform.
</p>
<p><a href="http://media.picloud.com/img/blog/language_agnostic_features.png"><br />
<img src="http://media.picloud.com/img/blog/language_agnostic_features.png" style="width: 100%; display: block; margin-left: auto; margin-right: auto;" /><br />
</a></p>
<p>
Thanks to the select group of users who beta tested this feature for us, and to Ken Park from PiCloud who envisioned and shepherded this project to launch!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.picloud.com/2011/09/26/introducing-environments-run-anything-on-picloud/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Introducing Function Publishing via REST</title>
		<link>http://blog.picloud.com/2011/09/14/introducing-function-publishing-via-rest/</link>
		<comments>http://blog.picloud.com/2011/09/14/introducing-function-publishing-via-rest/#comments</comments>
		<pubDate>Thu, 15 Sep 2011 01:57:50 +0000</pubDate>
		<dc:creator>Ken Elkabany</dc:creator>
				<category><![CDATA[What's New]]></category>
		<category><![CDATA[function publishing]]></category>
		<category><![CDATA[new features]]></category>
		<category><![CDATA[rest]]></category>

		<guid isPermaLink="false">http://blog.picloud.com/?p=389</guid>
		<description><![CDATA[
We&#8217;ve been devoting significant time to making PiCloud a useful utility outside of the Python ecosystem. The first feature we have to showcase this is the ability to publish a Python function to a URL. There are a few reasons you might want to do this:



To call Python functions from a programming language other than [...]]]></description>
			<content:encoded><![CDATA[<p>
We&#8217;ve been devoting significant time to making PiCloud a useful utility outside of the Python ecosystem. The first feature we have to showcase this is the ability to publish a Python function to a URL. There are a few reasons you might want to do this:
</p>
<p><!-- add space --></p>
<ol>
<li>To call Python functions from a programming language other than Python. For example, if you&#8217;re integrating the PiCloud platform into a Java codebase, or even into a smartphone application (Android or iPhone).</li>
<li>To use PiCloud from Google AppEngine, since our <code>cloud</code> client library is not supported on GAE.</li>
<li>Because you&#8217;re tired of setting up web application projects when what you really need is a scalable RPC system.</li>
</ol>
<p>
In this post, we&#8217;ll give you your first taste of publishing functions on the web.
</p>
<h3>Define your Function</h3>
<p>
Just like when you offload regular computation to PiCloud, feel free to do anything in your function including importing custom libraries and making external connections.
</p>
<pre class="brush: python; title: ; notranslate">
def add(x, y):
    &quot;&quot;&quot;This function adds!&quot;&quot;&quot;
    return x+y
</pre>
<h3>Publish It</h3>
<pre class="brush: python; title: ; notranslate">
&gt;&gt;&gt; import cloud
&gt;&gt;&gt; cloud.setkey(key, secret_key)
&gt;&gt;&gt; cloud.rest.publish(add, 'addition')
'https://api.picloud.com/r/2/addition'
</pre>
<p>
The first argument, <code>add</code>, is your function. The second argument, <code>addition</code>, is a label so you can reference the function later; it&#8217;s also present in the returned URL for clarity. For a list of all other arguments, refer to the <a href="http://docs.picloud.com/moduledoc.html#module-cloud.rest"><code>cloud.rest</code> module documentation</a>.
</p>
<p>
Let&#8217;s get information about the function we just published by making a GET request on the returned url. We recommend <a href="http://curl.haxx.se/">curl</a> to do this from a shell. We authenticate requests using <a href="http://en.wikipedia.org/wiki/Basic_access_authentication">basic authentication</a>. In curl, use &#8220;-u&#8221; as shown below to specify your key as your username, and secret key as your password. Note that we automatically extract the function&#8217;s doc string as the description.
</p>
<pre class="brush: bash; title: ; notranslate">
$ curl -k -u 'key:secret_key' https://api.picloud.com/r/2/addition/
{&quot;output_encoding&quot;: &quot;json&quot;, &quot;version&quot;: &quot;0.1&quot;, &quot;description&quot;: &quot;This function adds!&quot;, &quot;signature&quot;: &quot;addition(x, y)&quot;, &quot;uri&quot;: &quot;https://api.picloud.com/r/2/addition&quot;, &quot;label&quot;: &quot;addition&quot;}
</pre>
<p>
You can also see your published functions from your <a href="https://www.picloud.com/accounts/rest/">account control panel</a>.
</p>
<p><a href="http://media.picloud.com/img/blog/rest_ui_panel.png"><img src="http://media.picloud.com/img/blog/rest_ui_panel.png" alt="" title="rest_ui_panel" class="alignnone size-medium wp-image-436" /></a></p>
<h3>Call the Published Function</h3>
<p>
Now let&#8217;s call the function by using a POST request to the same URL. To specify arguments to the function <code>add</code>, you simply pass them in as <a href="http://en.wikipedia.org/wiki/JSON">JSON</a> encoded POST values. In this case, you would specify the POST values <code>x</code> and <code>y</code>.
</p>
<pre class="brush: bash; title: ; notranslate">
$ curl -k -u 'key:secret_key' https://api.picloud.com/r/2/addition/ -d x=1 -d y=1
{'jid': 809730}
</pre>
<h3>Get the Result</h3>
<p>
There are two ways we can grab the result of this job. The standard way is through your Python console:
</p>
<pre class="brush: python; title: ; notranslate">
&gt;&gt;&gt; import cloud
&gt;&gt;&gt; cloud.setkey(key, secret_key)
&gt;&gt;&gt; cloud.result(809730)
2
</pre>
<p>
The language-agnostic way to do this using our REST API is to query the following URL: <code>https://api.picloud.com/job/{job_id}/result/</code>.
</p>
<pre class="brush: bash; title: ; notranslate">
$ curl -k -u 'key:secret_key' https://api.picloud.com/job/809730/result/
{&quot;result&quot;: 2}
</pre>
<p>
The difference between these two methods is that <code>cloud.result</code> will block until the result is ready; our REST API will return a &#8220;job not done&#8221; error, so you&#8217;ll have to keep querying until it&#8217;s ready.
</p>
<p>
For a full specification of our API, please see our <a href="http://docs.picloud.com/rest.html">REST API documentation</a>.
</p>
<h3>Taking Advantage of JSON Arguments</h3>
<p>
Since arguments are specified as JSON, you can easily pass in strings, lists, and dictionaries into your published functions. For example, we can concatenate two strings using our addition function:
</p>
<pre class="brush: bash; title: ; notranslate">
$ curl -k -u 'key:secret_key' https://api.picloud.com/r/2/addition -d &quot;x=\&quot;Hello, \&quot;&quot; -d &quot;y=\&quot;World\&quot;&quot;
{'jid': 809731}
$ curl -k -u 'key:secret_key' https://api.picloud.com/job/809731/result/
{&quot;result&quot;: &quot;Hello, World&quot;}
</pre>
<p>
We can also merge two lists using our addition function:
</p>
<pre class="brush: bash; title: ; notranslate">
$ curl -k -u 'key:secret_key' https://api.picloud.com/r/2/addition -d &quot;x=[1,2,3]&quot; -d &quot;y=[4,5,6]&quot;
{'jid': 809732}
$ curl -k -u 'key:secret_key' https://api.picloud.com/job/809732/result/
{&quot;result&quot;: [1, 2, 3, 4, 5, 6]}
</pre>
<p>
These work, of course, because in Python the addition operator can be applied to strings and lists, not just numbers.
</p>
<h3>Handling Raw Data</h3>
<p>
JSON does not natively support binary data. While you can encode the data to base64, and decode it in your function, we offer a more straightforward and efficient method. Binary data can be passed into a published function by using multipart/form-data as a file upload (MIME Content-Disposition sub-header has a <code>filename</code> parameter).
</p>
<p><b>Example</b></p>
<p>
To showcase raw data handling, we&#8217;re going to publish a function to create thumbnails. We&#8217;ll use this picture of Albert Einstein.
</p>
<p><center><br />
<a href="http://media.picloud.com/img/blog/albert_einstein.jpg"><img src="http://media.picloud.com/img/blog/albert_einstein.jpg" alt="" title="Albert Einstein" class="alignnone size-full wp-image-455" /></a><br />
</center></p>
<p>
Here&#8217;s the function we&#8217;ll use to create a thumbnail of an image. We use <code>StringIO</code> so that we can open and save the image in a memory buffer, rather than to a file.
</p>
<pre class="brush: python; title: ; notranslate">
from PIL import Image
from cStringIO import StringIO

def thumbnail(raw_img_data, width=50, height=50, output_format='JPEG'):
    im = Image.open(StringIO(raw_img_data))
    im.thumbnail((width, height))
    out_data = StringIO()
    im.save(out_data, output_format)
    return out_data.getvalue()

import cloud
# be sure to set the output encoding to raw
cloud.rest.publish(thumbnail, 'thumbnail', out_encoding='raw')
</pre>
<p>
Call the function. Use -F in conjunction with the @ symbol to POST an image file as a file upload, which will be treated as raw data by PiCloud. We can adjust the width and height by passing in POST values, or if we omit them, the default value of 50 will be used.
</p>
<pre class="brush: bash; title: ; notranslate">
$ curl -k -u 'key:secret_key' -F width=60 -F height=76 -F &quot;raw_img_data=@albert_einstein.jpg&quot; https://api.picloud.com/r/2/thumbnail/
{'jid': 809737}
</pre>
<p>
The content of the result is the binary data representing the thumbnail image. Unlike JSON encoded results, there is no enclosing dictionary. Thus, all you have to do to see the image is pipe the result of the job into a file.
</p>
<pre class="brush: bash; title: ; notranslate">
$ curl -k -u 'key:secret_key' https://api.picloud.com/job/809737/result/ &gt; albert_einstein.thumb.jpg
</pre>
<p>
Open the thumbnail in your favorite image program!
</p>
<p><a href="http://media.picloud.com/img/blog/albert_einstein.thumb.jpg"><img src="http://media.picloud.com/img/blog/albert_einstein.thumb.jpg" alt="Albert Einstein Thumbnail" title="albert_einstein.thumb" class="alignnone size-full wp-image-460" /></a></p>
<h3>Conclusion: Take a rest, and then give it a spin!</h3>
<p>
We&#8217;re particularly excited by function publishing because it bridges PiCloud with the world outside of Python, and in doing so, brings all the computing benefits of our standard service. You can publish functions without any care for the amount of hardware running underneath. As your functions get called more frequently, we automatically scale our servers to meet demand. You can also reserve real-time cores if they want to guarantee a certain number of cores at all times. Lastly, you can be confident that your computation is being run on a system built with performance, robustness, and redundancy at its core.
</p>
<p>
If this technology captivates you, <a href="http://www.twitter.com/picloud">follow us on Twitter</a>, or go above and beyond and <a href="http://www.picloud.com/jobs/">join our team</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.picloud.com/2011/09/14/introducing-function-publishing-via-rest/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Introducing High-Memory Cores</title>
		<link>http://blog.picloud.com/2011/09/02/introducing-high-memory-cores/</link>
		<comments>http://blog.picloud.com/2011/09/02/introducing-high-memory-cores/#comments</comments>
		<pubDate>Sat, 03 Sep 2011 01:06:29 +0000</pubDate>
		<dc:creator>Ken Elkabany</dc:creator>
				<category><![CDATA[What's New]]></category>
		<category><![CDATA[core types]]></category>
		<category><![CDATA[high memory]]></category>
		<category><![CDATA[new features]]></category>

		<guid isPermaLink="false">http://blog.picloud.com/?p=357</guid>
		<description><![CDATA[
When we first launched PiCloud, we provided two options for processing power: standard and high cpu. Standard provided 1 compute unit with 300MB of RAM, while high cpu provided 2.5 compute units and 800MB of RAM. But what about tasks that require GBs of memory and an even faster CPU? Enter core types.


You can now [...]]]></description>
			<content:encoded><![CDATA[<p>
When we first launched PiCloud, we provided two options for processing power: standard and high cpu. Standard provided 1 compute unit with 300MB of RAM, while high cpu provided 2.5 compute units and 800MB of RAM. But what about tasks that require GBs of memory and an even faster CPU? Enter <b>core types</b>.
</p>
<p>
You can now select the type of core you want your job to be run on.
</p>
<ul style="margin-left: 1.5em;">
<li><b>c1</b>: Replaces our standard option as default.</li>
<li><b>c2</b>: Replaces the high cpu option.</li>
<li><b>m1</b>: Our new high-memory core with 3.25 compute units and 8GB of memory.</li>
</ul>
<p>
For more details, see our updated <a href="http://www.picloud.com/pricing/">pricing page</a>.
</p>
<h3>How to Use It</h3>
<p>
We&#8217;re committed to maintaining an extraordinarily simple API for you. With our old library you would do the following:
</p>
<pre class="brush: python; title: ; notranslate">
cloud.call(func, _high_cpu=True)
</pre>
<p>
With our new library (available <a href="https://www.picloud.com/accounts/start/">here</a>), you do this instead:
</p>
<pre class="brush: python; title: ; notranslate">
cloud.call(func, _type='c2')
</pre>
<h3>Additional Information</h3>
<p>
In conjunction with these changes, real-time cores are now reserved by type. You can see the new interface in your <a href="https://www.picloud.com/accounts/realtime/">control panel</a>.
</p>
<p>
We&#8217;ll be releasing more cores as we hear demand for them. Our next core, <b>s1</b>, which is beta, is a solution for users on our platform who scrape the web. When running jobs in parallel on s1 cores, each job will have its own IP, minimizing throttling effects. However, consecutive jobs may share the same IP address.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.picloud.com/2011/09/02/introducing-high-memory-cores/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

