<?xml version="1.0" encoding="iso-8859-2"?>

<zprava cislo="4/2007" jazyk="en">
<nazev>gLite Job Provenance -- a~job-centric view</nazev>
<autor>Aleš Křenek, Jiří Sitera, Luděk Matyska, František Dvořák, Miloš Mulač, Miroslav Ruda, Zdeněk Salvet</autor>
<datum></datum>

<h1>Abstract</h1>

<p>Job Provenance (JP) is a~Grid service that keeps long-term trace on completed computations for further reference. It is a~job-centric service, keeping records about job life cycle, its environment, inputs/outputs, user parameters etc. The data collected from the Grid middleware where the job has run can be complemented with user annotations that add a~personalized view.</p>

<p>JP is a~part of the gLite Grid middleware developed within the EU EGEE project by CESNET based development group. This technical report sumarizes participation of CESNET team in the first provenance challenge, event organized by data provenance community.</p>

<p>During this challenge we explored the relation between a~specific job-centric Grid oriented provenance and a~more general data provenance approach. We show how JP can store data about complex workflows and how these data can be used to answer user queries.</p>

<p>As the implementation of the challenge workflow is realized in a~real production level Grid system (gLite based EGEE Grid) it also provides an insight how the workflow tasks can be implemented and run on a~Grid.</p>

<p><b>Keywords:</b> GRID, Job Provenance, Data Provenance, Job State Tracking</p>


<h1>Motivations</h1>

<p>A~general requirement in the environment of traditional experimental science
states that <i>any result must be verifiable by redoing the experiment.</i>
Nowadays, many <uv>experiments</uv> are carried in a~virtual environment as
computations. However, the same principle applies -- a~result of a computation is questionable and generally not accepted by the community if it is not verifiable by an independent computation.</p>

<p>On the other hand, results of a~computation critically depend both on its exact specification (input data, parameters etc.) and environment where the computation is run (for example versions of used software). Therefore, keeping a~long-term accurate trace of computations is critical for the scientific value of the computed results.</p>

<p>In the environment of a~computational Grid the requirement is even more critical because the user does not have a~complete control over the resources used for her computation (this is an intrinsic property of the Grid).</p>

<p>The need for a~Grid middleware service that would help users tracking their jobs, store the information for long term, allow adding further annotations, and provide efficient querying capabilities finally, was the primary motivation for developing <i>Job Provenance</i> (JP).</p>

<p>A~related service, <i>Logging and Bookkeeping</i> (L&amp;B)~<cite
href="Kou04"/> was already available from the EU DataGrid project. It is
designed for tracking jobs during their active life time, and for providing
users with the information on the job state. Due to the optimization for this
purpose L&amp;B is not suitable for long-term storage, old data are purged from
L&amp;B regularly in order to keep the active data size reasonable for
performance purposes. However, users start complaining that the job data they
are used to query from L&amp;B suddenly <uv>disappear</uv>. Moreover, not all data required for job re-execution are present in L&amp;B, namely job inputs. Nonetheless, experience with L&amp;B was a~good starting point for the JP design.</p>

<p>At the time of writing this manuscript, JP is deployed experimentally on a~part of the <a href="http://www.eu-egee.org">EGEE</a> infrastructure, and it is in a~candidate state for integration into the gLite~3.1 middleware release. It is expected to be used by individual end-users as a~long-term extension of L&amp;B, user communities for collaboration, as well as various Grid monitoring and statistics gathering tools. Some expected usage patterns are described in <cite href="JPUG06"/> and an application-oriented use case of JP is being prepared in parallel with this manuscript (see ~<cite href="Pet07"/>). However, as the goal of JP is to encompass the whole EGEE-like production Grid infrastructure, there is not yet sufficient experience that would lead to clear understanding of usage patterns. This is reflected in the design, allowing high flexibility in configuration as well as further extensions.</p>

<p>We participated in the First Provenance Challenge for two main reasons. First, comparison with other systems was tempting and likely to identify weak points in both JP design and implementation, as well as to bring new ideas for further development. The other reason was testing the usability of JP for a~task oriented more on data than process (or job) provenance, that is quite different from the original intention.</p>

<h1 id="arch">Job Provenance design</h1>

<p>Pragmatic implementational requirements on JP emerging from its main purpose are rather contradictory. Information on each job should be sufficiently detailed in order to allow job re-execution, while the gathered data should be stored for long time. This implies ever growing requirements on storage space that must be kept reasonable by making job records as compact as possible. The EGEE project aims at 1 million jobs per day; quantitative assessments of implications in JP are given in~<cite href="Mat07"/>, as well as deployment considerations. At the same time efficient queries are required, which is virtually impossible on huge number of compact records. Finally, JP has to be able to cope with long-term evolution of various data formats consistently.</p>

<p>The overall JP design tries to keep these requirements in a~reasonable balance. In this section we provide a~brief overview. Details can be found in~<cite href="Dvo06"/>.</p>

<h2 id="nutshell">gLite job processing in a~nutshell</h2>

<p>Despite its design being general, capable of handling virtually any Grid jobs, Job Provenance was developed as a~part of the gLite middleware~<cite href="Lau04"/>, and gLite-based Grid was used to run the challenge workflows as well as the queries. Therefore we describe gLite job processing briefly here. Further details can be found in~<cite href="Ave03"/>.</p>

<p>The only way the user can access computational resources in gLite middleware~<cite href="Lau04"/> is through a~<i>job</i>. Despite not completely restricted to, gLite is designed to support large number of traditional batch, non-interactive jobs.</p>

<p>Upon creation the job is assigned a~unique immutable <i>job identifier</i> (jobid). The jobid is used to refer to the job all the time during the job active life and afterwards.</p>

<p>The user describes the job (executable, parameters, input files etc.) using the <i>Job Description Language (JDL)</i>~<cite href="Pac06"/>, using the extensible <i>Classified Advertisement</i> (ClassAd)~<cite href="RLS98"/> syntax. The description may grow fairly complex, including requirements on the execution environment, proximity of input and output storage etc.</p>

<p>Processing of the job can be summarized as follows (denoting gLite components in italics):</p>

<ul>
<li>
<p>the job is submitted via a~<i>User Interface</i> (either command line or graphical)</p>
</li>
<li>
<p><i>Workload Manager</i> (WM) queues the job and starts finding a~suitable <i>Computing Element</i> (CE) to execute it</p>
</li>
<li>
<p>the job is passed to the chosen CE and runs there</p>
</li>
<li>
<p>after completition, the user can retrieve the job output</p>
</li>
<li>
<p>all the time, the job is tracked by <i>Logging and Bookkeeping</i> (L&amp;B) service, which provides the user with the view on the job state and further details of job processing</p>
</li>
<li>
<p>after the user retrieves the job output, the middleware data (namely the job trace in L&amp;B) on the job are passed to JP and purged in their original locations</p>
</li>
<li>
<p>annotations can be added to the job during its active life time via L&amp;B (even from inside of the running application) or any time afterwards via JP.</p>
</li></ul>

<p>Besides simple jobs gLite supports also complex ones, job workflows in the form of <i>Directed Acyclic Graphs</i> (DAG). A DAG is completely described, using a~nested JDL syntax, as a~set of its nodes (simple jobs) and execution dependencies among them. DAG processing is implemented by interfacing the WM planning machinery with the Condor <a href="http://www.cs.wisc.edu/condor/dagman/">DAGMan</a>.</p>

<h2 id="data-management">Data in JP and their organization</h2>

<p>The primary data organization in JP is on a per job basis, a~concept following the L&amp;B model. Every data item stored in JP is associated to a~concrete Grid job. The following data are gathered from the Grid middleware:</p>

