96 | | To see the skeleton do something |
| 96 | The 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 | |
| 98 | Running 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 | |
| 104 | The '''--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 | |
| 106 | The {{{fedd_create.py}}} command has run, you should see output similar to: |
| 107 | |
| 108 | {{{ |
| 109 | Warning:Neither master/project nor services requested |
| 110 | localname: faber-test |
| 111 | fedid: b3af52e09614b7f4731361ae82c8d66dcf50ef12 |
| 112 | status: starting |
| 113 | }}} |
| 114 | |
| 115 | You 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 | |
| 117 | In the window running the skeleton, you should see output similar to: |
| 118 | {{{ |
| 119 | 28 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' |
| 120 | 28 Jun 10 09:33:02 fedd.access [lookup_access] Checking access for (fedid(hexstr='b55205ac843c40ce9c9feb3b358bff782ed337fd'), u'testing', u'guest') |
| 121 | 28 Jun 10 09:33:02 fedd.access [lookup_access] Access granted |
| 122 | 28 Jun 10 09:33:02 fedd.access [RequestAccess] Access granted to (fedid(hexstr='b55205ac843c40ce9c9feb3b358bff782ed337fd'), u'testing', u'guest') with local creds Local_attr |
| 123 | 28 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 |
| 124 | 28 Jun 10 09:33:02 fedd.access rv = 0 |
| 125 | 28 Jun 10 09:33:02 fedd.access Wrote state to /users/faber/fedd-config/skel/skel_access.state |
| 126 | 28 Jun 10 09:33:02 fedd.access [RequestAccess] Returning allocation ID: 32b21906165aa76bbc629511b81b7504d01a0f20 |
| 127 | 28 Jun 10 09:33:02 fedd Successful SOAP request code 200 |
| 128 | 28 Jun 10 09:33:03 fedd.access Wrote state to /users/faber/fedd-config/skel/skel_access.state |
| 129 | 28 Jun 10 09:33:03 fedd.access [StartSegment] Allocated 0 to 32b21906165aa76bbc629511b81b7504d01a0f20 |
| 130 | 28 Jun 10 09:33:03 fedd.access Wrote state to /users/faber/fedd-config/skel/skel_access.state |
| 131 | 28 Jun 10 09:33:03 fedd Successful SOAP request code 200 |
| 132 | }}} |
| 133 | |
| 134 | That'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 | |
| 136 | The rest of the output is the successful !StartSegment call. |
| 137 | |
| 138 | To 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 | |
| 144 | Which outputs: |
| 145 | {{{ |
| 146 | faber-test:410964884311e3531bb8bcccb17922e4b090d905:active |
| 147 | }}} |
| 148 | |
| 149 | The 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 | |
| 151 | Removing 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 | |
| 157 | This will not produce any output (on success) though the log on your skeleton controller should now include lines like: |
| 158 | |
| 159 | {{{ |
| 160 | 28 Jun 10 09:39:42 fedd.access Terminate request for 32b21906165aa76bbc629511b81b7504d01a0f20 |
| 161 | 28 Jun 10 09:39:42 fedd.access Wrote state to /users/faber/fedd-config/skel/skel_access.state |
| 162 | 28 Jun 10 09:39:42 fedd Successful SOAP request code 200 |
| 163 | 28 Jun 10 09:39:42 fedd.access [ReleaseAccess] deallocation requested for 32b21906165aa76bbc629511b81b7504d01a0f20 |
| 164 | 28 Jun 10 09:39:42 fedd.access [ReleaseAccess] Found allocation for 32b21906165aa76bbc629511b81b7504d01a0f20 |
| 165 | 28 Jun 10 09:39:42 fedd.access Wrote state to /users/faber/fedd-config/skel/skel_access.state |
| 166 | 28 Jun 10 09:39:42 fedd.access [ReleaseAccess] Removing /users/faber/fedd-config/skel/certs/32b21906165aa76bbc629511b81b7504d01a0f20.pem |
| 167 | 28 Jun 10 09:39:42 fedd Successful SOAP request code 200 |
| 168 | }}} |
| 169 | |
| 170 | |
| 171 | That 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. |