Tripal 0.3b
|
Functions | |
tripal_add_job ($job_name, $modulename, $callback, $arguments, $uid, $priority=10) | |
tripal_get_module_active_jobs ($modulename) | |
tripal_jobs_get_start_time ($job) | |
tripal_jobs_get_end_time ($job) | |
tripal_jobs_get_submit_date ($job) | |
tripal_jobs_launch ($do_parallel=0) | |
tripal_jobs_check_running () | |
tripal_jobs_rerun ($job_id) | |
tripal_jobs_cancel ($job_id) |
Tripal offers a job management subsystem for managing tasks that may require an extended period of time for completion. Drupal uses a UNIX-based cron job to handle tasks such as checking the availability of updates, indexing new nodes for searching, etc. Drupal's cron uses the web interface for launching these tasks, however, Tripal provides several administrative tasks that may time out and not complete due to limitations of the web server. Examples including syncing of a large number of features between chado and Drupal. To circumvent this, as well as provide more fine-grained control and monitoring, Tripal uses a jobs management sub-system built into the Tripal Core module. It is anticipated that this functionality will be used for managing analysis jobs provided by future tools, with eventual support for distributed computing.
The Tripal jobs management system allows administrators to submit tasks to be performed which can then be launched through a UNIX command-line PHP script or cron job. This command-line script can be added to a cron entry along-side the Drupal cron entry for automatic, regular launching of Tripal jobs. The order of execution of waiting jobs is determined first by priority and second by the order the jobs were entered.
The API functions described below provide a programmatic interface for adding, checking and viewing jobs.
tripal_add_job | ( | $ | job_name, |
$ | modulename, | ||
$ | callback, | ||
$ | arguments, | ||
$ | uid, | ||
$ | priority = 10 |
||
) |
Adds a job to the Tripal Jbo queue
$job_name | The human readable name for the job |
$modulename | The name of the module adding the job |
$callback | The name of a function to be called when the job is executed |
$arguments | An array of arguements to be passed on to the callback |
$uid | The uid of the user adding the job |
$priority | The priority at which to run the job where the highest priority is 10 and the lowest priority is 1. The default priority is 10. |
Definition at line 47 of file jobs.php.
References $args, and $arguments.
Referenced by tripal_analysis_admin_validate(), tripal_core_chado_v1_11_load_form_submit(), tripal_core_gff3_load_form_submit(), tripal_cv_cvtermpath_form_validate(), tripal_cv_obo_form_submit(), tripal_feature_admin_validate(), tripal_feature_fasta_load_form_submit(), tripal_jobs_rerun(), tripal_library_admin_validate(), tripal_mviews_action(), tripal_organism_admin_validate(), and tripal_stock_admin_validate().
tripal_get_module_active_jobs | ( | $ | modulename | ) |
Returns a list of jobs associated with the given module
$modulename | The module to return a list of jobs for |
Definition at line 110 of file jobs.php.
Referenced by get_tripal_analysis_admin_form_sync_set(), get_tripal_organism_admin_form_sync_set(), tripal_analysis_admin(), tripal_feature_admin(), tripal_library_admin(), tripal_organism_admin(), and tripal_stock_admin().
tripal_jobs_cancel | ( | $ | job_id | ) |
tripal_jobs_check_running | ( | ) |
Returns a list of running tripal jobs
Definition at line 304 of file jobs.php.
References $job.
Referenced by tripal_jobs_launch().
tripal_jobs_get_end_time | ( | $ | job | ) |
Returns the end time for a given job
$job | An object describing the job |
Definition at line 220 of file jobs.php.
References $job.
Referenced by tripal_core_preprocess_tripal_core_job_view(), and tripal_jobs_report().
tripal_jobs_get_start_time | ( | $ | job | ) |
Returns the start time for a given job
$job | An object describing the job |
Definition at line 196 of file jobs.php.
References $job.
Referenced by tripal_core_preprocess_tripal_core_job_view(), and tripal_jobs_report().
tripal_jobs_get_submit_date | ( | $ | job | ) |
Returns the date the job was added to the queue
$job | An object describing the job |
Definition at line 240 of file jobs.php.
References $job.
Referenced by tripal_core_preprocess_tripal_core_job_view(), and tripal_jobs_report().
tripal_jobs_launch | ( | $ | do_parallel = 0 | ) |
A function used to manually launch all queued tripal jobs
$do_parallel | A boolean indicating whether jobs should be attempted to run in parallel |
Definition at line 252 of file jobs.php.
References $args, $do_parallel, $job, and tripal_jobs_check_running().
Referenced by runjob().