Changes between Initial Version and Version 1 of GENIExperimenter/Tutorials/GENIDesktop/05032016/GENIDesktop_CLI


Ignore:
Timestamp:
05/03/16 23:18:03 (5 years ago)
Author:
jp_reed@yahoo.com
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GENIExperimenter/Tutorials/GENIDesktop/05032016/GENIDesktop_CLI

    v1 v1  
     1[[PageOutline]]
     2
     3Navigation: [wiki:GENIExperimenter/Tutorials/GENIDesktop/GEC23#ExercisesTasks Back]
     4
     5= GENIDesktop Command Line Interface Tool =
     6
     7The GENIDesktop Command line Interface Tool is a simple client side tool written in python that interacts with the GENIDesktop server to provide a user with a subset of operations that can currently be done via the GUI interface. It provides a user with the flexibility to automate GENIDesktop related operations by combining multiple operation into a '''bash''' or '''.bat''' script and customize them based on their needs. Some of the operations currently supported by the GENIDesktop CLI Tool are:
     8
     9  * Check status of the slice/slivers
     10  * Download files from nodes in the Slice
     11  * Download passive monitoring data collected from nodes in a CSV, PNG and RRD formats.
     12  * Download a list of slices, list of nodes/links in a slice, or the entire slice topology in a JSON format.
     13  * Run commands on the node(s) in the slice. (Similar to the Run module in the GUI)
     14  * Upload file(s) to the node(s) in the slice. (Similar to the File upload module in the GUI)
     15  * Execute a CLI version of the Experiment Validation Tool available in the GUI.
     16
     17So to get started please follow the steps below.
     18
     19  1. [wiki:GENIExperimenter/Tutorials/GENIDesktop/GEC23/GENIDesktop_CLI#STEP1.DownloadandInstallandTestGENIDesktopCLITool Download and Install and Test GENIDesktop CLI Tool.]
     20  1. [wiki:GENIExperimenter/Tutorials/GENIDesktop/GEC23/GENIDesktop_CLI#STEP2.GenerateandDownloadGDCLIkey. Generate and Download GDCLI key.]
     21  1. [wiki:GENIExperimenter/Tutorials/GENIDesktop/GEC23/GENIDesktop_CLI#STEP3.EnabletheGDCLIusingtheGDCLIkey. Enable the GDCLI using the GDCLI key.]
     22  1. [wiki:GENIExperimenter/Tutorials/GENIDesktop/GEC23/GENIDesktop_CLI#STEP4.UsingGENIDesktopCLI Using GENIDesktop CLI.]
     23
     24 == STEP 1. Download and Install and Test GENIDesktop CLI Tool ==
     25To Download the GENIDesktop CLI Tool, please log in to the GENIDesktop if you are not already logged in. Click on the setting wheel like icon on the far top-right of the page to launch the settings menu. Click on '''GDCLI''' button.
     26
     27[[Image(wiki:GEMINI/Tutorial/Images:settings_wheel.png)]]
     28
     29This takes you to the [https://genidesktop.netlab.uky.edu/stable/gdcli_instructions/gdcli_quickstart.php quick start guide] for the CLI .
     30
     31[[Image(wiki:GEMINI/Tutorial/Images:qs.png,400px)]]
     32
     33
     34Step 1 of the [https://genidesktop.netlab.uky.edu/stable/gdcli_instructions/gdcli_quickstart.php quick start guide] talks about downloading the appropriate installer for your operating system. We currently have installers for MAC OS, Windows and !Ubuntu/Debian (or any other debian based Linux OS). If you are using any other OS and have python 2.7 or greater (note that python 3.0 is not currently supported), you can go ahead and use the python version of the GDCLI.  Otherwise, please download the appropriate installer package for your machine.
     35
     36[[Image(wiki:GEMINI/Tutorial/Images:accounts.png,400px)]]
     37
     38Once you have downloaded the correct binary for your OS, follow the Install instructions below for your Operating system.
     39
     40 === Linux ===
     41 1. To install run "sudo dpkg -i gdcli-1.16.deb"
     42 
     43 === Mac ===
     44   1. Drag the gdcli-1.16 icon to the Applications icon.
     45   1. Open a terminal window.
     46   1. Run the script /Applications/gdcli-1.16/addAliases.command. This script will add aliases for the various GENIDesktop CLI in your ~/.bash_profile or ~/.bash_login or ~/.profile. (The script looks for these files in this order).
     47
     48 === Windows ===
     49  1. Double click the downloaded install file.
     50
     51 === Python Script, any other OS ===
     52  1. Install Python 2 on your system. This is the normal default install on most machines. You may place the downloaded script in any directory that you want.
     53  1. If installed correctly you should be able to run the '''"gdcli version"''' command
     54
     55{{{
     56bash:~# gdcli version
     57GENI Desktop Command Line Interface v1.16
     58}}}
     59
     60If you do not see this output or run into any error , please ask for help.
     61 
     62 == STEP 2. Generate and Copy the GDCLI key. ==
     63  The first time you use the GENIDesktop CLI Tool, you will have to generate a gdcli key which is an authentication token used by the system. Click on the settings wheel icon on the top-right of the page to launch the settings menu. Click on '''Account''' button. Click the "generate key" button under '''GDCLI Key''' Section of the Account Settings page.
     64  Then copy the gdcli key into the clipboard of your windowing system so that it can be pasted in the next step.
     65
     66 == STEP 3. Enable the GDCLI using the GDCLI key. ==
     67 Open a terminal (command prompt if using Windows. On Windows you also need to '''cd c:\GDCLI .''').
     68
     69
     70Run the command below to authenticate your CLI session. Paste the key copied in STEP 2 in place of '''<key>''' in the command below.
     71
     72{{{
     73 gdcli authkey -k <key>
     74}}}
     75
     76
     77 == STEP 4. Using the GENIDesktop CLI ==
     78
     79 In this exercise we will use the existing slice that we created earlier in this tutorial. We assume that you have "iperf" installed on your nodes from the previous sections of this tutorial. Please note down your slicename and the projectname your slice belongs to. This will be needed in the command line parameters for this exercise. There are numerous operation that can be performed using the CLI, but this example will focus on three things
     80
     81 * List your nodes
     82 * Start iperf server on node-0
     83 * Start iperf client on node-1
     84 * View the traffic on the link graph after downloading the PNG
     85
     86 We can automate the above steps using a GENI Desktop CLI script.   We have created example scripts for Mac/Linux and also for Windows:
     87{{{
     88#!html
     89<ul>
     90   <li><a href=http://groups.geni.net/geni/raw-attachment/wiki/GEMINI/Tutorial/Images/gdcli_gec23.sh> bash script (For MAC and Linux Users)</a></li>
     91   <li><a href=http://groups.geni.net/geni/raw-attachment/wiki/GEMINI/Tutorial/Images/gdcli_gec23.bat> Batch processing script (.bat for Windows Users)</a></li>
     92</ul>
     93}}}
     94Click on the "Download in Original format" link at the bottom of the relevant script page mentioned above to download the script on your laptops.
     95
     96Go to the download folder and  run the relevant custom script
     97{{{
     98 ./gdcli_gec23.sh <Projectname> <slicename>
     99
     100OR
     101
     102gdcli_gec23.bat <Projectname> <slicename>
     103}}}
     104
     105If the script finishes sucessfully , windows users should see a folder window pop up with the relevant graphs in them. Linux/MAC users should see a folder called "mygraphs" appear on the desktop of their local machine (~/Desktop/mygraphs) which should contain the graph files.
     106
     107
     108  === Sample GENIDesktop CLI operations ===
     109
     110   NOTE: In the example below, we use the slicename '''demo''' and project name '''UKGENI'''.  You will need to replace these with the name of your slice and the name of your project.  We also use the node and link names from the topology set up earlier in this tutorial.
     111
     112   1. !ListNodes operation
     113
     114{{{
     115gdcli listnodes -s demo -r UKGENI
     116
     117["node-0", "node-1", "GDGN0"]
     118}}}
     119
     120   2. Run Command operation
     121
     122{{{
     123#Start Iperf Server in daemon on node-0
     124bash:~$ gdcli run -s demo -r UKGENI -n "node-0" -c "iperf -s -D> /dev/null 2>&1"
     125}}}
     126
     127{{{
     128#Start iperf client on node-1
     129
     130bash:~$ gdcli run -s demo -r UKGENI -n "node-1" -c "iperf -t 30 -c node-0 -b 10000M"
     131------------------------------------------------------------
     132Client connecting to node-0, UDP port 5001
     133Sending 1470 byte datagrams
     134UDP buffer size:  208 KByte (default)
     135------------------------------------------------------------
     136[  3] local 10.10.1.2 port 53242 connected with 10.10.1.1 port 5001
     137[ ID] Interval       Transfer     Bandwidth
     138[  3]  0.0-30.0 sec  2.68 GBytes   768 Mbits/sec
     139[  3] Sent 1959326 datagrams
     140
     141}}}
     142
     143   3. Download graph in PNG Format
     144
     145{{{
     146# Fetch graphs for the link in the slice.
     147
     148bash:~$ gdcli getpng -s demo -r UKGENI  -g linkbytes -l link-0 -n node-0 -o ~/Desktop/mygraphs
     149}}}
     150
     151[wiki:GENIExperimenter/Tutorials/GENIDesktop/GEC23#ExercisesTasks Back to GEC23 Tutorial]