wiki:DICLOUD/GEC12tutorial

Version 4 (modified by David Irwin, 8 years ago) (diff)

--

DiCloud Tutorial at GEC12

This page summarizes the DiCloud tutorial that was presented at GEC 12. Slides can be found here.

Tutorial sections:

  • Pre-requisites
  • Install dependent software packages
  • Setup DiCloud's MySQL database
  • Create Amazon user credentials
  • Register a user on Amazon EC2
  • Setup environment variables
  • Running the DiCloud server
  • Using the DiCloud console
  • Using the DiCloud web portal
  • Running a Gush experiment using DiCloud and Orca

Pre-requisites

  1. Install VirtualBox: Download the latest VirtualBox software. If you already have VirtualBox installed on your machine, make sure it is version 4.08 or above.

Note to Ubuntu users: The version of VirtualBox distributed with Ubuntu 10.04 is old. Download the latest version from here.

  1. Download VirtualBox VM image: Download the VirtualBox VM image (gec12-tutorials-final.ova) needed for the DiCloud tutorial from here. A README with a copy of these instructions is also available at the same location.
  1. Install the gec12-tutorials-final.ova image: Start up VirtualBox, select File->Import Appliance..., and follow the instructions. Accept the default VM settings during the import. To run the virtual machine, go to the Oracle VM VirtualBox Manager window, select the virtual machine gec12-tutorial-final and click the green arrow labeled Start at the top of this window.

If the install was successful, you should see the logon screen for the Ubuntu OS. Passwords for logging into the VM will be handed out at the tutorial.

  1. Turn off the VM: Turn off the virtual machine by clicking on the power button icon on the bottom right of the screen.
  1. Note that this release of tutorial software is intended for use at the GEC12 tutorial only. In particular, these directions are for Ubuntu 10.04.3 LTS (Lucid Lynx). To find out your version of Ubuntu, open a terminal and run:
$ cat /etc/issue
Ubuntu 10.04.3 LTS \n \l

While the directions may work for other distributions, your mileage may vary.

Install dependent software packages

To install dependent software you need root access. The directions assume the user is able to use sudo to run commands as root.

$ sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
$ sudo apt-get update
$ sudo apt-get install sun-java6-jdk
$ sudo apt-get install maven2
$ sudo apt-get install apache2
$ sudo apt-get install libapache2-mod-php5
$ sudo apt-get install php5-mysql
$ sudo a2enmod php5
$ sudo apt-get install mysql-server

MySQL server will ask you to set a root password. Remember the password.

Setup DiCloud's !MySQL Server

First, log into !MySQL and create the dicloud database by running the following commands.

$ mysql -u root -p
$ mysql> create database dicloud;
$ mysql> quit;

Next load the DiCloud schema, create an admin user, and give the user database rights

$ cd ~/Tutorials/DiCloud
$ mysql -u root -p < dicloud.schema
$ mysql -u root -p
$ mysql> INSERT INTO users(id, username, password) VALUES (1, 'admin', SHA1('geni'));
$ mysql> INSERT INTO admin_rights VALUES (1, true, true, true, true);
$ mysql> create user vise;
$ mysql> SET PASSWORD FOR 'vise' = PASSWORD('');
$ mysql> GRANT ALL ON dicloud.* TO 'vise'@'localhost';

Create Amazon user credentials

Note that tutorial participants should not perform this step.

Amazon EC2 requires that each user create and upload an X.509 certificate to Amazon, and use the corresponding private key to access the web services functions. We create the certificate and private key below. We copy versions of these certificates and change the ownership to www-data to allow the DiCloud web portal to read them.

$ cd ~/Tutorials/DiCloud/ec2/keys
$ openssl genrsa 1024 > ./geni_pk.pem
$ openssl req -new -x509 -nodes -sha1 -key ./geni_pk.pem > ./geni_cert.pem
$ ssh-keygen geni-keypair.pem

Register new user on Amazon EC2

Note that tutorial participants will be able to use a DiCloud account, and do not need to create there own account. Tutorial participants will also use a pre-existing DiCloud user, and do not need to perform the steps listed in the rest of this section.

Create an account with Amazon web services by going here and clicking on "Create an AWS Account" in the upper-right portion of the page. Amazon requires that account link to a valid credit card for payment. Once you've created an account go back to here and click on "Sign in to the AWS Management Console" in the upper-right portion of the page. Once logged in, click on the AWS IAM tab (second from the right). Click on "Users" on the left panel, and then click "Create New Users". Create a user named "geni" (or any other name you prefer). Next click on the geni user, and go to the "Security Credentials" tab at the bottom of the page. Here you need to generate Access Keys and download the credentials.csv file that has the Access Key and the Secret Access Key. Also, upload the signing certificate we created at ~/Tutorials/DiCloud/ec2/keys/geni_cert.pem. Finally, click on the "Amazon EC2" tab (third from the left). Then click on the "Key Pairs" link at the bottom of the left panel. Now click "Import Key Pair". Give the new keypair the name "geni-keypair" (or any other name you prefer) and copy the contents of ~/Tutorials/DiCloud/ec2/keys/geni-keypair.pem in the correct place. Copy the credentials file credentials.csv to ~/Tutorials/DiCloud/ec2/keys/ and create the file ~/Tutorials/DiCloud/ec2/keys/geni_aws_credentials.txt, which should look as follows:

geni@geni-tutorial:~/Tutorials/DiCloud/ec2/keys$ cat geni_aws_credentials.txt AWSAccessKeyId=<Your Access Key ID here> AWSSecretKey=<Your Secret Key Here>

Configuring Amazon for Tutorial Participants

Tutorial participants should download their certificate, private key, key pair, credential.csv, and geni_aws_credentials.txt files by performing the following commands.

$ cd ~/Tutorials/DiCloud/ec2/keys
$ wget http://geni.cs.umass.edu/geni_cert.pem
$ wget http://geni.cs.umass.edu/geni_pk.pem
$ wget http://geni.cs.umass.edu/geni-keypair.pem
$ wget http://geni.cs.umass.edu/geni-keypair.pub
$ wget http://geni.cs.umass.edu/geni_aws_credentials.txt
$ wget http://geni.cs.umass.edu/credentials.csv

Enabling Access to Keys via DiCloud's Web Portal

We also create copies of the certificate and private key and change their ownership to www-data so the web portal can access them.

$ cp ./geni_pk.pem ./geni_pk_web.pem
$ sudo chown www-data geni_pk_web.pem
$ sudo chgrp www-data geni_pk_web.pem
$ cp ./geni_cert.pem ./geni_cert_web.pem
$ sudo chown www-data geni_cert_web.pem
$ sudo chgrp www-data geni_cert_web.pem

Attachments (3)