Tutorials/CloudSim/1.2/setup

CloudSim setup and installation ==

This tutorial describes how to:


 * Install Cloudsim web app

Introduction ==

CloudSim is a web app that runs in a virtual machine on the AWS cloud. It allows its users to launch, terminate and monitor virtual machines in the AWS cloud running ROS, Gazebo and the DRC simulator. Different configurations can be launched, depending on the computing power, simulation and robotics software requirements, and available machines on the cloud. Each CloudSim configuration maps to a constellation that can contain multiple virtual machines running together.

Prerequisites == CloudSim only accepts users with valid gmail (or Google Apps) accounts. So all users (including users with administrative priviledges) must have a valid google account to use the system. You can get Google accounts for free.

Installation ==

This section will show you how to install CloudSim on your Ubuntu machine and run a script that creates a CloudSim web app on AWS. This web app is deployed on a webserver running on a micro instance (using your AWS account credentials).

CloudSim is written in python and uses the boto library to access AWS. Follow these instructions to install the minimum packages required to launch a CloudSim instance. For CloudSim development and installation on your local machine, you will need more packages ( like the apache web server, the OpenID authentication plugin, the redis no key/value store and the redis python bindings). Please refer to the user guide for more information.

If you have already installed Gazebo and DRCSim, you may skip to step 4.

1. Configure your Ubuntu repositories to allow "restricted," "universe," and "multiverse." You can follow the Ubuntu guide for instructions on doing this.

1. Setup your computer to accept software from packages.osrfoundation.org.

sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu precise main" > /etc/apt/sources.list.d/ros-latest.list' sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu precise main" > /etc/apt/sources.list.d/gazebo-latest.list'

1. Retrieve and install the keys for the ROS and DRC repositories.

wget http://packages.ros.org/ros.key -O - | sudo apt-key add - wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -

1. Update apt-get and install CloudSim. This install is sufficient to complete all tutorials but the Development tutorial.

sudo apt-get update sudo apt-get install -y python openssh-client unzip zip redis-server python-pip python-redis sudo pip install --upgrade boto

1. Download the latest version of CloudSim, called `cloudsim-X.Y.Z.tar.bz2`, from http://gazebosim.org/assets/distributions/. For this tutorial, we'll assume that you're using version 1.2.0:

# Change the version number as appropriate! wget http://gazebosim.org/assets/distributions/cloudsim-1.2.0.tar.bz2

1. Unpack the files to your local drive

# Change the version number as appropriate! tar xf cloudsim-1.2.0.tar.bz2

This unpacks the CloudSim source code on your local machine. This code allows you to run the web app on your local machine, or create an AWS machine with the app inside. For the purpose of this tutorial, we will launch the CloudSim web app into an AWS instance.

How to start CloudSim ==

Once the files are unpacked, run the script `create_cloudsim.py`, which has has the following usage:

usage: create_cloudsim.py username key secret_key ec2_region


 * The username is the Google email of the first admin user of the CloudSim instance. It can be any email, as long as it is a Google email (it does not have to be tied to the AWS account).
 * The key and secret key are the credentials for the AWS account under which the CloudSim machine as well as the simulation machines will be run.
 * The ec2_region is `us-east-1a` or `us-east-1b` or `us-east-1c` or `us-east-1d`. The correct value depends on your user account number and it is not possible yet to determine the valid one without trial and error. Once you know the correct value for your account, you can use it. Any value works for starting a constellation with a single machine. See  CloudSim administration for details.

Here's an example:

./cloudsim-1.2.0/bin/create_cloudsim.py somebody@gmail.com FAKEOFAKEOFAKEOFAKEO FAkexNOItfake6Hxs1fake5JKP+B9fakeUfake7 us-east-1b

Once the script starts, you should see a list of events printed to the console, e.g.:

cloudsim log> ssh -o StrictHostKeyChecking=no -o ConnectTimeout=1 -i /tmp/tmpuTVY_vcloudsim/simulator_CloudSim_5456af04/key-sim-CloudSim_5456af04.pem ubuntu@174.129.104.177 ls launch_stdout_stderr.log cloudsim log>   RETRY ls launch_stdout_stderr.log (83/1000) cloudsim log> ssh -o StrictHostKeyChecking=no -o ConnectTimeout=1 -i /tmp/tmpuTVY_vcloudsim/simulator_CloudSim_5456af04/key-sim-CloudSim_5456af04.pem ubuntu@174.129.104.177 ls launch_stdout_stderr.log cloudsim log>   RETRY ls launch_stdout_stderr.log (84/1000) cloudsim log> ssh -o StrictHostKeyChecking=no -o ConnectTimeout=1 -i /tmp/tmpuTVY_vcloudsim/simulator_CloudSim_5456af04/key-sim-CloudSim_5456af04.pem ubuntu@174.129.104.177 ls launch_stdout_stderr.log cloudsim log>   RETRY ls launch_stdout_stderr.log (85/1000) cloudsim log> ssh -o StrictHostKeyChecking=no -o ConnectTimeout=1 -i /tmp/tmpuTVY_vcloudsim/simulator_CloudSim_5456af04/key-sim-CloudSim_5456af04.pem ubuntu@174.129.104.177 ls launch_stdout_stderr.log cloudsim log>   RETRY ls launch_stdout_stderr.log (86/1000) cloudsim log> ssh -o StrictHostKeyChecking=no -o ConnectTimeout=1 -i /tmp/tmpuTVY_vcloudsim/simulator_CloudSim_5456af04/key-sim-CloudSim_5456af04.pem ubuntu@174.129.104.177 ls launch_stdout_stderr.log cloudsim log>   RETRY ls launch_stdout_stderr.log (87/1000) cloudsim log> ssh -o StrictHostKeyChecking=no -o ConnectTimeout=1 -i /tmp/tmpuTVY_vcloudsim/simulator_CloudSim_5456af04/key-sim-CloudSim_5456af04.pem ubuntu@174.129.104.177 ls launch_stdout_stderr.log cloudsim log>   FOUND ls launch_stdout_stderr.log (88/1000) cloudsim log>   RETRY ls launch_stdout_stderr.log (88/1000) cloudsim log> ssh -o StrictHostKeyChecking=no -o ConnectTimeout=1 -i /tmp/tmpuTVY_vcloudsim/simulator_CloudSim_5456af04/key-sim-CloudSim_5456af04.pem ubuntu@174.129.104.177 cat < cloudsim/find_file_sim.bash

The whole process lasts approximately 7 minutes. Once its finished, the url of the new CloudSim machine web app is written to the terminal, e.g.:

cloudsim log> setup complete cloudsim log> ssh -i key-sim-CloudSim_5456af04.pem ubuntu 174.129.104.177

cloudsim log> http://174.129.104.177 cloudsim log> provisionning done

In this example, the URL is http://54.234.106.123. Use your browser (preferably Chrome) to visit the URL and login with the Google user account that you provided on the command line to the script. You'll see a landing page:



CloudSim is installed successfully.

How to stop CloudSim ===

When you're done using CloudSim you can terminate it via your AWS Console, as you would terminate any other EC2 machine. Note that CloudSim runs on a `micro` instance, which is free for most AWS users. So it's probably OK to leave your CloudSim instance running even when you're not using it or if you want to continue with the next CloudSim tutorials.

Warning: Before terminating a CloudSim instance, be sure to use the CloudSim interface to terminate all machines that were launched via CloudSim. Otherwise, you could lose track of launched machines, leading to unexpected EC2 usage charges.


 * 1) Next ##

Next: Cloudsim administration: How to manage users, and set new AWS credentials