Project description

The noWorkflow project aims at allowing scientists to benefit from
provenance data analysis even when they don’t use a workflow system.
Also, the goal is to allow them to avoid using naming conventions to
store files originated in previous executions. Currently, when this is
not done, the result and intermediate files are overwritten by every new
execution of the pipeline.

noWorkflow was developed in Python and it currently is able to capture
provenance of Python scripts using Software Engineering techniques such
as abstract syntax tree (AST) analysis, reflection, and profiling, to
collect provenance without the need of a version control system or any
other environment.

Each new run produces a different trial that will be stored with a
sequential identification number in the relational database.

Verifying the module dependencies is a time consuming step, and
scientists can bypass this step by using the -b flag if they know that
no library or source code has changed. The current trial then inherits
the module dependencies of the previous one.

It is possible to collect more information than what is collected by
default, such as variable usages and dependencias. To perform a dynamic
program slicing and capture those information, just run

now run -e Tracer simulation.py data1.dat data2.dat

To list all trials, just run

now list

Assuming we run the experiment again and then run , the output would be
as follows.

This command has several options, such as -m to show module
dependencies; -d to show function definitions; -e to show the
environment context; -a to show function activations; and -f to show
file accesses.

Running

now show -a 1

would show details of trial 1. Notice that the function name is preceded
by the line number where the call was activated.

By default, the checkout command only restores the script used for the
trial (“simulation.py”), even when it has imports and read files as
input. Use the option “-l” to restore imported modules and the option
“-i” to restore input files. The checkout command track the evolution
history. By default, subsequent trials are based on the previous Trial
(e.g. Trial 2 is based on Trial 1). When you checkout a Trial, the next
Trial will be based on the checked out Trial (e.g. Trial 3 based on
Trial 1).

The remaining options of noWorkflow are diff, export and vis. The
diff option compares two trials, and the export option exports
provenance data of a given trial to Prolog facts, so inference queries
can be run over the database.

The visualization tool shows the evolotion history, the trial
information, an activation graph. It is also possible to compare
different trials in the visualization tool.

The visualization tool requires Flask to be installed. To install Flask,
you can run

$ pip install flask

IPython Interface

Another way to run, visualize, and query trials is to use IPython
notebook. To install IPython notebook, you can run

$ pip install ipython[all]

Then, to run ipython notebook, go to the project directory and execute:

$ ipython notebook

It will start a local webserver where you can create notebooks and run
python code.

Before loading anything related to noworkflow on a notebook, you must
initialize it:

In[1]:%load_extnoworkflow...:importnoworkflow.now.ipythonasnip

It is equivalent to:

In[1]:%load_extnoworkflow...:nip=%now_ip

After that, you can either run a new trial or load an existing object
(History,Trial,Diff).

There are two ways to run a new trial: 1- Load an external file

In[1]:arg=6In[2]:trial=%nowscript1.py$arg...:trialOut[2]:<Trial5># Loads the trial object represented as a graph

2- Load the code inside a cell

In[3]:%%now--namescript2--out=out_var$arg...:importsys...:l=range(sys.argv[1])...:c=sum(l)...:print(c)6Out[3]:<Trial6># Loads the trial object represented as a graphIn[4]:out_varOut[4]:"6\n"

Both modes supports all the now run parameters It is worth noticing
that the noworkflow cannot access ipython variables and ipython cannot
access noworkflow variables. To workaround this limitation, it is
necessary to pass arguments to the program and parse the output. Pickle
may be a good solution for serializing complex objects

Included Software

Acknowledgements

We would like to thank JetBrains for providing us a license for PyCharm.
We also want to thank CNPq, FAPERJ, and the National Science Foundation
(CNS-1229185, CNS-1153503, IIS-1142013) for partially supporting this
work.

License Terms

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
“Software”), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.