From one cloud to another (or is it the same one?)

Published: 2013-07-25
As previously described, MongoLab offers multiple cloud options for your instances: AWS, Azure, etc. What about my now legendary Python program? ;) Shouldn't I also run it in the cloud? Yeah, thought so.

I've been using AWS for a while, mostly to store a ton of personal junk in S3 and Glacier, so the obvious choice is to launch an EC2 instance. I'm quite fond of micro-sized instances based on ubuntu/images/ebs/ubuntu-precise-12.04-amd64-server-20130411.1 (ami-ce7b6fba): 1 core, 600 MB of RAM, 8 GB of disk... and free :) Perfect for experimentation!

If you need to setup your own account, here's where to start. It's a straightforward process, no need to cover it in detail. Just some quick advice:


Now, let's connect to the instance with 'ssh':
$ ssh -i keypair.pem ubuntu@ec2-54-217-8-54.eu-west-1.compute.amazonaws.com
ubuntu@ip-10-48-247-163:~$

Congratulations, you're on AWS. Now, let's add some more software to this instance:
ubuntu@ip-10-48-247-163:~$ sudo apt-get update
ubuntu@ip-10-48-247-163:~$ sudo apt-get install mongodb-clients

Can't wait to connect to your db? All right, let's give it a try with the 'mongo' client:
ubuntu@ip-10-48-247-163:~$ mongo -u USERNAME -p PASSWORD ds051067.mongolab.com:51067/mongolab-test
MongoDB shell version: 2.0.4
connecting to: ds051067.mongolab.com:51067/mongolab-test
> show collections
collection1
objectlabs-system
objectlabs-system.admin.collections
system.indexes
system.users 

This MongoDB instance is hosted by MongoLab in AWS, so we didn't travel too far. A nice mix of PaaS and IaaS, all based on the same infrastructure :)

Now let's add our Python tools:
ubuntu@ip-10-48-247-163:~$ sudo apt-get install build-essential python-dev
ubuntu@ip-10-48-247-163:~$ sudo apt-get install python-pip
ubuntu@ip-10-48-247-163:~$ sudo pip install pymongo

Let's copy our Python program to our EC2 instance:
$ scp -i keypair.pem mongo.py ubuntu@ec2-54-217-8-54.eu-west-1.compute.amazonaws.com:~
mongo.py                                                                                

And now:
ubuntu@ip-10-48-247-163:~$ python mongo.py 
{u'x': 1.0, u'_id': ObjectId('51e3ce08915082db3df32bf0')}
{u'x': 2.0, u'_id': ObjectId('51e3ce08915082db3df32bf1')}
{u'x': 3.0, u'_id': ObjectId('51e3ce08915082db3df32bf2')}
output removed from brevity
{u'x': 25.0, u'_id': ObjectId('51e3ce08915082db3df32c08')}

What's the point of all this? Simply to quickly demonstrate:

  1. the insane amount of software technology available to anyone willing to read a few books or wikis
  2. how easy it is to get started and build fun stuff. You need nothing else on your own machine than 'ssh'!
  3. it's all free (or very very unexpensive)
None of this was possible 10 years ago. Back in the day.... well, who cares. You kids sure have it too easy, so stop wasting your time on Facebook or on reality TV (absolute scum, will it ever stop?), learn some proper engineering skills, get smart and start solving some problems, ok? There ain't no shortage of them!

Old man over and out.

About the Author

Julien Simon is the Chief Evangelist at Arcee AI , specializing in Small Language Models and enterprise AI solutions. Recognized as the #1 AI Evangelist globally by AI Magazine in 2021, he brings over 30 years of technology leadership experience to his role.

With 650+ speaking engagements worldwide and 350+ technical blog posts, Julien is a leading voice in practical AI implementation, cost-effective AI solutions, and the democratization of artificial intelligence. His expertise spans open-source AI, Small Language Models, enterprise AI strategy, and edge computing optimization.

Previously serving as Principal Evangelist at Amazon Web Services and Chief Evangelist at Hugging Face, Julien has helped thousands of organizations implement AI solutions that deliver real business value. He is the author of "Learn Amazon SageMaker," the first book ever published on AWS's flagship machine learning service.

Julien's mission is to make AI accessible, understandable, and controllable for enterprises through transparent, open-weights models that organizations can deploy, customize, and trust.