Skip to main content

Capture and query workflow provenance data using data observability

Project description

Build PyPI Tests Code Formatting License: MIT

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 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, MLFlow, TensorBoard, and Zambeze.

See the Jupyter Notebooks for utilization examples.

See the Contributing 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 .[all] in this directory (or pip install flowcept[all]) if you want to install all dependencies.

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]. Currently, the optional dependencies available are:

pip install flowcept[mlflow]        # To install mlflow's adapter.
pip install flowcept[dask]          # To install dask's adapter.
pip install flowcept[tensorboard]   # To install tensorboaard's adapter.
pip install flowcept[kafka]         # To utilize Kafka as the MQ, instead of Redis.
pip install flowcept[nvidia]        # To capture NVIDIA GPU runtime information.
pip install flowcept[analytics]     # For extra analytics features.
pip install flowcept[dev]           # To install dev dependencies.

You do not need to install any optional dependency to run Flowcept without any adapter, e.g., if you want to use simple instrumentation (see below). In this case, you need to remove the adapter part from the settings.yaml file.

  1. 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 file for this. Run docker-compose -f deployment/compose.yml up.

  1. Define the settings (e.g., routes and ports) accordingly in the settings.yaml file. You may need to set the environment variable FLOWCEPT_SETTINGS_PATH with the absolute path to the settings file.

  2. Start the observation using the Controller API, as shown in the Jupyter Notebooks.

  3. 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.

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:

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

This section is only important if you want to enable GPU runtime data capture and the GPU is from AMD. NVIDIA GPUs don't need this step.

For AMD GPUs, we rely on the official AMD ROCM library to capture GPU 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

Torch Dependencies

Some unit tests utilize torch==2.2.2, torchtext=0.17.2, and torchvision==0.17.2. They are only really needed to run some tests and will be installed if you run pip install flowcept[ml_dev] or pip install flowcept[all]. If you want to use FlowCept with Torch, please adapt torch dependencies according to your project's dependencies.

Cite us

If you used FlowCept in 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:

@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, create a new discussion thread 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flowcept-0.6.7.tar.gz (1.6 MB view details)

Uploaded Source

Built Distribution

flowcept-0.6.7-py3-none-any.whl (80.6 kB view details)

Uploaded Python 3

File details

Details for the file flowcept-0.6.7.tar.gz.

File metadata

  • Download URL: flowcept-0.6.7.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for flowcept-0.6.7.tar.gz
Algorithm Hash digest
SHA256 fe1557a1686b82e37228740f077918b909fa70f1f7a71433df43f77a523c20d5
MD5 37c9139f6ee364fe4cd7581e86c0b9f9
BLAKE2b-256 3b888b85c2f51dec1eb97eee2e345542a397e609bdcd82452d5f7d8e66b2a92b

See more details on using hashes here.

Provenance

File details

Details for the file flowcept-0.6.7-py3-none-any.whl.

File metadata

  • Download URL: flowcept-0.6.7-py3-none-any.whl
  • Upload date:
  • Size: 80.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for flowcept-0.6.7-py3-none-any.whl
Algorithm Hash digest
SHA256 517af630c1dcaa1f1780d73bae02d56b98033e5a76343953ffbd74103e607c11
MD5 c1082d0c312f4c2427f39f1e3e7b3ac6
BLAKE2b-256 b2c7928f70d1130a56caffa607fd207e30d98b4e23ec1839d7b3eb6cbfcc412e

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page