Implementing a new service job in g-Eclipse is quite easy. Service Jobs framework provides abstract implementations for the most common use cases:
What is left to the developer is to provide few methods, mainly the ones which will:
eu.geclipse.core.model.IServiceJobeu.geclipse.servicejob.model.tests.job.AbstractSubmittableServiceJobIServiceJob interface
provides useful implementation for the most common use cases: submitting a JSDL,
starting service job status updater and monitor status of the job,
initialize computing of the result when service job finishes. Also see
eu.geclipse.servicejob.model.AbstractServiceJob, which
is used by AbstractSubmittableServiceJob, for useful methods
and fields.Also see
eu.geclipse.servicejob.model.submittable.job.
AbstractSubmittableServiceJob abstract class for documentation.
This is a very important step. When service job is submitted using Service Job Framework several methods of the service job implementation are used to get needed information about the service job. Below are the methods you need to implement.
public void initData()public List getServiceJobResourcesNames() serviceJobResources field of the
AbstractServiceJob.
public String getResultType( final String singleServiceJobName )
public String getRawDataInput( final IGridJobID jobID,
final String resourceName )eu.geclipse.benchmarking.model.service.BenchmarkServiceJob for
exemplary XML in case of benchmarking services in gLite, and
eu.geclipse.benchmarking.model.service.BenchmarkServiceJobParser
for XML parser in this case.
Submittable service jobs are started by submitting appropriate job
description to run on specified resource. Developer which will extend
AbstractSubmittableServiceJob needs to provide such job
description by implementing following method:
public IGridJobDescription getJSDLForSubmission(
final String resourceName )resourceName.
submissionService field of the
AbstractSubmittableServiceJob. If you need to provide submission
service in different way, you can overwrite
public IGridJobService getSubmissionService() method.
Note: When using gEclipse UI the standard action "Run Service Job" will fetch list of available job submission services of this service job's VO. User selects one of them and the job is submitted using this submission service.
Service jobs are middleware-dependant. Since job implementations are quite
different between each middleware, it's service job developer duty to know how
to construct such job ID. To construct such middleware specific job you
often need additional informations( for example string representing job ID, name
of the VO, etc. ). It's often good idea to get XML containing service job
specific information by invoking getResultRawData() and parsing
the results.
public IGridJobID createJobID(
final SubmittableServiceJobResult serviceJobResult )IGridJobID implementation, given the
serviceJobResult.
After job associated with a service job finishes the corresponding service
job's implementation of the method computeJobResult( final IGridJobID jobID,
final IGridJobStatus jobStatus ) is invoked. The usual implementation
proceeds as follows:
jobStatus of the job. For jobs which were not
successful go to point number 4.computeJobResult method is advised. To set result of the
job use:
public void setJobResult( final IGridJobID jobID,
final Date lastRefreshDate,
final String status,
final String besStatus )
status for job with the given
jobID, which was read from job service at
lastRefreshDate. Last parameter, besStatus,
should be one of the global job statuses. See
eu.geclipse.servicejob.model.ServiceJobStates enumeration class
for list of available statuses.
Note:Downloading outputs of the job is specific for each middleware.
Because Service Job Framework is middleware-independent developers need to know
how to download output of the job having middleware-specific implementation of
the IGridJobID. For example you can check
eu.geclipse.benchmarking.model.service.BenchmarkServiceJob class
and protected IFile getOutput( final IGridJobID jobID,
final IFolder folder,
final String fileName ) method how this is
done in gLite middleware case.
After the last job of the service job has finished, then whole service job result can be computed. This can mean checking if all sub-jobs were finished successfully or checking all outputs generated by the sub-jobs. Developer need to handle this case to compute whole service job result and proceed with the result.
computeJobResult(IGridJobID, IGridJobStatus). This is a method
which should be used to store the results of the service job in a database
or in another modules.
This service job is used to benchmark various resources on the grid.
User needs to provide file used for benchmarking (you can find 2 benchmarks
in the eu.geclipse.benchmarking/xml - bonnie.bsx and
flops.bsx) and additional parameters, if needed. Results are stored
in local database, and can be viewed using Benchmark View.
eu.geclipse.benchmarking.model.service.BenchmarkServiceJobgetRawInputData method
look like. Also you can check how you can download job output using
eu.geclipse.glite.resources.GliteWMSJobID in the method
IFile getOutput( final IGridJobID jobID,
final IFolder folder,
final String fileName ).eu.geclipse.benchmarking.model.service.BenchmarkServiceJobParserGliteWMSJobID
from the raw input data XML stored in the service job status file.eu.geclipse.gbdl.ui.wizards.BenchmarkWizardeu.geclipse.servicejob.ui.wizard.AbstractServiceJobWizardNode,
adding benchmarking pages to service job wizard.
Application deployment deals with cases of software installation on computing elements(CEs), while uninstall is the reverse problem. User is asked to select target CEs and the appropriate application (in form of a file) he wants to deploy or uninstall.
eu.geclipse.glite.servicejob.deployment.DeploymentServiceJobrun() action to perform some additional tasks just before
job submission.eu.geclipse.glite.servicejob.deployment.UninstallServiceJobeu.geclipse.glite.servicejob.deployment.DeploymentParser
eu.geclipse.glite.ui.servicejob.deployment.GliteDeploymentWizard/GliteUninstallWizard
This service job was the first implementation of the g-Eclipse service job framework. It tests selected resources for installed gLite version.
eu.geclipse.glite.servicejob.gliteversion.GliteVersionJobTesteu.geclipse.glite.servicejob.gliteversion.GTDLGliteVersionParser