Skip to content

Commit f431ea4

Browse files
committed
(#10) adding makeflow parser
1 parent 4f69500 commit f431ea4

11 files changed

Lines changed: 316 additions & 29 deletions

docs/source/dev_api_generator.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ workflowhub.generator.workflow.soykb\_recipe
8585
:noindex:
8686

8787
workflowhub.generator.workflow.srasearch\_recipe
88-
--------------------------------------------
88+
------------------------------------------------
8989

9090
.. automodule:: workflowhub.generator.workflow.srasearch_recipe
9191
:members:

docs/source/dev_api_trace.rst

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ workflowhub.trace
22
=================
33

44
workflowhub.trace.schema
5-
---------------------------------
5+
------------------------
66

77
.. automodule:: workflowhub.trace.schema
88
:members:
@@ -40,8 +40,18 @@ workflowhub.trace.logs.abstract\_logs\_parser
4040
:private-members:
4141
:noindex:
4242

43+
workflowhub.trace.logs.makeflow
44+
-------------------------------
45+
46+
.. automodule:: workflowhub.trace.logs.makeflow
47+
:members:
48+
:undoc-members:
49+
:show-inheritance:
50+
:private-members:
51+
:noindex:
52+
4353
workflowhub.trace.logs.pegasus
44-
---------------------------------------------
54+
------------------------------
4555

4656
.. automodule:: workflowhub.trace.logs.pegasus
4757
:members:

docs/source/parsing_logs.rst

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,47 @@ The most common way for obtaining traces from actual workflow executions is to p
77
execution logs. As part of the WorkflowHub project, we are constantly developing
88
parsers for commonly used workflow management systems.
99

10-
Each parser class is derived from the :class:`~workflowhub.trace.logs.abstract_logs_parser.LogsParser`
11-
class. Thus, each parser provides a
10+
Each parser class is derived from the abstract
11+
:class:`~workflowhub.trace.logs.abstract_logs_parser.LogsParser` class. Thus, each
12+
parser provides a
1213
:meth:`~workflowhub.trace.logs.abstract_logs_parser.LogsParser.build_workflow`
1314
method.
1415

16+
Makeflow
17+
--------
18+
19+
`Makeflow <http://ccl.cse.nd.edu/software/makeflow/>`_ is a workflow system for
20+
executing large complex workflows on clusters, clouds, and grids. The Makeflow
21+
language is similar to traditional Make, so if you can write a Makefile, then you
22+
can write a Makeflow. A workflow can be just a few commands chained together, or
23+
it can be a complex application consisting of thousands of tasks. It can have an
24+
arbitrary DAG structure and is not limited to specific patterns. Makeflow is used
25+
on a daily basis to execute complex scientific applications in fields such as data
26+
mining, high energy physics, image processing, and bioinformatics. It has run on
27+
campus clusters, the Open Science Grid, NSF XSEDE machines, NCSA Blue Waters, and
28+
Amazon Web Services. Makeflow logs provide time-stamped event traces from these
29+
executions. The following example shows the analysis of Makeflow execution logs,
30+
stored in a local folder (execution dir), for a workflow execution using the
31+
:class:`~workflowhub.trace.logs.makeflow.MakeflowLogsParser` class: ::
32+
33+
from workflowhub.trace import MakeflowLogsParser
34+
35+
# creating the parser for the Makeflow workflow
36+
parser = MakeflowLogsParser(execution_dir='/path/to/makeflow/execution/dir/blast/chameleon-small-001/'
37+
resource_monitor_logs_dir='/path/to/makeflow/resource/monitor/logs/dir')
38+
39+
# generating the workflow trace object
40+
workflow = parser.build_workflow('workflow-test')
41+
42+
# writing the workflow trace to a JSON file
43+
workflow.write_json('workflow.json')
44+
45+
.. note::
46+
The :class:`~workflowhub.trace.logs.makeflow.MakeflowLogsParser` class requires
47+
that Makeflow workflows to run with the
48+
`Resource Monitor <https://cctools.readthedocs.io/en/latest/resource_monitor/>`_
49+
tool (e.g., execute the workflow using the :code:`--monitor=logs`).
50+
1551
Pegasus WMS
1652
-----------
1753

@@ -39,9 +75,8 @@ class: ::
3975
# writing the workflow trace to a JSON file
4076
workflow.write_json('workflow.json')
4177

42-
.. note::
43-
78+
.. warning::
4479
By default, the :class:`~workflowhub.trace.logs.pegasus.PegasusLogsParser`
45-
class assumes that the submit dir is from a Pegasus execution with version 5.0 or later.
46-
To enable parsing of Pegasus execution logs from version 4.9 or earlier, the option
47-
:code:`legacy=True` should be used.
80+
class assumes that the submit dir is from a Pegasus execution with **version 5.0**
81+
or later. To enable parsing of Pegasus execution logs from version 4.9 or earlier,
82+
the option :code:`legacy=True` should be used.

docs/source/quickstart_installation.rst

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,22 @@ Requirements
1010
Graphviz
1111
^^^^^^^^
1212

13-
WorkflowHub uses `pygraphviz <https://pygraphviz.github.io/documentation/latest/install.html>`_ and thus needs the `graphviz <https://www.graphviz.org/>`_ package installed (version 2.16 or later).
14-
You can install graphviz easily on Linux with your favorite package manager,
13+
WorkflowHub uses `pygraphviz <https://pygraphviz.github.io/documentation/latest/install.html>`_
14+
and thus needs the `graphviz <https://www.graphviz.org/>`_ package installed (version 2.16
15+
or later). You can install graphviz easily on Linux with your favorite package manager,
1516
for example for Debian-based distributions:
1617

1718
.. code-block:: bash
1819
1920
$ sudo apt-get install graphviz libgraphviz-dev
2021
21-
2222
and for RedHat-based distributions:
2323

2424
.. code-block:: bash
2525
2626
$ sudo yum install python-devel graphviz-devel
2727
28-
29-
On macOS you can use :code:`brew` package manager:
28+
On macOS you can use the :code:`brew` package manager:
3029

3130
.. code-block:: bash
3231

docs/source/user_api_generator.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ workflowhub.generator.workflow.soykb\_recipe
6363
:show-inheritance:
6464

6565
workflowhub.generator.workflow.srasearch\_recipe
66-
--------------------------------------------
66+
------------------------------------------------
6767

6868
.. automodule:: workflowhub.generator.workflow.srasearch_recipe
6969
:members:

docs/source/user_api_trace.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,16 @@ workflowhub.trace.trace\_analyzer
1717
:undoc-members:
1818
:show-inheritance:
1919

20+
workflowhub.trace.logs.makeflow
21+
-------------------------------
22+
23+
.. automodule:: workflowhub.trace.logs.makeflow
24+
:members:
25+
:undoc-members:
26+
:show-inheritance:
27+
2028
workflowhub.trace.logs.pegasus
21-
---------------------------------
29+
------------------------------
2230

2331
.. automodule:: workflowhub.trace.logs.pegasus
2432
:members:

workflowhub/trace/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33
#
4-
# Copyright (c) 2020 The WorkflowHub Team.
4+
# Copyright (c) 2020-2021 The WorkflowHub Team.
55
#
66
# This program is free software: you can redistribute it and/or modify
77
# it under the terms of the GNU General Public License as published by
88
# the Free Software Foundation, either version 3 of the License, or
99
# (at your option) any later version.
1010

11-
from .logs import PegasusLogsParser
11+
from .logs import MakeflowLogsParser, PegasusLogsParser
1212
from .schema import SchemaValidator
1313
from .trace import Trace
1414
from .trace_analyzer import TraceAnalyzer, TraceElement

workflowhub/trace/logs/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@
88
# the Free Software Foundation, either version 3 of the License, or
99
# (at your option) any later version.
1010

11+
from .makeflow import MakeflowLogsParser
1112
from .pegasus import PegasusLogsParser

workflowhub/trace/logs/abstract_logs_parser.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,31 @@
2020
class LogsParser(ABC):
2121
"""An abstract class of logs parser for creating workflow traces.
2222
23+
:param wms_name: Name of the workflow system.
24+
:type wms_name: str
25+
:param wms_url: URL for the workflow system.
26+
:type wms_url: str
2327
:param description: Workflow trace description.
2428
:type description: str
2529
:param logger: The logger where to log information/warning or errors (optional).
2630
:type logger: Logger
2731
"""
2832

29-
def __init__(self, description: Optional[str] = None, logger: Optional[Logger] = None) -> None:
33+
def __init__(self,
34+
wms_name: str,
35+
wms_url: Optional[str] = None,
36+
description: Optional[str] = None,
37+
logger: Optional[Logger] = None) -> None:
3038
"""Create an object of the logs parser."""
3139
self.logger = logging.getLogger(__name__) if logger is None else logger
3240
self.description = description
41+
self.wms_name = wms_name
42+
self.wms_url = wms_url
43+
self.workflow = None
44+
self.workflow_name = None
45+
self.schema_version = None
46+
self.executed_at = None
47+
self.makespan = None
3348

3449
@abstractmethod
3550
def build_workflow(self, workflow_name: Optional[str] = None) -> Workflow:

0 commit comments

Comments
 (0)