Skip to content

Commit 0366f00

Browse files
Merge pull request #151 from wfcommons/documentation
Documentation improvement
2 parents 97fc507 + f0a4e70 commit 0366f00

2 files changed

Lines changed: 71 additions & 11 deletions

File tree

docs/source/analyzing_instances.rst

Lines changed: 54 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -68,28 +68,34 @@ method.
6868
Supported log parsers
6969
+++++++++++++++++++++
7070

71-
- :class:`~wfcommons.wfinstances.logs.pegasusrec.HierarchicalPegasusLogsParser`
7271
- :class:`~wfcommons.wfinstances.logs.makeflow.MakeflowLogsParser`
7372
- :class:`~wfcommons.wfinstances.logs.nextflow.NextflowLogsParser`
7473
- :class:`~wfcommons.wfinstances.logs.pegasus.PegasusLogsParser`
74+
- :class:`~wfcommons.wfinstances.logs.snakemake.SnakemakeLogsParser`
75+
- :class:`~wfcommons.wfinstances.logs.ro_create.ROCrateLogsParser`
7576
- :class:`~wfcommons.wfinstances.logs.taskvine.TaskVineLogsParser`
7677

7778
Examples
7879
++++++++
7980

80-
Hierarchical Pegasus
81-
++++++++++++++++++++
81+
Below we give basic examples for using the log parsers. Review the specific documentation
82+
of each log parser for more details, such as additional parameters that configure the behavior
83+
of the log parser.
8284

83-
This parser targets Pegasus submit directories that contain hierarchical workflows.
84-
It recursively parses sub-workflows and rebuilds a coherent workflow instance::
85+
..
86+
Hierarchical Pegasus
87+
++++++++++++++++++++
8588
86-
import pathlib
87-
from wfcommons.wfinstances import HierarchicalPegasusLogsParser
89+
This parser targets Pegasus submit directories that contain hierarchical workflows.
90+
It recursively parses sub-workflows and rebuilds a coherent workflow instance::
91+
92+
import pathlib
93+
from wfcommons.wfinstances import HierarchicalPegasusLogsParser
8894

89-
submit_dir = pathlib.Path('/path/to/pegasus/hierarchical/submit/dir/')
90-
parser = HierarchicalPegasusLogsParser(submit_dir=submit_dir)
91-
workflow = parser.build_workflow('pegasus-hierarchical-workflow-test')
92-
workflow.write_json(pathlib.Path('./pegasus-hierarchical-workflow.json'))
95+
submit_dir = pathlib.Path('/path/to/pegasus/hierarchical/submit/dir/')
96+
parser = HierarchicalPegasusLogsParser(submit_dir=submit_dir)
97+
workflow = parser.build_workflow('pegasus-hierarchical-workflow-test')
98+
workflow.write_json(pathlib.Path('./pegasus-hierarchical-workflow.json'))
9399

94100
Makeflow
95101
++++++++
@@ -192,6 +198,43 @@ class: ::
192198
workflow_path = pathlib.Path('./pegasus-workflow.json')
193199
workflow.write_json(workflow_path)
194200

201+
202+
203+
RO-Crate
204+
+++++++++
205+
`RO-Crate <https://www.researchobject.org/ro-crate/>`_ is a format for packaging research data so as to promote
206+
open and reproducible science. The RO-Crate logs parses processes RO-Crate artifacts created by executing workflows
207+
using the `Streamflow <https://streamflow.di.unito.it/>`_ workflow management system. It may work
208+
for RO-Crate generated using other systems, but has not been tested.
209+
It takes as input the path of the RO-Crate directory, which contains the `ro-crate-metadata.json` file. It
210+
generates workflow instances compatible with :ref:`json-format-label`::
211+
212+
import pathlib
213+
from wfcommons.wfinstances import ROCrateLogsParser
214+
215+
execution_dir = pathlib.Path('/path/to/snakemake/execution/dir/')
216+
parser = ROCrateLogsParser(execution_dir=execution_dir)
217+
workflow = parser.build_workflow('ro-crate-workflow-test')
218+
workflow.write_json(pathlib.Path('./ro-crate-workflow.json'))
219+
220+
Snakemake
221+
+++++++++
222+
`Snakemake <https://snakemake.readthedocs.io>`_ is a popular and easy-to-use workflow system.
223+
The Snakemake logs parser processes execution logs generated by the Snakemake
224+
`snkmt plugin <https://snakemake.github.io/snakemake-plugin-catalog/plugins/logger/snkmt.html>`_.
225+
It takes as input the path of the directory where all workflow data files reside (input and output
226+
of workflow tasks), and the path of the sqlite database created by the snkmt plugin. It
227+
generates workflow instances compatible with :ref:`json-format-label`::
228+
229+
import pathlib
230+
from wfcommons.wfinstances import SnakemakeLogsParser
231+
232+
execution_dir = pathlib.Path('/path/to/snakemake/execution/dir/')
233+
snkmt_db = pathlib.Path('/path/to/snkmt/sqlite/databasefile/')
234+
parser = SnakemakeLogsParser(execution_dir=execution_dir, snkmt_db=snkmt_db)
235+
workflow = parser.build_workflow('snakemake-workflow-test')
236+
workflow.write_json(pathlib.Path('./snakemake-workflow.json'))
237+
195238
TaskVine
196239
++++++++
197240

docs/source/generating_workflow_benchmarks.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ Supported translators (alphabetical)
8989
- Parsl
9090
- Pegasus
9191
- PyCOMPSs
92+
- Snakemake
9293
- Swift/T
9394
- TaskVine
9495

@@ -283,6 +284,22 @@ parallel Python applications on distributed infrastructures::
283284
translator = PyCompssTranslator(benchmark.workflow)
284285
translator.translate(output_folder=pathlib.Path("./pycompss-wf/"))
285286

287+
Snakemake
288+
+++++++++
289+
290+
`Snakemake <https://snakemake.readthedocs.io/>`_ is a workflow system to create data
291+
analysis workflows using a human readable, Python-based language::
292+
293+
import pathlib
294+
from wfcommons import BlastRecipe
295+
from wfcommons.wfbench import WorkflowBenchmark, SnakemakeTranslator
296+
297+
benchmark = WorkflowBenchmark(recipe=BlastRecipe, num_tasks=500)
298+
benchmark.create_benchmark(pathlib.Path("/tmp/"), cpu_work=100, data=10, percent_cpu=1.0)
299+
300+
translator = SnakemakeTranslator(benchmark.workflow)
301+
translator.translate(output_folder=pathlib.Path("./snakemake/"))
302+
286303
Swift/T
287304
+++++++
288305

0 commit comments

Comments
 (0)