be executed, returns its identification and unlocks
the thread handling the client query. The imple-
mentation is Perl-based to be independent from
the architecture. In future versions of the OpenCF
accounting system, this module will be responsi-
ble for collecting and reporting on individual and
group use of system resources.
• The Collector is the client interface which deliv-
ers the output data produced by an executed job.
Once a job has finished, the Collector automat-
ically sends an e-mail to the user.
4 OpenCF-R: R IN THE CLOUD
Most development environments based on Web ser-
vices offer facilities to include services that are acces-
sible through a web interface. However, it is true that
these environments do not provide general automatic
mechanisms for adding new web services from user
codes. Typically, export a service involves rewriting
or adapt server and describing the service by a XML
interface, meaning in practice to develop a laborious
task for the developer. When the number of services is
limited is a manageable task, however, when the num-
ber of services to manage are more than a certain size
(hundreds or thousands of services), it must negotiate
with automated tools to manage them.
One of the problems found during the design of
OpenCF-R is the hard work needed to add new ser-
vices to it. If the number of routines that we offer
is limited for addition work is acceptable, only has
to define the job description and verify that the code
match the requirements of OpenCF-R. However, if
you want to work with a greater number of jobs we
have to create an automated mechanism.
The solution developed in this work is based on
source code analysis to export as work. Generally, li-
braries analyze the source code and generates a XML
description. This way of working fits seamlessly
OpenCF-R as the description of the work used is also
based on XML. At most it would be necessary XSLT
transformation of the output generated by the library
to be translated into the schema used by OpenCF-R.
The objective of adapting OpenCF to run inter-
preted languages scripts was only the beginning of a
long way to go. Adding R a test platform was ob-
tained for the dynamic generation of web services and
other utilities (code execution uploaded by the user
and offers the main functions of R as web services).
The main problems encountered were:
• To identify the routines that would be exported as
services. The list of services to be exported must
be known in advance.
• To identify the types of data associated with the
services. End users must enter the arguments of
the service to run through the web interface of the
client. A generic specification is needed to de-
velop the service interface, and simple enough to
be manageable in practice by a non expert user.
• It is very difficult to guess input and output argu-
ments to a routine by analyzing only the header of
the routine. We could develop a heuristic based
on the use of const, pointers, etc.. but it should
be adjusted to each type of code. Another solution
is to write down the codes, for example, using the
syntax given in the comments to describe each of
the arguments (eg: based on javadoc).
• To generate the service interface, the help infor-
mation for the user and the binary code to provide
new services.
4.1 Main R Functions as a Services
Using a Python script and the library rpy (integrat-
ing python and R), we parsed th R doc and, for every
function, was generated a XML file that describes it
as a web service (i.e., specifying its input arguments,
output, description and service name). A executable
wrapper was written in perl to run a call to selected
function of R with the arguments passed by the web
service. This web service is added as some of the
functions of the R base package and the package utils.
Not all functions of R can be offered as a web service
(eg, arithmetic operators, functions with no generic
argument types, etc). To avoid incorrect services, a
list of unsupported features as web services is given
to avoid the incorrect XML file generation.
4.2 R Script Launching in OpenCF
A key objective of the project is that the user can
launch their own scritps to machine computation.
Running R scripts provided by the user in isolation
was achieved as a web service. To do this, we have
created a XML file describing the service in question,
which requires the name of the main script file to ex-
ecute and a R or zip file with the scripts necessary for
the execution. Arguments of script are read from a R
workspace file sent as input argument. Running the
R script provided could generate several file results
so, as a result of the service, the user downloads a zip
containing all the files of the service.
4.3 Dynamic Web Services Generation
The objective of the dynamic web services generation
in OpenCF is to provide to the servers more offering
CLOSER2012-2ndInternationalConferenceonCloudComputingandServicesScience
470