Note
This part of the documentation is customized for FutureGrid
Currently, we require users that would like to use rain to apply for authorization to do so. This is due to the fact that we have set aside a limited number of resources for the image generation and provisioning. In future we intend to make this feature available without special authorization. Firts, of all you will need to be in a valid project. Please see our documentation on the FutureGrid Web site to
To opbtain authorization please go to
And fill out the form. Find either the RAIN category and click it on, or provide in the “Other” field “RAIN”.
In the Description you fill simply in that you would like to get access to rain. Requests will typically be granted within two upcoming buisiness days (note: anything on the weekend or outside 9am-5pm is not a buisiness day).
Note
Your account will be reviewed and if everything is ok, it should be approved quickly. Make sure you have filled out accurately your contact information. We will not grant authorization if that information is incorrect, or incomplete.
Our software provides a very convenient shell environment. In addition, we also provide a less convenient command line interface. Users need access to the machine where the client is installed. Currently, it is installed on FutureGrid in the machine called (india.futuregrid.org), a 128 node cluster. Since our software is going to interact with different cloud infrastructures, users need to have the appropriated credentials for each of them. Hence you need to have the following acomplished before you can start:
Once users have the appropriate accounts, they can login on India and use the module functionality to load the environment variables:
$ ssh <username>@india.futuregrid.org
$ module load futuregrid
Note
If you got an error such as:
module load futuregrid
futuregrid version 1.1 loaded
euca2ools version 2.1.2 loaded
python_w-cmd2/2.7(21):ERROR:150: Module 'python_w-cmd2/2.7' conflicts with the currently loaded module(s) 'python/2.7'
python_w-cmd2/2.7(21):ERROR:102: Tcl command execution failed: conflict python
moab version 5.4.0 loaded
torque/2.5.5 version 2.5.5 loaded
You have to unload the python module first due to a version conflict with:
module unload python
Note
At this point, users have to explicitly request access to the Image Management and rain tools by sending a ticket to https://portal.futuregrid.org/help.
To ease the use of the FG tools, we have created a shell that provides a common interface for all these tools. So, users just need to remember how to execute the shell. Once users login into the shell, a number of features will be exposed to them. These features include help, command’s auto-completion, and list of available commands organized by tool. Moreover, users only need to type the password when they login into the shell.
Users can log into the shell by executing:
$ fg-shell -u <username>
Note
Users need to use their FutureGrid portal password.
More information about using the shell can be found in the FutureGrid Shell Manual.
After you have sucessfully entered your password, you will be authorized to use the convenient fg-shell commands. You will see an image such as:
Changing to rain context
-------------------------
Init Rain
Init Repo
Init Image
______ __ ______ _ __
/ ____/_ __/ /___ __________ / ____/____(_)___/ /
/ /_ / / / / __/ / / / ___/ _ \/ / __/ ___/ / __ /
/ __/ / /_/ / /_/ /_/ / / / __/ /_/ / / / / /_/ /
/_/ \__,_/\__/\__,_/_/ \___/\____/_/ /_/\__,_/
Welcome to the FutureGrid Shell
-------------------------------
fg-rain>
By default we will start the rain module for you. This will load several useful commands. To see the commands you can enter the word help in the shell:
fg-rain>help
A complete manual can be found in https://portal.futuregrid.org/man/fg-shell
General documented commands (type help <topic>):
================================================
contexts history load py save setpasswd use
exec historysession manual quit script shortcuts
help li pause run set show
Specific documented commands in the rain context (type help <topic>):
===============================================================================
cloudinstanceslist hpcjobslist launch
cloudinstancesterminate hpcjobsterminate launchhadoop
Specific documented commands in the repo context (type help <topic>):
===============================================================================
get repohistimg histuser list modify put reporemove setpermission user
Specific documented commands in the image context (type help <topic>):
================================================================================
cloudlist deregister hpclist listsites
cloudlistkernels generate hpclistkernels register
fg-rain>
The Image Repository is a service to query, store, and update images through a unique and common interface. Next, we show some examples of the Image Repository usage (fg-repo command). More details can be found in the Image Repository Manual.
Additionally, the Image Repository manages the user database for all the image management components. This database is used to authorize users, to control the user’s quotas and to record usage information. Therefore, this database complements the LDAP server which is mainly focused on the user authentication.
When using fg-shell, users need to load the Image Repository context by executing use repo inside the shell. The Image Repository environment is also included in the Image Management (image) and Rain (rain) contexts. Once there is an active context, the help command will show only the available commands for such context. Available contexts can be listed using the contexts command. More information about the shell can be found in the FutureGrid Shell Manual.
Here we show how to upload an image with the shell:
put /home/javi/image.iso ImgType=Openstack&os=Ubuntu&arch=x86_64&description=this is a test description
$ fg-repo -p /home/javi/image.iso "vmtype=kvm&os=Centos5&arch=i386&description=this is a test description&tag=tsttag1, tsttag2&permission=private" -u $USER
$ fg-repo -p /home/javi/image.iso "ImgType=Openstack&os=Ubuntu&arch=x86_64&description=this is a test description" -u $USER
Note
The & character is used to separate different metadata fields.
Here we show how to get and download an image with the shell:
get 964160263274803087640112
$ fg-repo -g 964160263274803087640112 -u $USER
To modify the meta data of an image you can use the following shell command:
modify 964160263274803087640112 ImgType=Opennebula&os=Ubuntu10
$ fg-repo -m 964160263274803087640112 "ImgType=Opennebula&os=Ubuntu10" -u $USER
To list the images in the repository, please use the list command. You can also add simple search parameters to it:
list * where vmType=kvm
$ fg-repo -q "* where vmType=kvm" -u $USER
Administrators have the ability to add new users to the repository:
user -a juan
user -m juan status active
$ fg-repo --useradd juan -u $USER
$ fg-repo --usersetstatus juan active
This component creates images, according to user requirements, that can be registered in FutureGrid. Since FG is a testbed that supports different type of infrastructures like HPC or IaaS frameworks, the images created by this tool are not aimed at any specific environment. Thus, it is at registration time when the images are customized to be successfully integrated into the desired infrastructure.
Next, we provide some examples of the Image Generation usage (fg-generate command). More details can be found in the Image Generation Manual.
When using fg-shell, users need to load the Image Management context by executing use image inside the shell. The Image Management environment is also included in the Rain (rain) contexts. Once there is an active context, the help command will show only the available commands for such context. Available contexts can be listed using the contexts command. More information about the shell can be found in the FutureGrid Shell Manual.
An image can be gerenated quite simply. YOu can specifiey default pacakges from our repository
generate -o centos -v 5 -a x86_64 -s wget,emacs,python26
$ fg-generate -o centos -v 5 -a x86_64 -s wget,emacs,python26 -u $USER
Just as you can generate images for centos, you can also generate images for ubuntu:
generate -o ubuntu -v 10.10 -a x86_64 -s wget,emacs,python26
$ fg-generate -o ubuntu -v 10.10 -a x86_64 -s wget,openmpi-bin -u $USER
This tool is responsible for customizing images for specific infrastructures and registering them in such infrastructures. Currently, we fully support HPC (bare-metal machines), Eucalyptus, OpenStack, and Nimbus infrastructures. OpenNebula is also implemented but we do not have this infrastructure in production yet.
Next, we provide some examples of the image registration usage (fg-register command). A detailed manual can be found in the Image Registration Manual
When using fg-shell, users need to load the Image Management context by executing use image inside the shell. The Image Management environment also loads the Image Repository context. The Image Management is also included in the Rain (rain) contexts. Once there is an active context, the help command will show only the available commands for such context. Available contexts can be listed using the contexts command. More information about the shell can be found in the FutureGrid Shell Manual.
It is useful which sites are registered with RAIN. we provide a simple command called listsites that you can invoke:
listsites
$fg-register --listsites -u $USER
The output would look something like this:
Supported Sites Information
===========================
Cloud Information
-----------------
SiteName: sierra
Description: In this site we support Eucalyptus 3.
Infrastructures supported: ['Eucalyptus']
SiteName: hotel
Description: In this site we support Nimbus 2.9.
Infrastructures supported: ['Nimbus']
SiteName: india
Description: In this site we support Eucalyptus 2, OpenStack Folsom.
Infrastructures supported: ['Eucalyptus', 'OpenStack']
HPC Information (baremetal)
---------------------------
SiteName: india
RegisterXcat Service Status: Active
RegisterMoab Service Status: Active
Note
To register an image on a host simply add the abbreviation for the host. Here india:
register -r 964160263274803087640112 -x india
$ fg-register -r 964160263274803087640112 -x india -u $USER
If you followed the FG Openstack tutorial, your novarc will probably be in ~/.futuregrid/openstack/novarc. Use it for this tutorial
To register an image not just with the host, but a specific cloud infrastructure you can use:
register -r 964160263274803087640112 -s india -v ~/novarc
$ fg-register -r 964160263274803087640112 -s india -v ~/novarc -u $USER
~/eucarc`` is not needed because we are not going to register the image in the infrastructure):
register -r 964160263274803087640112 -e india -g
$ fg-register -r 964160263274803087640112 -e india -g -u $USER
Here is an example on how to register an image with hotel:
register -r 964160263274803087640112 -n hotel -v ~/hotel.conf
$ fg-register -r 964160263274803087640112 -n hotel -v ~/hotel.conf -u $USER
The available kernels for a host can be listed as follows:
hpclistkernels india
$ fg-register --listkernels -x india -u $USER
For openstack we sue the -s option:
cloudlistkernels -s india
$ fg-register --listkernels -s india -u $USER
To deregister, you can use:
deregister --deregister ami-00000126 -s india -v ~/novarc
$ fg-register --deregister ami-00000126 -s india -v ~/novarc -u $USER
User role must be admin. To deregister an image from HPC you can use:
deregister --deregister centosjdiaz1610805121 -x india
$ fg-register --deregister centosjdiaz1610805121 -x india -u $USER
This component allow users to dynamically register FutureGrid software environments as requirement of a job submission. This component will make use of the previous registration tool. Currently we only support HPC job submissions.
Next, we provide some examples of the Rain usage (fg-rain command). A detailed manual can be found in the Rain Manual.
When using fg-shell, users need to load the Image Management context by executing use rain inside the shell. The Rain environment also loads the Image Repository and Image Management contexts. Once there is an active context, the help command will show only the available commands for such context. Available contexts can be listed using the contexts command. More information about the shell can be found in the FutureGrid Shell Manual.
Note
Run a job in four nodes on India using an image stored in the Image Repository (This involves the registration of the image in the HPC infrastructure):
use rain #if your prompt is different to fg-rain>
fg-rain> launch -r 1231232141 -x india -m 4 -j myscript.sh
$ fg-rain -r 1231232141 -x india -m 4 -j myscript.sh -u $USER
Run a job in two nodes on India using an image already registered in the HPC Infrastructure India:
use rain #if your prompt is different to fg-rain>
fg-rain> launch -i centosjavi434512 -x india -m 2 -j myscript.sh
$ fg-rain -i centosjavi434512 -x india -m 2 -j myscript.sh -u $USER
Instantiate two VMs using an image already registered on OpenStack:
use rain #if your prompt is different to fg-rain>
fg-rain> launch -i ami-00000126 -s india -v ~/novarc -m 2 -I
$ fg-rain -i ami-00000126 -s india -v ~/novarc -m 2 -I -u $USER
Run an MPI job in six VM using an image already registered on Eucalyptus (the image has to have the mpich2 package installed)
Note
Please replace $USER with your own username
Content of mpichjob.sh:
#!/bin/bash #real home is /tmp/$USER/ #VM home is /N/u/$USER/ #$HOME/machines is a file with the VMs involved in this job cd /tmp/N/u/$USER/mpichexample/ mpiexec.hydra -machinefile /N/u/$USER/machines -np `wc -l /N/u/$USER/machines | cut -d" " -f1` /tmp/N/u/$USER/example/a.out > /tmp/N/u/$USER/output.mpichexample
Once you have that file, you can run it as follows:
use rain #if your prompt is different to fg-rain>
fg-rain> launch -i ami-00000126 -e india -v ~/eucarc -j mpichjob.sh -m 6
$ fg-rain -i ami-00000126 -e india -v ~/eucarc -j mpichjob.sh -m 6 -u $USER
Run Hadoop job on three VMs using an image already registered on OpenStack (the image has to have java package installed. Hadoop is automatically installed/configured by the tool.)
- For this example, the inputdir1 directory contains ebooks from the Project Gutenberg downloaded in Plain Text UTF-8 encoding:
Content of hadoopword.sh:
hadoop jar $HADOOP_CONF_DIR/../hadoop-examples*.jar wordcount inputdir1 outputdir
Once you have that file you can run it as follows:
use rain #if your prompt is different to fg-rain>
fg-rain> launchadoop -i ami-000001bf -s india -v ~/novarc -j ~/hadoopword.sh -m 3 --inputdir ~/inputdir1/ --outputdir ~/outputdir
$ fg-rain -i ami-000001bf -s india -v ~/novarc -j ~/hadoopword.sh -m 3 --inputdir ~/inputdir1/ --outputdir ~/outputdir -u $USER
Setup a Hadoop cluster in three VMs using an image already registered on OpenStack (the image has to have java package installed. Hadoop is automatically installed/configured by the tool.)
- For this example, the inputdir1 directory contains ebooks from the Project Gutenberg downloaded in Plain Text UTF-8 encoding:
Content of hadoopword.sh:
hadoop jar $HADOOP_CONF_DIR/../hadoop-examples*.jar wordcount inputdir1 outputdir
Now you can run it interactively as follows:
use rain #if your prompt is different to fg-rain>
fg-rain> launchadoop -i ami-000001bf -s india -v ~/novarc -I -m 3 --inputdir ~/inputdir1/ --outputdir ~/outputdir
$ fg-rain -i ami-000001bf -s india -v ~/novarc -I -m 3 --inputdir ~/inputdir1/ --outputdir ~/outputdir -u $USER
Run Hadoop job on three machines using an image already registered on the HPC infrastructure (the image has to have java package installed. Hadoop is automatically installed/configured by the tool.)
- For this example, the inputdir1 directory contains ebooks from the Project Gutenberg downloaded in Plain Text UTF-8 encoding:
Content of hadoopword.sh:
hadoop jar $HADOOP_CONF_DIR/../hadoop-examples*.jar wordcount inputdir1 outputdir
To run it on HPC you can do this:
use rain #if your prompt is different to fg-rain>
fg-rain> launchadoop -x india -j ~/hadoopword.sh -m 3 --inputdir ~/inputdir1/ --outputdir ~/outputdir --walltime 1
$ fg-rain -x india -j ~/hadoopword.sh -m 3 --inputdir ~/inputdir1/ --outputdir ~/outputdir --walltime 1 -u $USER