Node Services
|
Node
Service Programmers Manual
API reference can be found at http://www.mcs.anl.gov/fl/research/accessgrid/documentation/developer/api_2_4
|
Example
1 - DebugService
|
- Download DebugService.zip
- Install the service
agpm.py -z DebugService.zip
Notes:
On OSX, you must have sourced the setupenv.sh
file
On Windows, agpm.py must be run from the
install directory
- In the VenueClient
- Preferences->Manage My Node
- Service->Add, DebugService
- Select DebugService,
then Service->Configure
- Note GUI for configurable parameters
- Enter a Venue. Open DebugService.log;
note output logged in various method calls, if debug is on (which it is
by default).
|
Exercise
1 - DebugService
|
- Extract DebugService.zip to a directory
- Open DebugService.py in an editor.
- Add TextParameter named ‘executable’
to service configuration
- Add code to run the executable specified in the parameter, when
the Start method is called
- Add code to the Stop method to terminate the process
- Open DebugService.svc
in an editor
- Modify the version to be 1.1, to indicate that this is a newer
version of the DebugService
- Create DebugService.zip, containing DebugService.py and DebugService.svc
- Install the modified service
agpm.py -z DebugService.zip
- Add the DebugService
and enter a Venue (steps 3 and 4 in the example above).� Open the service configuration
(Service->Configure) �and set
the value in the executable field to a valid executable file (e.g. /usr/bin/xterm, c:\windows\notepad.exe)
- Enter a Venue; the specified executable should
be run.� When changing Venues, the
executable should be stopped and restarted.
Solution:� DebugService_Solution.py
|
Example 2 - ClientAnnouncerService
|
- Download ClientAnnouncerService.zip
- Install the service
agpm.py -z ClientAnnouncerService.zip
- In the VenueClient
- Preferences->Manage My Node
- Service->Add, ClientAnnouncerService
- Select ClientAnnouncerService, then
Service->Configure
- Enter the specified Venue (ask if it hasn’t
been specified). Your name should appear in the ClientViewer
|
Exercise 2 - ClientAnnouncerService
|
- Open the ClientAnnouncerService.py
file in an editor
- Uncomment
the two sections specified in the code
- Open the ClientAnnouncerService.svc
file in an editor
- Increment the version number to 1.1
- Create ClientAnnouncerService.zip,
containing ClientAnnouncerService.py
and ClientAnnouncerService.svc
- Install the modified service
agpm.py -z ClientAnnouncerService.zip
- Add the ClientAnnouncerService and
enter the specified Venue (steps 3 and 4 in the first example).
Your name should appear in the ClientViewer.
- Open service configuration for the ClientAnnouncerService, setting the widearea parameter to ‘Off’. Your
name should move from the Global ClientViewer
to the Venue ClientViewer.
|
Additional Example - ClientViewer
|
- Download ClientViewer.zip
- Extract the ClientViewer.zip file to a
directory
- Run the program
python ClientViewer.py address port
|