CrabServer TaskTrackingComponent

Role

The objectives of the TaskTracking component are:

  • Keep general information about all tasks under execution.
  • Inform the notifier component when it is necessary to contact the user.
  • Generate XML reports about tasks.
  • Generate tarball with the output of all finished jobs.

Task monitoring is performed by BOSS and is kept on its own database.

Matching between a task in BOSS DB and the same task in "js_taskInstance" is done with the unambiguous name of the task (crab_crab_date_time_name_surname_timestamp).

Events

The component is subscribed to the messages:

Event Payload Details
SetThresholdLevel percentage set the percentage of jobs that has to be finished (correctly or declared failed) before generating the notify message (default 100%).
CrabWorkPerformed taskName insert the task (and related info) into the new table "js_taskInstance"; the event is generated by the component CrabServerWorker.

The component generates the following messages:

Event Payload Details
TaskNotify task name generated when notify conditions are met.

Configuration parameters

The TaskTracking accepts the following configuration parameters specified in the file ProdAgentConfig.xml :

Parameter Default Description
PollInterval 60 interval in seconds between successive polling cycles.
bossClads /home/serverAdmin/CrabProdAgent/PRODAGENT/BOSS/config/ Path of the Boss *.clad files.

Polling cycle

The component is multi threaded. The first thread deals with message handling and the second one performs polling on the database. Every polling cycle, the component:

  • queries the BOSS' DB selecting all the task;

  • for every task selected checks the state of every job, counting in a dictionary how many jobs are in a particular state;

  • evaluates the percentage (threSholdLevel) of completed jobs;

  • queries the new tabel in the PA's DB selecting general informations about the task (user's email, threSholdLevel, notificationSent);

  • creates or updates the report in the xml file hold in the task working directory;

  • if the threSholdLevel is reached and an email for notify the user owner of the task is not yet sent then:
    • create the tarball with the res subdir;
    • activates the NotificationComponent with the message "TaskSuccess" and with payload corresponding to the working_directory of the task;

  • If all jobs have finished in the tasks, perform task cleanup in database.

Report generation

La prima idea per un prototipo command line potrebbe essere un globus-url-copy del file xml.

  • la tasktracking crea il summary xml, lo scrive un /res (o altra sub dir) del progetto di crab e lo aggiorna periodicamente

  • il client al comando -status copia back il file xml. lo mostra allo user

Questo ci permette di skyppare le query esterne al db, e non ci crea problemi nel caso di impatient users...

Database structure

This is a first implementation of the task table that should be inserted in the PA's DB:

CREATE TABLE js_taskInstance (
     id int NOT NULL auto_increment,
     taskName varchar(255) NOT NULL default '',
     eMail varchar(255) NOT NULL default '',
     tresholdLevel int (3) UNSIGNED NOT NULL default '100',
     notificationSent int (1) NOT NULL default '0',
     endedLevel INT(3) UNSIGNED NOT NULL default '0',
     primary key(id),
     unique(taskName),
     key(taskName)
) TYPE = InnoDB DEFAULT CHARSET=latin1;

Notes

Note 1: the concept of completed tasks has to be defined. At the moment the definition is:

   completedPercentage = (100 / totalJobsInTask) * (successfulJobs + failedJobs)

Note 2: for efficiency reasons, the component should compute the current completed percentage for all tasks under execution when started by using the appropriate TaskStateAPI methods. These values are kept in memory (suggested a dictionary with the name of the task as index), and updated every time a task finishes. In this way, no need to perform expensive queries every time a message arrives.

-- CarlosKavka - 17 Jan 2007

Edit | Attach | Watch | Print version | History: r12 < r11 < r10 < r9 < r8 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r12 - 2007-02-23 - MattiaCinquilli
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback