Metadata-Version: 2.1
Name: flowcept
Version: 0.5.4
Summary: FlowCept is a runtime data integration system that empowers any data processing system to capture and query workflow provenance data using data observability, requiring minimal or no changes in the target system code. It seamlessly integrates data from multiple workflows, enabling users to comprehend complex, heterogeneous, and large-scale data from various sources in federated environments.
Home-page: https://github.com/ORNL/flowcept
Author: Oak Ridge National Laboratory
License: MIT
Keywords: ai,ml,machine-learning,provenance,lineage,responsible-ai,databases,big-data,provenance,tensorboard,data-integration,scientific-workflows,dask,reproducibility,workflows,parallel-processing,lineage,model-management,mlflow,responsible-ai,data-analytics
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Natural Language :: English
Classifier: Topic :: System :: Distributed Computing
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: Topic :: System :: Logging
Classifier: Topic :: System :: Monitoring
Classifier: Topic :: Database
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: redis==4.4.2
Requires-Dist: psutil==5.9.5
Requires-Dist: py-cpuinfo==9.0.0
Requires-Dist: pymongo==4.3.3
Requires-Dist: pandas
Requires-Dist: omegaconf
Requires-Dist: flask
Requires-Dist: requests
Requires-Dist: flask_restful
Requires-Dist: Werkzeug
Requires-Dist: msgpack
Provides-Extra: zambeze
Requires-Dist: pika==1.3.1; extra == "zambeze"
Provides-Extra: mlflow
Requires-Dist: mlflow-skinny<=2.16.2,>2.1.1; extra == "mlflow"
Requires-Dist: SQLAlchemy==1.4.42; extra == "mlflow"
Requires-Dist: alembic==1.8.1; extra == "mlflow"
Requires-Dist: watchdog==2.2.1; extra == "mlflow"
Provides-Extra: dask
Requires-Dist: tomli==1.1.0; extra == "dask"
Requires-Dist: dask[distributed]==2023.11.0; extra == "dask"
Provides-Extra: nvidia
Requires-Dist: nvidia-ml-py==11.525.131; extra == "nvidia"
Provides-Extra: amd
Provides-Extra: analytics
Requires-Dist: seaborn==0.13.2; extra == "analytics"
Requires-Dist: plotly==5.18.0; extra == "analytics"
Requires-Dist: scipy==1.10.1; extra == "analytics"
Provides-Extra: responsible-ai
Requires-Dist: torch; extra == "responsible-ai"
Provides-Extra: kafka
Requires-Dist: confluent-kafka==2.5.3; extra == "kafka"
Provides-Extra: tensorboard
Requires-Dist: tensorboard; extra == "tensorboard"
Requires-Dist: tensorflow; extra == "tensorboard"
Requires-Dist: tbparse==0.0.7; extra == "tensorboard"
Provides-Extra: full
Requires-Dist: redis==4.4.2; extra == "full"
Requires-Dist: psutil==5.9.5; extra == "full"
Requires-Dist: py-cpuinfo==9.0.0; extra == "full"
Requires-Dist: pymongo==4.3.3; extra == "full"
Requires-Dist: pandas; extra == "full"
Requires-Dist: omegaconf; extra == "full"
Requires-Dist: flask; extra == "full"
Requires-Dist: requests; extra == "full"
Requires-Dist: flask_restful; extra == "full"
Requires-Dist: Werkzeug; extra == "full"
Requires-Dist: msgpack; extra == "full"
Requires-Dist: pika==1.3.1; extra == "full"
Requires-Dist: mlflow-skinny<=2.16.2,>2.1.1; extra == "full"
Requires-Dist: SQLAlchemy==1.4.42; extra == "full"
Requires-Dist: alembic==1.8.1; extra == "full"
Requires-Dist: watchdog==2.2.1; extra == "full"
Requires-Dist: tomli==1.1.0; extra == "full"
Requires-Dist: dask[distributed]==2023.11.0; extra == "full"
Requires-Dist: seaborn==0.13.2; extra == "full"
Requires-Dist: plotly==5.18.0; extra == "full"
Requires-Dist: scipy==1.10.1; extra == "full"
Requires-Dist: torch; extra == "full"
Requires-Dist: confluent-kafka==2.5.3; extra == "full"
Requires-Dist: tensorboard; extra == "full"
Requires-Dist: tensorflow; extra == "full"
Requires-Dist: tbparse==0.0.7; extra == "full"
Provides-Extra: fulldev
Requires-Dist: redis==4.4.2; extra == "fulldev"
Requires-Dist: psutil==5.9.5; extra == "fulldev"
Requires-Dist: py-cpuinfo==9.0.0; extra == "fulldev"
Requires-Dist: pymongo==4.3.3; extra == "fulldev"
Requires-Dist: pandas; extra == "fulldev"
Requires-Dist: omegaconf; extra == "fulldev"
Requires-Dist: flask; extra == "fulldev"
Requires-Dist: requests; extra == "fulldev"
Requires-Dist: flask_restful; extra == "fulldev"
Requires-Dist: Werkzeug; extra == "fulldev"
Requires-Dist: msgpack; extra == "fulldev"
Requires-Dist: pika==1.3.1; extra == "fulldev"
Requires-Dist: mlflow-skinny<=2.16.2,>2.1.1; extra == "fulldev"
Requires-Dist: SQLAlchemy==1.4.42; extra == "fulldev"
Requires-Dist: alembic==1.8.1; extra == "fulldev"
Requires-Dist: watchdog==2.2.1; extra == "fulldev"
Requires-Dist: tomli==1.1.0; extra == "fulldev"
Requires-Dist: dask[distributed]==2023.11.0; extra == "fulldev"
Requires-Dist: seaborn==0.13.2; extra == "fulldev"
Requires-Dist: plotly==5.18.0; extra == "fulldev"
Requires-Dist: scipy==1.10.1; extra == "fulldev"
Requires-Dist: torch; extra == "fulldev"
Requires-Dist: confluent-kafka==2.5.3; extra == "fulldev"
Requires-Dist: tensorboard; extra == "fulldev"
Requires-Dist: tensorflow; extra == "fulldev"
Requires-Dist: tbparse==0.0.7; extra == "fulldev"
Requires-Dist: pytest==6.2.4; extra == "fulldev"
Requires-Dist: flake8==5.0.4; extra == "fulldev"
Requires-Dist: black==23.1.0; extra == "fulldev"
Requires-Dist: numpy<2.0.0; extra == "fulldev"
Requires-Dist: bokeh==2.4.2; extra == "fulldev"
Requires-Dist: jupyterlab; extra == "fulldev"
Requires-Dist: nbmake; extra == "fulldev"
Requires-Dist: torch; extra == "fulldev"
Requires-Dist: torchvision; extra == "fulldev"
Requires-Dist: datasets; extra == "fulldev"
Requires-Dist: torchtext; extra == "fulldev"
Requires-Dist: sacremoses; extra == "fulldev"
Requires-Dist: nltk; extra == "fulldev"

[![Build](https://github.com/ORNL/flowcept/actions/workflows/create-release-n-publish.yml/badge.svg)](https://github.com/ORNL/flowcept/actions/workflows/create-release-n-publish.yml)
[![PyPI](https://badge.fury.io/py/flowcept.svg)](https://pypi.org/project/flowcept)
[![Tests](https://github.com/ORNL/flowcept/actions/workflows/run-tests.yml/badge.svg)](https://github.com/ORNL/flowcept/actions/workflows/run-tests.yml)
[![Code Formatting](https://github.com/ORNL/flowcept/actions/workflows/code-formatting.yml/badge.svg)](https://github.com/ORNL/flowcept/actions/workflows/code-formatting.yml)
[![License: MIT](https://img.shields.io/github/license/ORNL/flowcept)](LICENSE)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

# FlowCept

FlowCept is a runtime data integration system that empowers any data processing system to capture and query workflow 
provenance data using data observability, requiring minimal or no changes in the target system code. It seamlessly integrates data from multiple workflows, enabling users to comprehend complex, heterogeneous, and large-scale data from various sources in federated environments.

FlowCept is intended to address scenarios where multiple workflows in a science campaign or in an enterprise run and generate 
important data to be analyzed in an integrated manner. Since these workflows may use different data manipulation tools (e.g., provenance or lineage capture tools, database systems, performance profiling tools) or can be executed within
different parallel computing systems (e.g., Dask, Spark, Workflow Management Systems), its key differentiator is the 
capability to seamless and automatically integrate data from various workflows using data observability.
It builds an integrated data view at runtime enabling end-to-end exploratory data analysis and monitoring.
It follows [W3C PROV](https://www.w3.org/TR/prov-overview/) recommendations for its data schema.
It does not require changes in user codes or systems (i.e., instrumentation). All users need to do is to create adapters for their systems or tools, if one is not available yet. 
In addition to observability, we provide instrumentation options for convenience. For example, by adding a `@flowcept_task` decorator on functions, FlowCept will observe their executions when they run. Also, we provide special features for PyTorch modules. Adding `@torch_task` to them will enable extra model inspection to be captured and integrated in the database at runtime.    
 

Currently, FlowCept provides adapters for: [Dask](https://www.dask.org/), [MLFlow](https://mlflow.org/), [TensorBoard](https://www.tensorflow.org/tensorboard), and [Zambeze](https://github.com/ORNL/zambeze). 

See the [Jupyter Notebooks](notebooks) for utilization examples.

See the [Contributing](CONTRIBUTING.md) file for guidelines to contribute with new adapters. Note that we may use the
term 'plugin' in the codebase as a synonym to adapter. Future releases should standardize the terminology to use adapter.


## Install and Setup:

1. Install FlowCept: 

`pip install .[full]` in this directory (or `pip install flowcept[full]`).

For convenience, this will install all dependencies for all adapters. But it can install
dependencies for adapters you will not use. For this reason, you may want to install 
like this: `pip install .[adapter_key1,adapter_key2]` for the adapters we have implemented, e.g., `pip install .[dask]`.
See [extra_requirements](extra_requirements) if you want to install the dependencies individually.
 
2. Start MongoDB and Redis:

To enable the full advantages of FlowCept, one needs to start a Redis and MongoDB instances.
FlowCept uses Redis as its message queue system and Mongo for its persistent database.
For convenience, we set up a [docker-compose file](deployment/compose.yml) deployment file for this. Run `docker-compose -f deployment/compose.yml up`. RabbitMQ is only needed if Zambeze messages are observed, otherwise, feel free to comment out RabbitMQ service in the compose file.

3. Define the settings (e.g., routes and ports) accordingly in the [settings.yaml](resources/settings.yaml) file.
You may need to set the environment variable `FLOWCEPT_SETTINGS_PATH` with the absolute path to the settings file. 

4. Start the observation using the Controller API, as shown in the [Jupyter Notebooks](notebooks).

5. To use FlowCept's Query API, see utilization examples in the notebooks.

### Simple Example with Decorators Instrumentation

In addition to existing adapters to Dask, MLFlow, and others (it's extensible for any system that generates data), FlowCept also offers instrumentation via @decorators. 

```python 
from flowcept import Flowcept, flowcept_task

@flowcept_task
def sum_one(n):
    return n + 1


@flowcept_task
def mult_two(n):
    return n * 2


with Flowcept(workflow_name='test_workflow'):
    n = 3
    o1 = sum_one(n)
    o2 = mult_two(o1)
    print(o2)

print(Flowcept.db.query(filter={"workflow_id": Flowcept.current_workflow_id}))
```



## Performance Tuning for Performance Evaluation

In the settings.yaml file, the following variables might impact interception performance:

```yaml
main_redis:
  buffer_size: 50
  insertion_buffer_time_secs: 5

plugin:
  enrich_messages: false
```

And other variables depending on the Plugin. For instance, in Dask, timestamp creation by workers add interception overhead.
As we evolve the software, other variables that impact overhead appear and we might not stated them in this README file yet.
If you are doing extensive performance evaluation experiments using this software, please reach out to us (e.g., create an issue in the repository) for hints on how to reduce the overhead of our software.

## Install AMD GPU Lib

On the machines that have AMD GPUs, we use the official AMD ROCM library to capture GPU runtime data.

Unfortunately, this library is not available as a pypi/conda package, so you must manually install it. See instructions in the link: https://rocm.docs.amd.com/projects/amdsmi/en/latest/

Here is a summary:

1. Install the AMD drivers on the machine (check if they are available already under `/opt/rocm-*`).
2. Suppose it is /opt/rocm-6.2.0. Then, make sure it has a share/amd_smi subdirectory and pyproject.toml or setup.py in it.
3. Copy the amd_smi to your home directory: `cp -r /opt/rocm-6.2.0/share/amd_smi ~`
4. cd ~/amd_smi
5. In your python environment, do a pip install .

Current code is compatible with this version: amdsmi==24.6.2+2b02a07
Which was installed using Frontier's /opt/rocm-6.2.0/share/amd_smi

## See also

- [Zambeze Repository](https://github.com/ORNL/zambeze)

## Cite us

If you used FlowCept for your research, consider citing our paper.

```
Towards Lightweight Data Integration using Multi-workflow Provenance and Data Observability
R. Souza, T. Skluzacek, S. Wilkinson, M. Ziatdinov, and R. da Silva
19th IEEE International Conference on e-Science, 2023.
```

**Bibtex:**

```latex
@inproceedings{souza2023towards,  
  author = {Souza, Renan and Skluzacek, Tyler J and Wilkinson, Sean R and Ziatdinov, Maxim and da Silva, Rafael Ferreira},
  booktitle = {IEEE International Conference on e-Science},
  doi = {10.1109/e-Science58273.2023.10254822},
  link = {https://doi.org/10.1109/e-Science58273.2023.10254822},
  pdf = {https://arxiv.org/pdf/2308.09004.pdf},
  title = {Towards Lightweight Data Integration using Multi-workflow Provenance and Data Observability},
  year = {2023}
}

```

## Disclaimer & Get in Touch

Please note that this a research software. We encourage you to give it a try and use it with your own stack. We
are continuously working on improving documentation and adding more examples and notebooks, but we are still far from
a good documentation covering the whole system. If you are interested in working with FlowCept in your own scientific
project, we can give you a jump start if you reach out to us. Feel free to [create an issue](https://github.com/ORNL/flowcept/issues/new), 
[create a new discussion thread](https://github.com/ORNL/flowcept/discussions/new/choose) or drop us an email (we trust you'll find a way to reach out to us :wink: ).

## Acknowledgement

This research uses resources of the Oak Ridge Leadership Computing Facility 
at the Oak Ridge National Laboratory, which is supported by the Office of 
Science of the U.S. Department of Energy under Contract No. DE-AC05-00OR22725.
