Changes between Version 9 and Version 10 of FeddSkelPlugin


Ignore:
Timestamp:
Jun 28, 2010 1:59:22 AM (14 years ago)
Author:
faber
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • FeddSkelPlugin

    v9 v10  
    9494This assumes you have properly installed fedd and that fedd.py is in your path.  You will see a few log messages indicating that the access and state databases have been read or are not yet created.
    9595
    96 To see the skeleton do something
     96The easiest way to see the skeleton operate is to access it through the DETER experiment controller.  To do that we need two things, permission to use an experiment controller and a way to tell that experiment controller where our skeleton is.  Permission is handled by using the [attachment:guest.pem guest fedid certificate] on the DETER experiment controller.  In order to tell that experiment controller where to find our skeleton, we use the '''--map''' parameter to [FeddCommands#fedd_create.py fedd_create.py].
     97
     98Running a command like the following should cause DETER's experiment controller to start an experiment on the running skeleton:
     99
     100{{{
     101$ ./fedd_create.py --cert=./guest.pem --url=https://users.isi.deterlab.net:13232 --experiment_name=faber-test --file=./skel-only.tcl --map=skeleton:https://users.isi.deterlab.net:13230
     102}}}
     103
     104The '''--cert''' parameter must point to your local copy of [attachment:guest.pem], you can pick any '''--experiment_name''' you like, though names prefixed by you suername are less likely to collide with the names chosen by others, '''--file''' must point to an experiment description containing nodes destined for testbed "skeleton", again a local copy of [attachment:skel-only.tcl] is a good choice.  Finally the '''--map''' parameter needs to map the "skeleton" testbed into your running skeleton's URI.  The hostname part should be a globally reachable IP address or DNS name on which your controller is running and the port part should be the value in the '''services''' parameter in the '''[globals]''' section of the configuration file.  If you are using the example file, the 13230 port is correct.
     105
     106The {{{fedd_create.py}}} command has run, you should see output similar to:
     107
     108{{{
     109Warning:Neither master/project nor services requested
     110localname: faber-test
     111fedid: b3af52e09614b7f4731361ae82c8d66dcf50ef12
     112status: starting
     113}}}
     114
     115You needn't worry about the warning.  The localname is the string by which you can access the experiment.  If there was another experiment running on the DETER controller with the same name as you requested in the '''--experiment_name''' parameter, you would need to use the one returned.  If you miss the name here, you can always retrieve it using the [FeddCommands#fedd_multistatus.py fedd_multistatus.py] command.
     116
     117In the window running the skeleton, you should see output similar to:
     118{{{
     11928 Jun 10 09:32:50 fedd.access [read_state]: No saved state: Can't open /users/faber/fedd-config/skel/skel_access.state: [Errno 2] No such file or directory: '/users/faber/fedd-config/skel/skel_access.state'
     12028 Jun 10 09:33:02 fedd.access [lookup_access] Checking access for (fedid(hexstr='b55205ac843c40ce9c9feb3b358bff782ed337fd'), u'testing', u'guest')
     12128 Jun 10 09:33:02 fedd.access [lookup_access] Access granted
     12228 Jun 10 09:33:02 fedd.access [RequestAccess] Access granted to (fedid(hexstr='b55205ac843c40ce9c9feb3b358bff782ed337fd'), u'testing', u'guest') with local creds Local_attr
     12328 Jun 10 09:33:02 fedd.access [generate_fedid] /usr/bin/openssl req -text -newkey rsa:2048 -keyout /tmp/key-gY474.pem -nodes -subj /CN=alloc -x509 -days 30 -out /tmp/certAJ3SiY.pem
     12428 Jun 10 09:33:02 fedd.access rv = 0
     12528 Jun 10 09:33:02 fedd.access Wrote state to /users/faber/fedd-config/skel/skel_access.state
     12628 Jun 10 09:33:02 fedd.access [RequestAccess] Returning allocation ID: 32b21906165aa76bbc629511b81b7504d01a0f20
     12728 Jun 10 09:33:02 fedd Successful SOAP request code 200
     12828 Jun 10 09:33:03 fedd.access Wrote state to /users/faber/fedd-config/skel/skel_access.state
     12928 Jun 10 09:33:03 fedd.access [StartSegment] Allocated 0 to 32b21906165aa76bbc629511b81b7504d01a0f20
     13028 Jun 10 09:33:03 fedd.access Wrote state to /users/faber/fedd-config/skel/skel_access.state
     13128 Jun 10 09:33:03 fedd Successful SOAP request code 200
     132}}}
     133
     134That's the output from a successful experiment creation on the skeleton.  Notice the request for access from (b55205ac843c40ce9c9feb3b358bff782ed337fd, 'testing', 'guest') that is approved, the creation of the access principal and the saving of state all before the first {{{Successful SOAP request code 200}}} line.  That is all output from a successful !RequestAccess call, and you can trace the !RequestAccess method in [source:fedd/trunk/federation/skeleton_access.py federation/skeleton_access.py].
     135
     136The rest of the output is the successful !StartSegment call.
     137
     138To see the state of your experiment do the following.  Make sure to give the '''--cert''' option.  Without it the commands will either fail, or if you have a certificate in a standard emulab set-up, return confusing results.
     139
     140{{{
     141$ ./fedd_multistatus.py --cert=./guest.pem --url=http://users.isi.deterlab.net:13232
     142}}}
     143
     144Which outputs:
     145{{{
     146faber-test:410964884311e3531bb8bcccb17922e4b090d905:active
     147}}}
     148
     149The first two fields are the readable name and the fedid of the experiment, which will match the output from {{{fedd_create.py}}} not the ones in this document.  The {{{fedd_multistatus.py}}} command only queries the experiment controller, so no changes to the skeleton log will be happen.
     150
     151Removing the experiment will exercise the !StopSegment and !ReleaseAccess methods of the skeleton.  You can do this by running the command (again, use '''--cert''' and the experiment name returned by {{{fedd_create.py}}} and {{{fedd_multistatus.py}}} above):
     152
     153{{{
     154$ ./fedd_terminate.py --cert=./guest.pem --url=http://users.isi.deterlab.net:13232 --experiment_name=faber-test
     155}}}
     156
     157This will not produce any output (on success) though the log on your skeleton controller should now include lines like:
     158
     159{{{
     16028 Jun 10 09:39:42 fedd.access Terminate request for 32b21906165aa76bbc629511b81b7504d01a0f20
     16128 Jun 10 09:39:42 fedd.access Wrote state to /users/faber/fedd-config/skel/skel_access.state
     16228 Jun 10 09:39:42 fedd Successful SOAP request code 200
     16328 Jun 10 09:39:42 fedd.access [ReleaseAccess] deallocation requested for 32b21906165aa76bbc629511b81b7504d01a0f20
     16428 Jun 10 09:39:42 fedd.access [ReleaseAccess] Found allocation for 32b21906165aa76bbc629511b81b7504d01a0f20
     16528 Jun 10 09:39:42 fedd.access Wrote state to /users/faber/fedd-config/skel/skel_access.state
     16628 Jun 10 09:39:42 fedd.access [ReleaseAccess] Removing /users/faber/fedd-config/skel/certs/32b21906165aa76bbc629511b81b7504d01a0f20.pem
     16728 Jun 10 09:39:42 fedd Successful SOAP request code 200
     168}}}
     169
     170
     171That shows how to run the skeleton and exercise its interfaces with well formed commands from the experiment controller.  You can now begin customizing your plug-in.