<ul>
<li>
<p>job inputs, directly required for job re-running: complete job description (the JDL record) as submitted to the WM system (WMS) and miscellaneous input files (gLite WMS input sandbox) provided by the user (however, job input files from reliable remote storage are not copied to JP; this would not be feasible in a~large scale)</p>
</li>
<li>
<p>job execution trace, witnessing the environment of job execution -- complete
L&amp;B data, that is when and where the job was planned and executed, how many
times and for what reasons it was resubmitted etc., and <uv>measurements</uv> on computing elements, for example versions of installed software, environment settings etc.</p>
</li>
<li>
<p>JP user tags -- the JP service allows the user to add arbitrary annotations
to a~job in a form of <uv>name~=~value</uv> pairs. These annotations can be recorded either during the job execution or at any time afterward. Besides providing information on the job (for example that it was a~production-phase job of a particular experiment) these annotations may carry information on relationships between the job and other entities like external datasets, forming the desired data provenance record (<a href="#dataprov">Section</a>).</p>
</li></ul>

<p><a href="#fig:psinter">Figure</a> shows the dataflow channels from Grid middleware components (gLite) into JP.</p>

<obr id="fig:psinter" src="JP-interactions" rotate="1">Data flow into gLite Job Provenance</obr>

<p>In order to overcome the diversity of various data formats as well as their long-term evolution, to provide further extensibility, and to unify the handling of different data, the JP concept distinguishes between the following views on the data:</p>

<ul>
<li>
<p><i>Raw representation</i> -- the physical data received and stored in JP. There are two input and storage modes in JP:</p>

<ul>
<li>
<p>Small size <i>tags</i>, expressed as <uv>name~=~value</uv> pairs, enter the
system via its primary interface (a~web service operation in the current
implementation). <uv>Value</uv> is assumed to be a~literal, without any structure that JP should be aware of.</p>
</li>
<li>
<p><i>Bulk files</i>, typical example is the complete dump of L&amp;B data or
the job input sandbox, are uploaded via a~suitable transfer protocol. Files are
supposed to be structured. However, they are stored <uv>as is</uv>, and upon upload they are annotated with format identification, including version of the format. JP allows installing plugins that handle particular file formats (see below), understanding the file structure and extracting required information.</p>
</li></ul>
</li>
<li>
<p><i>Logical view</i> is an abstract level used for manipulation of JP data, and it is the preferred way for the most of JP operations (queries are specified in terms of attributes of the logical view). The following list summarizes the basic ideas:</p>

<ul>
<li>
<p>All data are expressed by <i>attributes</i> at the logical level. A~job attribute has a~unique name and may have multiple values for a~single job. The attribute name must be fully qualified with a~namespace (its schema can be specified and enforced) in order to ensure extensibility and uniqueness.</p>
</li>
<li>
<p>Explicitly recorded tags (user annotations) map to attributes in a~straightforward way, name and value of a~tag becoming name and value of an attribute.</p>
</li>
<li>
<p>An uploaded file is usually a~source of multiple attributes, which are
<uv>digested</uv> from the file based on knowledge of a~particular file structure and semantics. For example, L&amp;B dump file provides attributes like job submission and completition time, number of resubmits, CE where the job ran etc.</p>
</li>
<li>
<p>The <uv>digest</uv> process extracting attributes from raw data files is implemented with <i>JP plugins</i>. The task of a~plugin is parsing a~particular file type and providing calls to retrieve attribute values. JP defines a~fixed plugin interface API.</p>
</li></ul>
</li></ul>

<h2>JP components</h2>

<p>JP provides two classes of services: a~permanent <i>Primary Storage</i>
(JPPS) accepts and stores job data, while possibly volatile and configurable
<i>Index Servers</i> (JPIS) provide an optimized querying and data-mining
interface for the end-users (see <a href="#fig:JP-query">Figure</a>).
Relationship of JPPS and JPIS is a many-to-many -- a~single JPIS can query multiple JPPS s and vice versa, a~single JPPS is ready to feed multiple JPIS s.</p>

<obr id="fig:JP-query" src="JP-query">Job Provenance components</obr>

<h3>Primary Storage</h3>

<p>A~single instance of JPPS, shown in <a href="#fig:JP-query">Figure</a>, is formed by a~front-end, exposing its operations via a~web-service interface(<cite href="EGEE04"/>), and a~back-end, responsible for actual data storage and providing the bulk file transfer interface using arbirtrary file-oriented transfer protocol(s). Both the front- and back-ends share a~filesystem so that the file-type plugins linked into the front-end access their files via POSIX~I/O.</p>

<p>JPPS operations fall into the following categories:</p>

<ul>
<li>
<p><i>Job registration.</i> Each job has to be explicitly registered with JP. Currently the registration is done transparently by the L&amp;B server upon job submission (in parallel with the job registration in L&amp;B, though not blocking the job submission).</p>
</li>
<li>
<p><i>Tag recording.</i> Add user tags (annotations) in the <uv>name~=~value</uv> form to JP job records.</p>
</li>
<li>
<p><i>Bulk file upload.</i> File properties (type, optional name etc.) are specified via the front-end interface, the upload itself goes directly to the back-end (using <tt>gridftp</tt> transfer).</p>
</li>
<li>
<p><i>Index Server feed</i> allows JPIS to ask for batch feed as well as register for incremental updates.</p>
</li>
<li>
<p><i>Data retrieval.</i> The only direct data retrieval supported by JPPS is keyed by the jobid. Both individual attributes and the whole files can be retrieved.</p>
</li></ul>

<p>Primary Storage covers the first set of requirements specified for a Job
Provenance -- storing a~compact job record, allowing the user to add annotations, and providing elementary access to the data.</p>

<p>The current implementation uses MySQL relational database to store basic job metadata and Globus <tt>gridftp</tt> server as the back-end.</p>

<h3>Index Server</h3>

<p>The role of <i>Index Servers</i> (JPIS) is processing and re-arranging the data from Primary Storage(s) into a~form suitable for frequent and complex user queries. A~typical interaction is shown in <a href="#fig:JP-query">Figure</a>, consisting of following steps:</p>

<ol>
<li>
<p>The user queries one or more JPIS, receiving a~list of ID s of jobs matching the query.</p>
</li>
<li>
<p>JPPS is directly queried for additional job attributes or URL s of stored files.</p>
</li>
<li>
<p>The required files are retrieved eventually.</p>
</li></ol>

<p>A~query language is intentionally restricted in order to allow efficient implementation of the query engine. The current format of the query is a~list of lists of conditions. A~condition is a~comparison (less, greater, equal) of an attribute value to a~constant. Items of an~inner list must refer to the same attribute and they are logically OR-ed. Finally the inner lists are logically AND-ed. According to our experience with the L&amp;B service, this query language is powerful enough to satisfy user needs while simple enough to allow efficient processing.</p>

<p>For example, query all jobs named <uv>align</uv> executed with parameter
<uv>-m~12</uv> and ran on Monday or Tuesday:</p>
 
<pre>
(program="align") AND (param="-m 12") AND (day="Monday" OR day="Thuesday")
</pre>
 
<p>JPIS provides the following operations:</p>

<ul>
<li>
<p><i>User queries</i> -- it is the primary interface for end users as described above. A~query specifies a~set of attributes to be retrieved and conditions determining the set of matching jobs.</p>
</li>
<li>
<p><i>JPIS-JPPS communication</i> -- implements the data flow from JPPS to JPIS. Each JPIS can subscribe to JPPS according to its configuration to receive data matching the configuration or just ask for data matching the configured criteria.</p>
</li>
<li>
<p><i>Administrative</i> -- calls to change JPIS configuration without interfering with its normal operation.</p>
</li></ul>

<p>Index Servers are created, configured, and populated semi-dynamically according to particular user community needs. The configuration is formed by:</p>

<ul>
<li>
<p>one or more Primary Storages to contact,</p>
</li>
<li>
<p>conditions (expressed in terms of JP attributes) on jobs that should be retrieved,</p>
</li>
<li>
<p>list of attributes to be retrieved,</p>
</li>
<li>
<p>list of attributes to be indexed -- a~user query must refer to at least one of these for performance reasons.</p>
</li></ul>

<p>The set of attributes and the conditions specify the set of data that is retrieved from JPPS, and they reflect the assumed pattern of user queries. The amount of data fed into a~single JPIS instance is assumed to be only a~fraction of data in JPPS, both regarding the number of jobs, and the number of distinct attributes.</p>

