NAME
Helios::Panoptes - CGI::Application providing web admin interface to Helios distributed job processing system
DESCRIPTION
Helios::Panoptes is the web interface to the Helios distributed job processing system. It provides a central point of control for all of the services and jobs in a Helios collective. This web interface can be used to track jobs through the system and manage workloads on a per service and per host basis. Available workers may be increased or decreased as necessary, tuned to match available resources. Job processing can be held, or Helios daemons can be HALTed, from this interface.
(Why Panoptes? Check your Wikipedia. Or better yet, Greek dictionary.)
CGI::Application SETUP METHODS
setup()
The setup() method defines the available run modes, which include:
- ctrl_panel
-
The Ctrl Panel is the web interface to the central Helios configuration parameter repository (the helios_params_tb table in the Helios database).
- ctrl_panel_mod
-
Used by the Ctrl Panel and Worker Admin run modes to change configuration parameters in helios_params_tb.
- job_queue_view
-
The Job Queue view provides views of waiting, running, and completed jobs in the Helios collective.
- collective
-
The Collective Admin provides a simple, dashboard-style view of the current services running in the Helios collective, broken down by host. The service class version is displayed, as well as the daemons' uptime. Job processing can be held and unheld here, and the daemons' run modes can be shifted between Normal and Overdrive mode. The maximum workers for each service can be managed, and services can be shut down here via the HALT button.
- job_submit
-
The Submit Job view provides a simple interface to submit a test job to the Helios collective for debugging purposes.
teardown()
The only thing that currently happens in teardown() is the database is disconnected.
RUN MODE METHODS
These methods define code that back the particular application pages.
ctrl_panel()
This method controls the rendering of the Ctrl Panel view, used to display Helios configuration parameters. The view also allows the user to change config parameters, although the actual config modifications are handled by the ctrl_panel_mod() run mode.
ctrl_panel_mod()
Run mode used to modify Helios config parameters. Used by ctrl_panel() and collective().
The ctrl_panel_mod run mode uses the following parameters:
- worker_class
-
The worker (service) class of the changed parameter
- host
-
The host of the changed parameter (* for all hosts)
- param
-
THe name of the parameter
- value
-
The value the parameter should be changed to
- action
-
The action (add, modify, delete) to perform. A delete action will delete the param for the worker class and host in question (obviously), add will add it, and modify will replace any existing values of the parameter with the new value.
job_queue_view()
The job_queue_view() run mode handles the display of the lists of running, waiting, and completed jobs. Note that although all Job Queue lists are dispatched to here, lists of completed jobs are actually redirected to _job_queue_view_completed().
_job_queue_view_done()
This method is called from job_queue_view() to deal with displaying completed jobs, which pulls completed job data from helios_job_history_tb instead of the job table.
job_queue_count()
This method will handle a job queue view that displays only counts.
job_submit()
The job_submit() run mode allows for manual submission of a job to the Helios collective via Panoptes. This run mode is useful mainly for debugging purposes.
This run mode uses the Helios web job submission interface (submitJob.pl) and requires the job_submit_url option being set in the [global] section of helios.ini so it can submit the job to the appropriate URL. eg:
[global]
job_submit_url=http://localhost/cgi-bin/submitJob.pl
This run mode is really just displaying a form with some of the details filled in. Once you submit the form, the response you receive is actually the response returned from submitJob.pl. If job submission was successful, this is normally a file of type text/xml with a <status> section (normally containing 0) and a <jobid> section (containing the id of the job just submitted). If there was an error during submission, the response will be an HTTP error, and submitJob.pl will log a message in the Helios log.
collective()
The collective() run mode provides the Collective display, a list of what Helios service daemons are running in the collective, with some limited convenience controls for admins that don't want to deal with the Ctrl Panel.
The collective() method actually reads the groupby CGI parameter and dispatches to _collective_host() or _collective_service(), depending on which the user specified (the default is service).
_collective_host()
The _collective_host() method provides the Collective display grouped by host.
_collective_service()
The _collective_service() method provides the Collective display grouped by service.
OTHER METHODS
These are auxiliary/utility methods used by the run mode methods.
splitEpochDate($epoch_seconds)
Given a datetime in epoch seconds, this method returns a hashref containing the component date parts. The keys of the hash follow Oracle naming conventions because that is what the author was most familiar with:
YYYY four-digit year
MM two-digit month
DD two-digit day
HH twenty-four hour
HH12 twelve hour
HH24 twenty-four hour
MI two-digit minutes
SS two-digit seconds
AMPM ante/post meridium
loadClassMap([$keyfield])
Load the contents of the helios_class_map table into memory, returning it as a hashref. If $keyfield is specified (job_type, job_class), it will be the key field in the hash. If $keyfield is not specified, job_type is the default.
loadFuncMap
Load the contents of the funcmap table into memory, because it's small and lots of methods need it. THe funcmap table associates a funcid with a service class name for internal purposes.
loadParams([$keyfield])
Returns a hashref data structure containing all of the Helios config params. The keyfield can be either 'worker_class' or 'host' ('worker_class' is the default).
modParam($action, $worker_class, $host, $param, [$value])
Modify Helios config parameters. Used by ctrl_panel() and collective() displays.
Valid values for $action:
- add
-
Add the given parameter for the given class and host
- delete
-
Delete the given parameter for the given class and host
- modify
-
Modify the given parameter for the given class and host with a new value. Effectively the same as a delete followed by an add.
Worker class is the name of the class.
Host is the name of the host. Use '*' to make the parameter global to all instances of the worker class.
Returns a true value if successful and throws an Error::Simple exception otherwise.
SEE ALSO
Helios::Service, helios.pl, <CGI::Application>, HTML::Template
AUTHOR
Andrew Johnson, <lajandy at cpan dotorg>
COPYRIGHT AND LICENSE
Copyright (C) 2008-9 by CEB Toolbox, Inc.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.0 or, at your option, any later version of Perl 5 you may have available.
WARRANTY
This software comes with no warranty of any kind.