Home | About Gush | Using Gush | Gush Examples | Gush Tutorial at GEC 11 | GENI Summer Camp
Using the GeniWrapper in Gush
The GeniWrapper interface is now supported in Gush. In addition to communicating with the PLCDB using the traditional PLCAPI, Gush now also uses the GeniWrapper API.
Assumptions on System Configuration
For this example, the user name is jeannie [at] cs [dot] williams [dot] edu. Its Human-Readable Name (HRN) is plc.williams.jeannie. The slice I'm working with is williams_gush. I'm running Python 2.6 on Ubuntu 9.04. The latest version of Gush has been checked out and it was correctly configured as described in UsingGush.
Here are all the python packages you need to install:
$ sudo apt-get install python-m2crypto
Note that this is not a comprehensive list. If, for instance, the Python interpreter complains that some package XYZ is not found, run sudo apt-get install python-XYZ to install the required packages. Usually this solves the missing-package problem.
Setting up GeniWrapper for Gush
First, create your private key for planetlab. In your ~/.ssh/ directory, run ssh-keygen -t rsa to generate your keypairs, id_rsa (your private key) and id_rsa.pub (your public key). It doesn’t matter whether a pass phrase is specified. Upload your public key to the PlanetLab website.
Copy your private key to the directory gush/helper-scripts/sfa/.sfi/ and rename it as jeannie.pkey. Edit the configuration file sfi_config in this directory. My sfi_config file looks like this:
SFI_AUTH='plc.williams' SFI_USER='plc.williams.jeannie' SFI_REGISTRY='http://www.planet-lab.org:12345/' SFI_SM='http://www.planet-lab.org:12347/'
It is possible that you may have multiple configuration files for various types of resources. You can name them differently. Note that all of them need to be in the directory gush/helper-scripts/sfa/.sfi/.
In my case, for instance, I have williams_sfi_config which looks like this:
SFI_AUTH='plc.williams' SFI_USER='plc.williams.jeannie' SFI_REGISTRY='http://www.planet-lab.org:12345/' SFI_SM='http://www.planet-lab.org:12347/'
and ksu_sfi_config (for GpENI resources) that reads:
SFI_AUTH='plc.ksu' SFI_USER='plc.ksu.jeannie' SFI_REGISTRY='http://geni-myplc.ksu.gpeni.net:12345/' SFI_SM='http://geni-myplc.ksu.gpeni.net:12346/'
Then, edit your gush/directory.xml file to specify resources for the GENI interface. If a resource uses the old PLCAPI, indicate the type as "planetlab"; to use the new GENI interface, specify "geni" as the type. Also, specify the name of the configuration file for a particular GENI resource. An example would be:
<?xml version="1.0" encoding="UTF-8"?>
<gush>
<resource_manager type="planetlab">
<user>yh1@williams.edu</user>
<allsites>allsites.xml</allsites>
<port_map slice="williams_gush" port="15000"/>
</resource_manager>
<resource_manager type="geni">
<user>plc.williams.jeannie</user>
<config_file>williams_sfi_config</config_file>
<port_map slice="plc.williams.gush" port="15000"/>
</resource_manager>
<resource_manager type="geni">
<user>plc.ksu.jeannie</user>
<config_file>ksu_sfi_config</config_file>
<port_map slice="plc.ksu.gush" port="15000"/>
</resource_manager>
</gush>
To test whether you have configured correct, run the following command in the gush/ directory.
$ helper-scripts/handle-geniplcdb.py --noemail listall
The --noemail switch is included to speed up the process, so that the Python script will not translate the HRNs of each user into the corresponding email addresses. Try the --debug switch if you wish to see debug statements. Messy print-outs expected.
If all goes well, you should see something that looks like the following. The user names are blank because of the --noemail switch. This does not affect the performance of Gush.
$ helper-scripts/handle-geniplcdb.py --noemail listall <?xml version="1.0"?> <gush> <slice name="williams_gush"> <expires>1249326806</expires> <user name=""/> <user name=""/> <user name=""/> <node name="planetlab2.ucsd.edu"/> <node name="planetlab3.williams.edu"/> <node name="planetlab4.williams.edu"/> <node name="planetlab2.williams.edu"/> <node name="planetlab1.ucsd.edu"/> <node name="planetlab5.williams.edu"/> <node name="planetlab3.ucsd.edu"/> <node name="planetlab1.williams.edu"/> </slice> </gush> $
Running Gush with GeniWrapper
By default, Gush uses the PLCAPI to contact the PLCDB and find resources assigned to your slice. This is achieved through the helper-scripts/handle-plcdb.pl script. To replace it with the new GeniWrapper, run Gush with the following command:
$ ./gush -P 15890
Currently, it takes some patience for Gush to learn about your slices. When it's done, you should see this:
$ ./gush -P 15890 Gush has learned about the slice williams_gush. gush>
At this point, Gush is no different from that which uses the old PLCAPI. You can run commands and carry out experiments as you normally would. If you run info nodes, you'll find the correct list of nodes.
gush> info nodes There are 8 known nodes: [ P ] williams_gush@planetlab1.ucsd.edu:15000(pref=0) (Disconnected.) [ P ] williams_gush@planetlab2.ucsd.edu:15000(pref=0) (Disconnected.) [ P ] williams_gush@planetlab3.ucsd.edu:15000(pref=0) (Disconnected.) [ P ] williams_gush@planetlab1.williams.edu:15000(pref=0) (Disconnected.) [ P ] williams_gush@planetlab2.williams.edu:15000(pref=0) (Disconnected.) [ P ] williams_gush@planetlab3.williams.edu:15000(pref=0) (Disconnected.) [ P ] williams_gush@planetlab4.williams.edu:15000(pref=0) (Disconnected.) [ P ] williams_gush@planetlab5.williams.edu:15000(pref=0) (Disconnected.) gush>