<p>The current JPIS implementation keeps the data also in a~MySQL database. Its schema is flexible, reflecting the server configuration (columns are created to hold particular attribute value, as well as indices). Currently all attributes are handled as strings, however, we are considering type-extension mechanisms that would allow processing complex attribute types, as well as adding further operators besides simple comparisons.</p>

<h1>The challenge</h1>

<p>In this section we describe in detail our approach to the First
Provenance Challenge. Details on the challenge, specification of the
challenge workflow as well as the prescribed queries can be found at
<a href="http://twiki.ipaw.info/bin/view/Challenge">Provenance
Challenge Wiki</a>.</p>

<h2>Workflow representation</h2>

<p>We implement the challenge workflow as a gLite DAG job (<a href="#nutshell">Section</a>). The structure of the DAG follows the specified workflow exactly, using the following mapping:</p>

<ul>
<li>
<p><i>Procedures</i> become nodes of the DAG, which means they are turned into normal gLite jobs during the DAG processing, and they are executed on the Grid computing resources. Besides down- and uploading the data files (see below) each such job involves running the appropriate AIR, FSL, or ImageMagic utility.</p>
</li>
<li>
<p><i>Dependencies</i> among procedures are reflected in dependencies of the DAG. Therefore for example all four <tt>align_warp</tt> invocations can run in parallel but <tt>softmean</tt> must be preceeded by successful completion of all four <tt>reslice</tt> instances.</p>
</li>
<li>
<p><i>Data items</i>, both input and output, are external files. A~unified shared filesystem cannot be assumed on the Grid computing resources, therefore each job is responsible for downloading all its inputs and uploading all its outputs.</p>
</li></ul>

<p>Appendix~A shows a~fragment of the workflow JDL.</p>

<p>For the challenge we put the files on a dedicated GridFTP server and access them (both down- and upload) with the <tt>gsiftp://</tt>
protocol (solving also access control -- a running gLite job possesses delegated user credentials). Consequently, the data items are identified with their full URL in our implementation.</p>

<p>In real world the user might want to use the gLite data services~<cite href="Lau04"/> and identify files with GUID s or logical file names. For our experimental runs this would make the implementation even more complicated while additional features are not important from the challenge point of view (replica management).</p>

<h2 id="trace">Provenance trace</h2>

<p>When the execution of a~workflow is finished, JP can collect traces of the workflow life from various Grid subsystems (<a href="#jpdata">Section</a>). Currently only L&amp;B is instrumented to provide the trace, however, the encompassed data are completely sufficient for the challenge. Therefore the <i>raw representation</i> of the provenance trace is formed by the L&amp;B data uploaded into JP.</p>

<p>However, as discussed in <a href="#data-management">Section</a>, the strength of JP is at the <i>logical level</i>, mapping the gathered data into JP attributes. At this level the provenance trace is formed by attributes of the following classes:</p>

<ol>
<li>
<p>JP system ones (namespace and schema <adresa>http://egee.cesnet.cz/en/Schema/JP/System</adresa>):</p>

<ul>
<li>
<p><tt>jobid</tt>: identifier of the job</p>
</li>
<li>
<p><tt>owner</tt>: identity of the job submitter</p>
</li>
<li>
<p><tt>regtime</tt>: when the job was registered with the middleware</p>
</li></ul>
</li>
<li>
<p>digested from L&amp;B trace, conforming to schema <adresa>http://egee.cesnet.cz/en/Schema/LB/JobRecord</adresa></p>
</li>
<li>
<p>digested from JDL, describing workflow structure (namespace and
schema <adresa>http://egee.cesnet.cz/en/Schema/JP/Workflow</adresa>):</p>

<ul>
<li>
<p><tt>ancestor</tt>: jobid(s) of immediately preceeding job(s) in the workflow</p>
</li>
<li>
<p><tt>successor</tt>: jobid(s) of immediately following job(s) in the workflow</p>
</li></ul>
</li>
<li>
<p>unqualified user tags, logged via L&amp;B (see <a href="#nutshell">Section</a>); they are reported in the namespace <adresa>http://egee.cesnet.cz/en/WSDL/jp-lbtag</adresa></p>
</li></ol>

<p>All the attributes may occur multiple times, for example as <tt>softmean</tt> must have been preceeded by 4~<tt>reslice</tt> s in the challenge workflow, there are 4~occurrences of the <tt>ancestor</tt> attribute of the <tt>softmean</tt> nodes.</p>

<tab id="t:tags" sloupce="ll">

<tr>
<th>Attribute name</th>
<th>Meaning</th>
</tr>

<tr>
<td><tt>IPAW_OUTPUT</tt></td>
<td>names of files generated by this node</td>
</tr>

<tr>
<td><tt>IPAW_INPUT</tt></td>
<td>names of input files for this node</td></tr>

<tr>
<td><tt>IPAW_STAGE</tt></td>
<td>name (number) of workflow stage of this node</td></tr>

<tr>
<td><tt>IPAW_PROGRAM</tt></td>
<td>name of process this node represent</td></tr>

<tr>
<td><tt>IPAW_PARAM</tt></td>
<td>specific parameters of this node processing</td></tr>

<tr>
<td><tt>IPAW_HEADER</tt></td>
<td>named anatomy header (currently used for global maximum only)</td></tr>

<nazev>Specific challenge L&amp;B tags attached to each DAG node</nazev>
</tab>
<p>For the specific purpose of implementing the challenge workflow and
answering the challenge queries we use L&amp;B tags to store additional
information about the workflow nodes. JP turns these values into attributes of
the 4th kind on the list above. <a href="#t:tags">Table</a> summarizes their
meaning, which is self-explanatory with the only eventual exception of
<uv>stage</uv>
-- we consider it to be a~logical portion of the workflow, which may or may not match the number of preceeding nodes in the workflow execution.</p>

<h2>Characteristics of the system and provenance representation</h2>

<p>In this section we comment specifically on the provenance systems classification criteria defined in the context of the first provenance challenge.</p>


<p><b>C1.1 Execution Environment.</b></p>

<p>JP was developed as a~part of gLite middleware and currently it supports gLite jobs, including their support for simple worklflows (based on Condor DAGMan). However, due to the clean distinction between physical data and logical attributes, JP is ready to handle diffenrent environments as long as similar data on workflow execution are available.</p>


<p><b>C1.2 Execution Environment (for the challenge).</b></p>

<p>The execution was done on production EGEE infrastructure (<a href="http://egee.cesnet.cz/en/voce/">VOCE</a> virtual organization), using prototype instances of L&amp;B and JP services.</p>


<p><b>C1.3 Representation Technology.</b></p>

<p>In the permanent storage, files from the execution environment are kept in their native form (plugins are used to parse them), including L&amp;B data, annotations are kept separately, also in files. In the volatile index servers (optimized for queries), data are stored in RDBMS. On the logical level, data are represented as <tt>namespace:name=value</tt> with arbitrarily complex structure of <tt>value</tt>.</p>


<p><b>C1.4 Query Language.</b></p>

<p>SQL-like but strongly restricted -- one logical table, simplified structure of WHERE clause.</p>


<p><b>C1.5 Research Emphasis.</b></p>

<p>Main focus is the balance of <i>storing</i> huge amounts of data and still efficient <i>querying</i>. Some attention is paid to <i>recording</i> jobs trace, <i>execution</i> is out of JP scope itself.</p>


<p><b>C1.6 Challenge Implementation.</b></p>

<p>Full workflow, including the image processing programs, was executed.</p>


<p><b>C2.1 Includes Workflow Representation.</b></p>

<p>The challenge implementation includes an explicit representation (in gLite JDL) and uses it to follow the workflow structure. However, this is not strictly necessary, the structure can be more or less unambiguously deduced from data dependencies.</p>


<p><b>C2.2 Data Derivation vs. Causual Flow of Events.</b></p>

<p>Event flow.</p>


<p><b>C2.3 Annotations.</b></p>

<p>User annotations are considered to be in the scope of provenance and are fully supported in JP.</p>


<p><b>C2.4 Time.</b></p>

<p>Timestamps are included with virtually all data in JP. However, precise timestamping, synchronized clocks etc. are not required for capturing correct provenance records.</p>


<p><b>C2.5 Naming.</b></p>

<p>JP requires to identify jobs uniquely. Data items are not primary entities in JP, therefore their naming is not required by the JP core. In the challenge we identify files (data) with their URL; unique naming of files is required to support data-related queries.</p>


<p><b>C2.6 Tracked data, Granularity.</b></p>

<p>Arbitrary granularity can be handled by JP in general, it depends on what gets stored there. In the challenge, file-level granularity was used.</p>


<p><b>C2.7 Abstraction mechanisms.</b></p>

<p>JP uses a~simple <tt>namespace:name=value</tt> logical-level representation as a~unifying and extensible mechanism of view on any data. However, <tt>value</tt> in this model can be of arbitrary complex XML type.</p>

<h2>Provenance queries</h2>

<tab id="t:matrix" sloupce="ccccccccc">

<tr>
<td>Q1</td>
<td>Q2</td>
<td>Q3</td>
<td>Q4</td>
<td>Q5</td>
<td>Q6</td>
<td>Q7</td>
<td>Q8</td>
<td>Q9</td>
</tr>

<tr>
<td>Y</td>
<td>Y</td>
<td>Y</td>
<td>Y</td>
<td>Y</td>
<td>Y</td>
<td>Y</td>
<td>Y</td>
<td>N</td>
<td>TBI</td>
</tr>

<nazev>Provenance queries matrix row for JP</nazev>
</tab>
<p>In this section we describe details of our implementation of the challenge
queries. <a href="#t:matrix">Table</a> shows JP row of queries matrix -- which
queries were answered successfully during the challenge (TBI means <uv>To Be
Implemented</uv>, query in scope, but not yet implemented; the queries Q1 to Q9 are described in this section). Basic building blocks of the implementation are queries to JP components (details in <a href="#arch">Section</a>):</p>

<ul>
<li>
<p><i>JP Primary Storage</i>: given a~jobid, return specific attributes of the job.</p>
</li>
<li>
<p><i>JP Index Server</i>: find jobs matching criteria expressed with attributes, return specified attributes.</p>
</li></ul>

<p>For JPPS query the only requirement is a~known jobid, any attributes can be
retrieved. On the contrary, both the criteria and the list of required
attributes in JPIS query must match the concrete server configuration. For the
purpose of the challenge we set up a~JPIS with specific configuration
summarized in <a href="#t:isconf">Table</a>. However, setting up such
specialized instance is not a~<uv>demo only</uv> approach. JP architecture assumes
exactly this treatment of JPIS s -- they are volatile, set up and populated with data according to particular user needs.</p>

<tab id="t:isconf" sloupce="lcl">

<tr>
<th>Attribute name</th>
<th>Indexed</th>
<th>Meaning</th>
</tr>

<tr>
<td><tt>jps:jobId</tt></td>
<td>Y</td>
<td>job identification</td>
</tr>

<tr>
<td><tt>jps:owner</tt></td>
<td>Y</td>
<td>job owner, as specified with RegisterJob JPPS operation</td></tr>

<tr>
<td><tt>jps:regtime</tt></td>
<td>N</td>
<td>job registration time</td></tr>

<tr>
<td><tt>jpw:ancestor</tt></td>
<td>Y</td>
<td>ancestor(s) in the job workflow</td></tr>

<tr>
<td><tt>jpw:successor</tt></td>
<td>Y</td>
<td>successor(s) in the job workflow</td></tr>

<tr>
<td><tt>lb:CE</tt></td>
<td>N</td>
<td>where the job is being processed</td></tr>

<tr>
<td><tt>lb:parent</tt></td>
<td>N</td>
<td>jobid of the workflow</td></tr>

<tr>
<td><tt>lb:host</tt></td>
<td>N</td>
<td>worker node where the job is executed</td></tr>

<tr>
<td><tt>lbt:IPAW_PROGRAM</tt></td>
<td>Y</td>
<td></td></tr>

<tr>
<td><tt>lbt:IPAW_HEADER</tt></td>
<td>Y</td>
<td></td></tr>

<tr>
<td><tt>lbt:IPAW_OUTPUT</tt></td>
<td>Y</td>
<td></td></tr>

<tr>
<td><tt>lbt:IPAW_PARAM</tt></td>
<td>Y</td>
<td></td></tr>

<tr>
<td><tt>lbt:IPAW_*</tt></td>
<td>N</td>
<td>all the other tags from <a href="#t:tags">Table</a></td></tr>

<nazev>Configuration of the challenge JPIS. Unlike L&amp;B tags in <a href="#t:tags">Table</a> namespace prefixes are mandatory for JP, shortcuts <tt>jps</tt>, <tt>jpw</tt>, <tt>lb</tt>, and <tt>lbt</tt> refer to namespaces described in <a href="#trace">Section</a></nazev>
</tab>
<p>The queries to JP components are glued together in a~client program. Processing of the query results still requires non-trivial logic (such as graph search) but, on the other hand, it is always done on a~tiny amount of data only, dozens of records typically.</p>

<p>At the time of the challenge there was no sophisticated JP client available. Therefore we implemented the queries in an ad-hoc manner, with Perl scripts wrapping basic CLI clients of both JP services. In this section we use pseudocode in order to describe the functionality, the <a href="http://glite.cvs.cern.ch:8180/cgi-bin/glite.cgi/org.glite.jp.index/examples/pch06/">implementation</a> is available from the authors.</p>

<h3 id="q1">Find the process that led to Atlas X Graphic / everything that caused Atlas X Graphic to be as it is. This should tell us the new brain images from which the averaged atlas was generated, the warping performed etc.</h3>

<dl>
<dt>Inputs:</dt>
<dd>Identifier of the queried graphic file, denoted by its URL, referred to as <tt>Atlas_X_Graphic</tt> further on.</dd>
<dt>Outputs:</dt>
<dd>List of instances of workflow nodes that contributed to the queried file, starting from stage~5 (invocation of <tt>convert</tt>), traced by data dependencies, and ending with stage~1 (<tt>align_warp</tt>). Each entry in the output includes:

<ul>
<li>
<p>jobid of the workflow node</p>
</li>
<li>
<p>identifiers (URL) of the input and output files</p>
</li>
<li>
<p>stage of the workflow, program name and parameter values</p>
</li></ul>
</dd></dl>

<p>Pseudocode of the implementation is shown in Algorithm~1. The implementation uses JPIS query to find the workflow node which produced <tt>Atlas_X_Graphic</tt>. Starting from this node, the workflow dependency graph is searched in a~reversed order (steps 3 6), using value of the <tt>ancestor</tt> attribute retrieved from JPPS repeatedly. Finally the list is sorted and printed. Sample output can be found in Appendix~B.</p>

<p>In this query implementation we trade off performance for readability of the code. All the JPPS queries, which may easily become a bottleneck of the whole system, can be avoided, provided that JPIS configuration includes all the retrieved attributes (it is true for the configuration in <a href="#t:isconf">Table</a>). The queries can be also merged together in order to hit JPIS only once for each job.</p>

<h3>Find the process that led to Atlas X Graphic, excluding everything prior to the averaging of images with softmean.</h3>

<dl>
<dt>Inputs:</dt>
<dd>Identifier of the queried graphic file</dd>
<dt>Outputs:</dt>
<dd>Same as for Query #1 (<a href="#q1">Section</a>)</dd></dl>

<p>The implementation is exactly the same as Query #1 with the only
difference that the graph search (loop 3 7 in Algorithm~1) is terminated also when a~node matching <tt>IPAW_PROGRAM = 'softmean'</tt> is found.</p>

<h3>Find the Stage 3, 4 and 5 details of the process that led to Atlas X Graphic.</h3>

<dl>
<dt>Inputs:</dt>
<dd>Identifier of the queried graphic file</dd>
<dt>Outputs:</dt>
<dd>Same as for Query #1 (<a href="#q1">Section</a>)</dd></dl>

<p>Exactly the same as Query #1, with the final output filtered to contain only jobs having <tt>IPAW_STAGE</tt> equal to one of 3, 4, 5. Such implementation is not optimal but more general, we do not impose any special semantics on the value of the <tt>IPAW_STAGE</tt> attribute. With the additional knowledge that a node is preceeded in the workflow only with nodes of lower stage number, the search could be cut at <tt>IPAW_STAGE = 3</tt>, similarly to Query #2.</p>

<h3>Find all invocations of procedure <tt>align_warp</tt> using a~twelfth order
nonlinear 1365 parameter model (see model menu describing possible values of
parameter <uv>-m~12</uv> of <tt>align_warp</tt>) that ran on a Monday.</h3>

<dl>
<dt>Inputs:</dt>
<dd>N/A</dd>
<dt>Outputs:</dt>
<dd>Time, stage, program name, inputs, outputs of the matching workflow nodes</dd></dl>

<p>JPIS is queried for jobs matching <tt>IPAW_PROGRAM = 'align_warp'</tt> and <tt>IPAW_PARAM = '-m 12'</tt>. Among the other attributes the job registration time is also retrieved, and the output filtered to jobs that run on Monday.</p>

<p>Job registration time, i.e. the submission time, is only an approximation of running time (the job may have spent long time in a~queue). The actual job run time is available in the LB trace, though the current JP implementation cannot extract it yet. Therefore this is a~technical only, not principal restriction.</p>

<p>The filter <uv>ran on Monday</uv> is quite challenging. Currently, we implement it
at the client side which is not a~scalable solution -- the number of retrieved records can grow unacceptably. However, we are working on a~<i>type plugin</i> concept that extends JPIS data processing capabilities in order to allow efficient implementation of similar queries.</p>

<p><b>Algorithm 1</b> Pseudocode of Query #1</p>

<ol>
<li>JPIS query: find jobid of job having <tt>lbt:IPAW_OUTPUT =
'Atlas_X_Graphic'</tt></li>
<li>initialize <tt>job_list</tt> with the retrieved jobid</li>
<li><b>while</b> there are unprocessed elements in <tt>job_list</tt>
<b>do</b></li>
<li>~~pick an unprocessed element <tt>job</tt></li>
<li>~~JPSS query: for <tt>job</tt> retrieve all values of
<tt>lbw:ancestor</tt><br/>~~~~~~and insert each one into
<tt>job_list</tt> unless it is already there</li>
<li><b>end while</b></li>
<li>JPPS query: for each job in <tt>job_list</tt> retrieve values of
attributes:<br/>~~~~~~<tt>lbt:IPAW_INPUT</tt>,
<tt>lbt:IPAW_OUTPUT</tt>,<br/>~~~~~~<tt>lbt:IPAW_PROGRAM</tt>,
<tt>lbt:IPAW_PARAM</tt>, <tt>lbt:IPAW_STAGE</tt></li>
<li>sort <tt>job_list</tt> according to <tt>lbt:IPAW_STAGE</tt></li>
<li>pretty-print <tt>job_list</tt>, including all the retrieved attributes</li>
</ol>

<h3>Find all Atlas Graphic images outputted from workflows where at least one of the input Anatomy Headers had an entry <tt>global_maximum = 4095</tt>.</h3>

<p></p>

<dl>
<dt>Inputs:</dt>
<dd>N/A</dd>
<dt>Outputs:</dt>
<dd>List of Atlas Graphic files matching the query</dd></dl>

<p>JPIS is queried for jobs matching <tt>IPAW_HEADER = 'global_maximum 4095'</tt> (and <tt>IPAW_PROGRAM = 'align_warp'</tt> eventually). The results of the query (jobid s of the matching jobs) are used to seed a graph search similar to Query #1 (<a href="#q1">Section</a>) but following the <tt>successor</tt> attribute of workflow nodes rather than <tt>ancestor</tt>. The output files of nodes having <tt>IPAW_STAGE = 5</tt> are gathered and sorted to exclude multiple occurrences.</p>

<p>An expression <tt>IPAW_PROGRAM = 'convert'</tt> can be used instead of <tt>IPAW_STAGE = 5</tt> as a~condition identifying the final output files. Alternatively, they can be identified as outputs of nodes which have no successors.</p>

<p>The code can be also easily modified to record the graph traversal (details on workflow nodes) leading to a~particular file, and display it with the file in a~similar way as in previous queries.</p>

<h3>Find all output averaged images of softmean (average) procedures, where the
warped images taken as input were <tt>align_warped</tt> using a~twelfth order
nonlinear 1365 parameter model, i.e. <uv>where <tt>softmean</tt> was preceded in
the workflow, directly or indirectly, by an <tt>align_warp</tt> procedure with
argument <tt>-m 12</tt></uv>.</h3>

<dl>
<dt>Inputs:</dt>
<dd>N/A</dd>
<dt>Outputs:</dt>
<dd>List of identifiers (URL s) of direct outputs of <tt>softmean</tt> invocations in workflows matching the query</dd></dl>

<p>JPIS is queried to retrieve <tt>IPAW_PROGRAM = 'align_warp'</tt> jobs having <tt>IPAW_PARAM = '-m 12'</tt>. The result is used to seed graph search, following the <tt>successor</tt> attribute. The search is cut at <tt>IPAW_PROGRAM = 'softmean'</tt>, and its outputs are printed.</p>

<h3>A user has run the workflow twice, in the second instance replacing each procedures (<tt>convert</tt>) in the final stage with two procedures: <tt>pgmtoppm</tt>, then <tt>pnmtojpeg</tt>. Find the differences between the two workflow runs.</h3>

<dl>
<dt>Inputs:</dt>
<dd>Identifier of the queried graphic file</dd>
<dt>Outputs:</dt>
<dd>Formatted in the same way as for Query #1, while the different workflow nodes are displayed.</dd></dl>

<p>We use Query #1 implementation to show details of the workflows. Then the
differences are apparent -- there is one more stage of the workflow, and <tt>IPAW_PROGRAM</tt> attribute values of the two final stages are <tt>pgmtoppm</tt> and <tt>pnmtojpeg</tt> respectively.</p>

<p>This is a~slightly poor-man approach. It should be complemented with generating a~graph representation of the result (all the information is present there) and feeding it into some graph comparison tools. However, this is processing that is out of scope of JP. Therefore we consider this query to be addressed only partially.</p>

<h3>A user has annotated some anatomy images with a key-value pair <tt>center = UChicago</tt>. Find the outputs of <tt>align_warp</tt> where the inputs are annotated with <tt>center = UChicago</tt>.</h3>

<p>Job Provenance gathers and organizes information with the grid job being a primary entity of interest. Despite annotations of a~<i>job</i> are its intrinsic part, direct annotations of <i>data</i> are not, therefore this query can t be answered in a~reasonable way. This topic is discussed further in <a href="#dataprov">Section</a>.</p>

<h3 id="query9">A user has annotated some atlas graphics with key-value pair where the key is <tt>studyModality</tt>. Find all the graphical atlas sets that have metadata annotation <tt>studyModality</tt> with values <tt>speech</tt>, <tt>visual</tt> or <tt>audio</tt>, and return all other annotations to these files.</h3>

<dl>
<dt>Inputs:</dt>
<dd>Value of the <tt>studyModality</tt> annotation</dd>
<dt>Outputs:</dt>
<dd>List of matching graphics files, together with their additional annotations.</dd></dl>

<p>As mentioned with Query #8, JP does not provide means of adding
annotations to data directly. However, annotations can be added to
jobs (via JPPS interface) and it makes good sense to consider job
outputs to be annotated with the job annotations too (see <a
href="#dataprov">Section</a>). We assume the annotations to be
assigned to whole workflows (not its subjobs) in the form of JP
attributes in a dedicated namespace, see
<adresa>http://twiki.ipaw.info/Challenge/CESNET/Annotations</adresa>
(referred to as <tt>annot</tt> further on). Then the implementation is
a~two stage query shown in Algorithm~2.</p>

<p><b>Algorithm~2</b> Pseudocode of Query #9</p>

<ol>
  <li>JPIS: find jobs (workflows) having <tt>annot:studyModality</tt>
  = <i>input value</i></li>
  <li><b>for</b> each found workflow <b>do</b></li>
  <li>~~JPIS query: find jobs where <tt>lb:parent = wf</tt> and <tt>lbt:IPAW_STAGE = 5</tt></li>
  <li>~~JPPS query: retrieve <tt>lbt:IPAW_OUTPUT</tt> and other
  annotations for the jobs</li>
  <li><b>end for</b></li>
</ol>

<p>Currently neither JPPS nor JPIS supports a~query <uv>all attributes of this
job</uv>. If the annotation names are not known a~priori, the following approaches are possible:</p>

<ul>
<li>
<p>A simple workaround is storing all annotations in a~similar way as <tt>IPAW_HEADER</tt> tag, in an attribute holding both annotation name and value. However, this approach would not allow more complex queries on the annotation values.</p>
</li>
<li>
<p>A better workaround is attaching a~known <tt>Annotation</tt> attribute to each job. This attribute would hold names of all existing annotations for this job. The user would first query for values of this attribute, and then choose which real annotations (JP attributes) to retrieve.</p>
</li>
<li>
<p>Extending JPPS query interface to support queries like <uv>all attributes of
this job falling into namespace X</uv>.</p>
</li></ul>

<h1>Lessons learned</h1>

<h2 id="lesson-workflow">Workflow representation</h2>

<p>Recent development in the field of provenance puts clear emphasis in workflow processing, which can be clearly seen in the program of the IPAW 06 workshop~<cite href="MF06"/> as well as in the specification of the current Provenance Challenge.</p>

<p>When JP was originally designed as a~part of the gLite middleware, compound jobs (DAGs) were supported in gLite but their real usage was marginal. Therefore the current JP design does not include any explicit concept reflecting compound jobs.</p>

<p>However, provenance trace of a~DAG job in gLite contains sufficient information to reconstruct the workflow structure:</p>

<ul>
<li>
<p><i>Workflow components</i>: JDL of a~submitted DAG (see Appendix~A) contains <tt>nodes</tt> ClassAd attribute which is a~list of nested JDL s of all the DAG subjobs. These are identified with their internal JDL names (<tt>align1</tt> etc. in the example). During the DAG processing global jobids are assigned to the subjobs, and added to the subjob JDL s as their <tt>edg_jobid</tt> ClassAd attributes. Then the augmented DAG JDL is logged into L&amp;B.</p>
</li>
<li>
<p><i>Dependencies among the subjobs</i>: DAG JDL also contains <tt>dependencies</tt> attribute, a~list of pairs of node names expressing dependencies among them.</p>
</li>
<li>
<p><i>Membership in a~workflow</i>: When a~DAG with its subjobs is registered
in L&amp;B, the information <uv>I belong to this DAG</uv> is recorded for each subjob in its <tt>parent</tt> L&amp;B attribute.</p>
</li></ul>

<p>As complete L&amp;B data are uploaded to JP, this information is available,
allowing complete reconstruction of a~DAG structure from JP data. However, most
of the information is hidden rather deeply -- contained in a~specific L&amp;B job attribute (JDL) which has rather complex structure itself. Therefore accessing the information via JP interface is not straightforward. In the following we discuss possible approaches to overcome this difficulty.</p>

<p>During the challenge implementation we defined the <tt>ancestor</tt> and <tt>successor</tt> attributes (<a href="#trace">Section</a>) to describe the workflow structure in JP view of data more directly as well as to allow efficient implementation of its traversal (search). So far we generate values of these attributes semi-manually via an external utility. Given jobid of a~DAG, the utility retrieves the appropriate DAG JDL from JPPS, parses its structure, extracts the mapping of internal names to jobids, and according to the <tt>dependencies</tt> list it stores the <tt>ancestor</tt> and <tt>successor</tt> values for each node back into JPPS as user annotations.</p>

<p>In this scenario, JP raw data on <i>one job</i>, the DAG, provide JP attributes of <i>other jobs</i>, the DAG nodes. Unfortunately, this way of processing does not fit into the current JP design where jobs are treated autonomously, a~job raw data generate JP attributes of this job only.</p>

<p>Participation in the challenge showed this design drawback and motivated its ongoing revision. The following options are being considered:</p>

<ul>
<li>
<p><i>Introduce the concept of compound job into JP.</i> Despite being quite straightforward, this approach goes somewhat against the original JP concepts, namely its generality and independence on the data content. JP itself was meant to define as few requirements on the job data as possible, leaving all the logic to job type specific plugins. On the contrary, whatever general compound job model we adopted, it would necessarily impose some restrictions that would appear at the JP level, not specifically for a~certain job type.</p>
</li>
<li>
<p><i>Allow loopback query in JPPS.</i> In order to retrieve values of <tt>ancestor</tt>, <tt>succcessor</tt> or similar attributes for a~job, JPPS would allow the specific job type plugin to query JPPS for attribute of another job (JDL of the DAG) and process it appropriately (the logic of the current external utility). This approach seems to be cleaner from the JP design point of view, however, it may imply non-trivial technical complications, namely in performance area.</p>
</li></ul>

<p>Both these options are tentative, we have no finalized solution yet. In either case, the emerging discussion clearly demonstrates the contribution of the provenance challenge to our activity.</p>

<h2 id="dataprov">Data vs. process provenance</h2>

<p>Job Provenance is job centric, it is focused on process view on the
provenance problems. The computation (Grid job) is the primary subject about
which provenance metadata is collected, not the results of the computation.
Apparently, this is a~different approach from many other provenance systems
(see <a href="#related">Section</a>) that deal primary with data, not
processes. Reasons for this difference can be found in the original design
requirements -- JP was designed to record information on jobs, not data.</p>

<p>EU <a href="http://twiki.gridprovenance.org/bin/view/Provenance/ProjectInformation">Provenance project</a> broadly defines <i>the provenance of a piece of data is the process that led to the data</i>. Within this view, recording a~clear relationship between a~piece of data (job output) and the process that led to this data (details on the grid job, stored as its JP record) should be sufficient to provide provenance of the data too. In our representation of the challenge workflow the relationship is recorded in the <tt>IPAW_OUTPUT</tt> job attribute.</p>

<p>Formulation of the challenge queries strongly suggests a~data oriented approach. However, we can further classify both the queries and their solution in JP as follows:</p>

<ul>
<li>
<p>#1 3 and #7 lead to a~JP search of concrete value (the Atlas X Graphics file name) of <tt>IPAW_OUTPUT</tt>, retrieving details on the workflow execution then. Therefore we can treat them as process-related. As discussed above, the recorded relationship of a~job and its output is the necessary glue that allows queries originally formulated as data-related to be served by JP.</p>
</li>
<li>
<p>#5 and #6 search for job outputs satisfying conditions on a~process
parameter (<uv><tt>-m~12</tt></uv> in #6) or data feature which is computed during the process (<tt>global_maximum</tt> in #5), both being an attribute of the processes. Therefore they are again process-related, despite the main result of the query is a~list of output file names representing data items.</p>
</li>
<li>
<p>#8 and #9 query on data annotations, therefore being data-related. As discussed in <a href="#query9">Section</a> it makes sense to understand process annotations to be also annotations of its outputs, therefore #9 can be solved by JP. On the contrary, #8 refers to input annotations which can t be directly handled by JP.</p>
</li></ul>

<p>To sum up, a~fairly straightforward solutions of almost all the challenge queries show that the data-oriented queries can be mapped into JP quite easily, provided that the necessary relationship to inputs and outputs is recorded with the jobs. The only unsolved query is specific in the sense that there is no processing involved. This kind of queries falls beyond a~feasible scope of JP, unless artificial processes are introduced.</p>

<h2>Semantics interpretation levels</h2>

<p>In <a href="#lesson-workflow">Section</a> we describe introduction of the <tt>ancestor</tt> and <tt>successor</tt> attributes. However, agreement on this approach was not straightforward, we discussed an alternate solution of keeping the whole logic of parsing JDL and extracting the required information in the client program which implements the challenge queries.</p>

<p>These discussions document certain underestimation of the importance to define strictly the levels where the <i>semantics of JP data</i> is interpreted. In general, the level defines where JP attributes (the logical view, <a href="#data-representation">Section</a>) are extracted from the raw data (if it is done at all for a~particular piece of the raw data). We identify three such levels:</p>

<ul>
<li>
<p><i>JP intrinsic</i> interpretation level should be kept as minimal and as fixed as possible. JP itself is aware of a~job as the primary entity, its minimal metadata kept by JPPS (currently owner and registration time), and files attached to the job. Foreseen extensions are sharing files among jobs (it may be desirable for example in case of workflow sandboxes), or some reflection of the compound jobs structure (see discussion in <a href="#lesson-workflow">Section</a>).</p>

<p>No further assumptions on the data semantics are done at this level, especially in relation to the content of the files.</p>
</li>
<li>
<p><i>Job type</i> interpretation level is specific to for example particular Grid middleware (currently gLite), it should understand structure and processing of this job type, however, it should not deal with the user payload of the jobs.</p>

<p>For example, parsing and processing the L&amp;B data (yielding the set of appropriate attributes) including JDL parsing, and extracting file names from uploaded gLite job sandboxes belongs to this level. It is desirable to implement this interpretation in terms of JP plugins in order to shield the user or other application from this data interpretation (which may be non-trivial).</p>

<p>In our discussions on the workflow structure we also concluded that extracting it from the gLite JDL belongs to this level.</p>
</li>
<li>
<p><i>Application or user specific</i> level is related to the job payload. In the challenge, example of this level is the specific treatment of <tt>IPAW_*</tt> tags.</p>

<p>This level may be left to client programs (as done in the challenge). Alternatively, it can be implemented as application-specific JP plugins (typically to extract specific attributes from some sandbox file) to serve the needs of a~bigger user community.</p>
</li></ul>

<p>Despite being aware of this classification before, the challenge showed that boundaries between these levels tend to be rather vague and subjective. Therefore making clear design decision with each type of job is critical. On the other hand, it was exactly the broad scale of the semantics interpretation levels that allowed process-oriented JP to handle data-related queries in a~fairly straightforward way.</p>

<p>In addition, solving these problems motivated a~design of <i>plugin chaining</i>, an extension to the existing JP plugin mechanism. In order to retrieve a~value of a particular attribute (some JDL field for example) JP should call a~specific plugin (ClassAd parser), which calls another plugin (L&amp;B) in turn to retrieve another attribute (the JDL) from the raw data file. In the time of writing this manuscript development of prototype implementation is in progress.</p>

<h1 id="related">Related work</h1>

<p>JP uses middleware components capable to automatically create basic provenance data from captured internal events of workload management and data references of Grid jobs. This approach minimizes adaptations required in applications and middleware. It is best focused on process level of provenance, the computation (Grid job) is the primary subject about which provenance metadata is collected, not the inputs or results of the computation. On the other hand, using the references to inputs and outputs of jobs and generic extensibility and annotation features, the JP could be queried to provide provenance on the data level (related to data files or other results). However, thus provided information may be incomplete in principle, as JP is not deeply integrated with data storage.</p>

<p>Number of systems proposed have taken radically different approach by
tightly integrating exhaustive provenance tracking in workflow execution
environments or application frameworks. Some of them are oriented towards
relatively straightforward extensions to a workflow enactment engine so it can
capture basic provenance data automatically during workflow runtime (e.g.~<cite
href="BD07"/>), others strive to cater for analysis combining origin and domain
knowledge about workflow design, execution, interpretation~<cite
href="Zha07"/>. Yet another set of models concentrates on efficient handling of
specific types of workflows~<cite href="BML07"/>. It is definitely possible to
collect much more complete provenance records this way, especially when data
storage is also embedded in or tightly controlled by the workflow system.
However, there are considerable disadvantages too, especially very limited
support for <uv>legacy</uv> scripted application workflows and a~proneness to creation of too large amounts of provenance data that may be unfeasible to handle when vast number of jobs on a large scale Grid has to be tracked.</p>

<p>The basic idea behind collection part of JP -- automatic creation of
persistent logs of the work done (combination of high level observed and
disclosed provenance approaches) -- is similar to principles of <tt>CODESH</tt> project~<cite href="Bou06"/>. However, <tt>CODESH</tt> is oriented to interactive work (virtual sessions), while our system is heavily biased towards storing and searching provenance data on vast amounts of batch jobs in Grid environment in an efficient way. Another system which is generic and simple similarly to ours is Karma Provenance Framework~<cite href="Sim06"/>.</p>

<p>In~<cite href="Bra06"/>, more fine-grained observed provenance approach is taken at operating system level and associated challenges related to data granularity, overheads, and irrelevant provenance data pruning are discussed. Associated query model is discussed in~<cite href="Sel07"/>.</p>

<h1>Conclusions</h1>

<p>The name <i>First Provenance Challenge</i> turned to have a~very literal meaning for our team. It was the first opportunity to compare the capabilities of Job Provenance with other provenance systems, and it became particularly challenging due to its emphasis in fields that were not our original design priorities.</p>

<p>Virtually all the challenge queries are related to the provenance of data, while JP is strongly process (job) oriented. However, we managed to find a~suitable representation of the challenge workflow so that most of the queries can be mapped to JP in a~reasonable and straightforward way. Eight out of nine queries were solved; the remaining one clearly identifies the area of pure data annotation with no involved processing which falls beyond a~feasible scope of JP.</p>

<p>Solving the challenge also identified certain JP design drawbacks, namely the lack of explicit support for compound jobs (workflows), and it initiated their reconsideration. Other extensions to the design (loopback query and plugin chaining) also emerge directly from the challenge requirements.</p>

<p>Altogether we consider the participation in the First Provenance Challenge successful, proving that the intended generality of JP can be leveraged even in its not-directly-foreseen applications.</p>

<h1>Acknowledgment</h1>

<p>This work was done within the EGEE-II project funded by the European Union, INFSO-RI-031688.</p>

<h1>Appendix. Fragment of workflow JDL</h1>

<p>The strings <tt>BASEx</tt>, <tt>REFERENCE</tt>, and <tt>ATLAS</tt> are placeholders for real file names (URL s).</p>

<blockquote><pre>
[
    type = "dag";
    nodes = [
        align1 = [ description = [
            executable = "align.sh";
            arguments = "BASE1 REFERENCE";
        ] ];
        align2 = [ description = [
            executable = "align.sh";
            arguments = "BASE2 REFERENCE";
        ] ];
...
        softmean = [ description = [
            executable = "softmean.sh";
            arguments = "BASE1 BASE2 BASE3 BASE4 ATLAS";
        ] ];
...
    ];
    dependencies = {
        { align1, reslice1 },
        ...
        { { reslice1, reslice2, reslice3, reslice4 }, softmean },
        ...
    };
...
]
</pre></blockquote>

<h1 id="a-1224639604">Appendix. Query #1 sample output</h1>
 
<blockquote><pre>
$ ./query1.pl gsiftp://umbar.ics.muni.cz:1414/home/mulac/pch06/blabla-x.gif 2&gt;/dev/null
Results
=======

jobid https://skurut1.cesnet.cz:9000/hvkpZCsRsiqrxs5K_bo7Ew:
  attr IPAW_STAGE: 5
  attr IPAW_PROGRAM: convert
  attr IPAW_INPUT: gsiftp://umbar.ics.muni.cz:1414/home/mulac/pch06/blabla-x.pgm
  attr IPAW_OUTPUT: gsiftp://umbar.ics.muni.cz:1414/home/mulac/pch06/blabla-x.gif
  attr CE: skurut17.cesnet.cz:2119/jobmanager-lcgpbs-voce

jobid https://skurut1.cesnet.cz:9000/02ZaAADKyebzggYPp4M9tA:
  attr IPAW_STAGE: 4
  attr IPAW_PROGRAM: slicer
  attr IPAW_INPUT: gsiftp://umbar.ics.muni.cz:1414/home/mulac/pch06/blabla.hdr
                   gsiftp://umbar.ics.muni.cz:1414/home/mulac/pch06/blabla.img
  attr IPAW_OUTPUT: gsiftp://umbar.ics.muni.cz:1414/home/mulac/pch06/blabla-x.pgm
  attr CE: skurut17.cesnet.cz:2119/jobmanager-lcgpbs-voce

jobid https://skurut1.cesnet.cz:9000/wGMnTvCILtiSTi7ZOQwfTQ:
  attr IPAW_STAGE: 3
  attr IPAW_PROGRAM: softmean
  attr IPAW_INPUT: gsiftp://umbar.ics.muni.cz:1414/home/mulac/pch06/anatomy1-resliced.img
                   ...
  attr IPAW_OUTPUT: gsiftp://umbar.ics.muni.cz:1414/home/mulac/pch06/blabla.img
                    gsiftp://umbar.ics.muni.cz:1414/home/mulac/pch06/blabla.hdr
  attr CE: skurut17.cesnet.cz:2119/jobmanager-lcgpbs-voce

jobid https://skurut1.cesnet.cz:9000/9d0XMwfPuefR9woAFkDplQ:
  attr IPAW_STAGE: 2
  attr IPAW_PROGRAM: reslice
  attr IPAW_INPUT: gsiftp://umbar.ics.muni.cz:1414/home/mulac/pch06/anatomy3.warp
                   ...
  attr IPAW_OUTPUT: gsiftp://umbar.ics.muni.cz:1414/home/mulac/pch06/anatomy3-resliced.img
                    ...
  attr CE: skurut17.cesnet.cz:2119/jobmanager-lcgpbs-voce

jobid https://skurut1.cesnet.cz:9000/RglBtUz0IzwSeM32KLnHPg:
  attr IPAW_STAGE: 2
  attr IPAW_PROGRAM: reslice
  attr IPAW_INPUT: gsiftp://umbar.ics.muni.cz:1414/home/mulac/pch06/anatomy4.warp
                   ...
  ...

jobid https://skurut1.cesnet.cz:9000/wdWQHL0-RXkd3VeNcSrTaw:
  attr IPAW_STAGE: 2
  attr IPAW_PROGRAM: reslice
  attr IPAW_PARAM:
  attr IPAW_INPUT: gsiftp://umbar.ics.muni.cz:1414/home/mulac/pch06/anatomy1.warp
                   ...
  ...

jobid https://skurut1.cesnet.cz:9000/xwIsN2JgGfsRuvYwh0QXsw:
  attr IPAW_STAGE: 2
  attr IPAW_PROGRAM: reslice
  attr IPAW_INPUT: gsiftp://umbar.ics.muni.cz:1414/home/mulac/pch06/anatomy2.warp
                   ...
  ...

jobid https://skurut1.cesnet.cz:9000/yM3sz8v6WCIPgi5-0m8L4w:
  attr IPAW_STAGE: 1
  attr IPAW_PROGRAM: align_warp
  attr IPAW_PARAM: -m 12, -q
  attr IPAW_INPUT: gsiftp://umbar.ics.muni.cz:1414/home/mulac/pch06/anatomy4.img
                   gsiftp://umbar.ics.muni.cz:1414/home/mulac/pch06/reference.img
  attr IPAW_OUTPUT: gsiftp://umbar.ics.muni.cz:1414/home/mulac/pch06/anatomy4.warp
  attr CE: skurut17.cesnet.cz:2119/jobmanager-lcgpbs-voce

jobid https://skurut1.cesnet.cz:9000/s47ihjBHQXqPkkNwA2iazg:
  attr IPAW_STAGE: 1
  attr IPAW_PROGRAM: align_warp
  attr IPAW_PARAM: -m 12, -q
  attr IPAW_INPUT: gsiftp://umbar.ics.muni.cz:1414/home/mulac/pch06/anatomy2.img
                   ...
  ...

...
</pre></blockquote>
 
<seznamknih>

<kniha id="BD07">Barga R.~S. and Digiampietri L.~A.: Automatic capture
and efficient storage of escience experiment
provenance. <i>Concurrency and Computation: Practice and
Experience</i>, 2007.</kniha>

<kniha id="Bou06">Bourilkov D. et al. Virtual logbooks and
collaboration in science and software development. In: Moreau L. and
Foster I. (editors), <i>International Provenance and Annotation
Workshop (IPAW 06), Chicago</i>, volume 4145 of <i>Lecture Notes in
Computer Science</i>. Springer, 2006. </kniha>

<kniha id="BML07">Bowers S., McPhillips T. and Ludaescher B.: A
provenance model for collection-oriented scientific
workflows. <i>Concurrency and Computation: Practice and
Experience</i>, 2007. </kniha>

<kniha id="Bra06">Braun U. et al.: Issues in automatic provenance
collection. In: Moreau L. and Foster I. (editors), <i>International
Provenance and Annotation Workshop (IPAW 06), Chicago</i>, volume 4145
of <i>Lecture Notes in Computer Science</i>. Springer, 2006.</kniha>

<kniha id="JPUG06">CESNET: <i>gLite job provenance service
user s guide.</i>. Available <a href="http://egee.cesnet.cz/en/JRA1/">online</a>.</kniha>

<kniha id="Dvo06">Dvořák F. et al.: gLite job provenance. In: Moreau L. and
Foster I. (editors), <i>International Provenance and Annotation
Workshop (IPAW 06), Chicago</i>, volume 4145 of <i>Lecture Notes in
Computer Science</i>. Springer, 2006.</kniha>

<kniha id="EGEE04">EGEE Project: <i>EGEE Middleware Design Release
1.</i> Deliverable <a href="https://edms.cern.ch/document/487871/">EGEE-DJRA1.2</a>, 2004.</kniha>

<kniha id="Ave03">Avellino G. et al.: The first deployment of workload
management services on the EU DataGrid testbed: feedback on design and
implementation. In: <i>Computing in High Energy and Nuclear Physics
(CHEP03)</i>, La Jolla, CA, March 2003.</kniha>

<kniha id="Kou04">Kouřil D. et~al. Distributed tracking, storage, and
re-use of job state information on the grid.In: <i>Computing in High
Energy and Nuclear Physics (CHEP04)</i>, 2004. </kniha>

<kniha id="Lau04">Laure E. et al.: Middleware for the next generation
grid infrastructure. In: <i>Computing in High Energy Physics and
Nuclear Physics (CHEP 2004)</i>, 2004. </kniha>

<kniha id="Mat07">Matyska L. et~al.: <i>Job tracking on a grid the Logging and Bookkeeping and Job Provenance services.</i> In preparation.</kniha>

<kniha id="MF06">Moreau L. and Foster I. (editors): <i>International Provenance and Annotation Workshop (IPAW 06), Chicago</i>, volume 4145 of <i>Lecture Notes in Computer Science</i>. Springer, 2006. </kniha>

<kniha id="Pac06">Pacini F. et~al.: Job description language
attributes specification. EGEE Project, 2006. Available <a
href="https://edms.cern.ch/file/590869/1/EGEE-JRA1-TEC-590869-JDL-Attributes-v0-8.pdf">online</a>.</kniha>

<kniha id="Pet07">Petřek M. et~al.: Multiple ligand trajectory docking
-- a case study of complex grid jobs management. Accepted for <i>EGEE
User Forum</i>, 2007. </kniha>

<kniha id="RLS98">Raman R., Livny M. and Solomon M.: Matchmaking:
Distributed resource management for high throughput
computing. <i>Proceedings of the Seventh IEEE International Symposium
on High Performance Distributed Computing</i>, 1998.</kniha>

<kniha id="Sel07">Seltzer M. et al.: Pass-ing the provenance
challenge. <i>Concurrency and Computation: Practice and
Experience</i>, 2007. </kniha>

<kniha id="Sim06">Simmhan Y.~L. et al.: Performance evaluation of the karma provenance framework for scientific workflows. In: Moreau L. and
Foster I. (editors), <i>International Provenance and Annotation
Workshop (IPAW 06), Chicago</i>, volume 4145 of <i>Lecture Notes in
Computer Science</i>. Springer, 2006.</kniha>

<kniha id="Zha07">Zhao J. et al.: Mining taverna s semantic web of
provenance. <i>Concurrency and Computation: Practice and
Experience</i>, 2007.</kniha>

</seznamknih>


</zprava>

