flowcept 0.9.10__tar.gz → 0.9.12__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {flowcept-0.9.10 → flowcept-0.9.12}/.gitignore +1 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/Makefile +1 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/PKG-INFO +18 -3
- {flowcept-0.9.10 → flowcept-0.9.12}/README.md +17 -2
- {flowcept-0.9.10 → flowcept-0.9.12}/docs/api-reference.rst +6 -2
- {flowcept-0.9.10 → flowcept-0.9.12}/docs/conf.py +18 -10
- flowcept-0.9.12/docs/img/flowcept-logo-dark.png +0 -0
- flowcept-0.9.12/docs/index.rst +49 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/docs/prov_capture.rst +113 -6
- {flowcept-0.9.10 → flowcept-0.9.12}/docs/prov_query.rst +66 -53
- {flowcept-0.9.10 → flowcept-0.9.12}/docs/prov_storage.rst +91 -1
- flowcept-0.9.12/docs/publications/README.md +91 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/docs/quick_start.rst +5 -5
- {flowcept-0.9.10 → flowcept-0.9.12}/docs/setup.rst +1 -1
- {flowcept-0.9.10 → flowcept-0.9.12}/examples/llm_complex/llm_dataprep.py +0 -2
- flowcept-0.9.12/examples/llm_tutorial/README.md +232 -0
- flowcept-0.9.12/examples/llm_tutorial/analysis.ipynb +610 -0
- flowcept-0.9.12/examples/llm_tutorial/llm_dataprep.py +267 -0
- flowcept-0.9.12/examples/llm_tutorial/llm_model.py +280 -0
- flowcept-0.9.12/examples/llm_tutorial/llm_train_campaign.py +241 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/examples/start_here.py +4 -4
- {flowcept-0.9.10 → flowcept-0.9.12}/resources/sample_settings.yaml +6 -3
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/__init__.py +1 -1
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/cli.py +81 -2
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/commons/daos/mq_dao/mq_dao_base.py +10 -17
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/commons/utils.py +19 -1
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/configs.py +20 -11
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/flowcept_api/flowcept_controller.py +144 -9
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/flowceptor/adapters/base_interceptor.py +2 -1
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/instrumentation/flowcept_loop.py +1 -1
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/version.py +1 -1
- {flowcept-0.9.10 → flowcept-0.9.12}/tests/adapters/test_file_observer.py +2 -2
- {flowcept-0.9.10 → flowcept-0.9.12}/tests/instrumentation_tests/flowcept_task_decorator_test.py +5 -1
- flowcept-0.9.10/docs/img/flowcept-logo-dark.png +0 -0
- flowcept-0.9.10/docs/index.rst +0 -29
- {flowcept-0.9.10 → flowcept-0.9.12}/.github/workflows/checks.yml +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/.github/workflows/create-release-n-publish.yml +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/.github/workflows/run-llm-tests.yml +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/.github/workflows/run-tests-all-dbs.yml +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/.github/workflows/run-tests-in-container.yml +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/.github/workflows/run-tests-kafka.yml +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/.github/workflows/run-tests-py313.yml +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/.github/workflows/run-tests-simple.yml +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/.github/workflows/run-tests.yml +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/.github/workflows/run_examples.sh +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/.github/workflows/version_bumper.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/.readthedocs.yaml +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/CONTRIBUTING.md +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/LICENSE +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/deployment/Dockerfile +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/deployment/compose-grafana.yml +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/deployment/compose-kafka.yml +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/deployment/compose-mofka.yml +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/deployment/compose-mongo.yml +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/deployment/compose.yml +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/docs/architecture.rst +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/docs/cli-reference.rst +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/docs/contributing.rst +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/docs/img/PROV-AGENT.svg +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/docs/img/architecture-diagram.png +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/docs/img/flowcept-logo.png +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/docs/large_data.rst +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/docs/schemas.rst +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/docs/task_schema.rst +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/docs/telemetry_capture.rst +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/docs/workflow_schema.rst +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/examples/agents/a2a/README.md +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/examples/agents/a2a/agent1.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/examples/agents/a2a/agent2.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/examples/agents/aec_agent_context_manager.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/examples/agents/aec_agent_mock.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/examples/agents/aec_prompts.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/examples/agents/opt_driver_mock.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/examples/consumers/ping_pong_example.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/examples/consumers/simple_consumer.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/examples/consumers/simple_publisher.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/examples/convergence_loop_example.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/examples/dask_example.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/examples/distributed_consumer_example.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/examples/instrumented_loop_example.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/examples/instrumented_simple_example.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/examples/llm_complex/README.md +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/examples/llm_complex/custom_provenance_id_mapping.yaml +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/examples/llm_complex/llm_main_example.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/examples/llm_complex/llm_model.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/examples/llm_complex/llm_test_runner.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/examples/mlflow_example.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/examples/mqtt_example.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/examples/single_layer_perceptron_example.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/examples/tensorboard_example.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/examples/unmanaged/main.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/examples/unmanaged/simple_task.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/notebooks/analytics.ipynb +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/notebooks/dask.ipynb +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/notebooks/dask_from_CLI.ipynb +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/notebooks/mlflow.ipynb +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/notebooks/reset_dask_nb_exec_counts.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/notebooks/tensorboard.ipynb +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/pyproject.toml +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/resources/mofka/bedrock_setup.sh +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/resources/mofka/consumer.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/resources/mofka/mofka-requirements.yaml +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/resources/mofka/mofka_config.json +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/resources/simple_redis_consumer.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/agents/__init__.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/agents/agent_client.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/agents/agents_utils.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/agents/dynamic_schema_tracker.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/agents/flowcept_agent.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/agents/flowcept_ctx_manager.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/agents/gui/__init__.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/agents/gui/agent_gui.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/agents/gui/audio_utils.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/agents/gui/gui_utils.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/agents/llms/__init__.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/agents/llms/claude_gcp.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/agents/llms/gemini25.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/agents/prompts/__init__.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/agents/prompts/general_prompts.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/agents/prompts/in_memory_query_prompts.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/agents/tools/__init__.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/agents/tools/general_tools.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/agents/tools/in_memory_queries/__init__.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/agents/tools/in_memory_queries/in_memory_queries_tools.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/agents/tools/in_memory_queries/pandas_agent_utils.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/analytics/__init__.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/analytics/analytics_utils.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/analytics/data_augmentation.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/analytics/plot.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/commons/__init__.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/commons/autoflush_buffer.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/commons/daos/__init__.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/commons/daos/docdb_dao/__init__.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/commons/daos/docdb_dao/docdb_dao_base.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/commons/daos/docdb_dao/lmdb_dao.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/commons/daos/docdb_dao/mongodb_dao.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/commons/daos/keyvalue_dao.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/commons/daos/mq_dao/__init__.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/commons/daos/mq_dao/mq_dao_kafka.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/commons/daos/mq_dao/mq_dao_mofka.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/commons/daos/mq_dao/mq_dao_redis.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/commons/daos/redis_conn.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/commons/flowcept_dataclasses/__init__.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/commons/flowcept_dataclasses/base_settings_dataclasses.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/commons/flowcept_dataclasses/task_object.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/commons/flowcept_dataclasses/telemetry.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/commons/flowcept_dataclasses/workflow_object.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/commons/flowcept_logger.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/commons/query_utils.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/commons/settings_factory.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/commons/task_data_preprocess.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/commons/vocabulary.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/flowcept_api/__init__.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/flowcept_api/db_api.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/flowcept_api/task_query_api.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/flowcept_webserver/__init__.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/flowcept_webserver/app.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/flowcept_webserver/resources/__init__.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/flowcept_webserver/resources/query_rsrc.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/flowcept_webserver/resources/task_messages_rsrc.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/flowceptor/__init__.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/flowceptor/adapters/__init__.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/flowceptor/adapters/brokers/__init__.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/flowceptor/adapters/brokers/mqtt_interceptor.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/flowceptor/adapters/dask/__init__.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/flowceptor/adapters/dask/dask_dataclasses.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/flowceptor/adapters/dask/dask_interceptor.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/flowceptor/adapters/dask/dask_plugins.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/flowceptor/adapters/instrumentation_interceptor.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/flowceptor/adapters/interceptor_state_manager.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/flowceptor/adapters/mlflow/__init__.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/flowceptor/adapters/mlflow/interception_event_handler.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/flowceptor/adapters/mlflow/mlflow_dao.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/flowceptor/adapters/mlflow/mlflow_dataclasses.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/flowceptor/adapters/mlflow/mlflow_interceptor.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/flowceptor/adapters/tensorboard/__init__.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/flowceptor/adapters/tensorboard/tensorboard_dataclasses.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/flowceptor/adapters/tensorboard/tensorboard_interceptor.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/flowceptor/consumers/__init__.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/flowceptor/consumers/agent/__init__.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/flowceptor/consumers/agent/base_agent_context_manager.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/flowceptor/consumers/base_consumer.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/flowceptor/consumers/consumer_utils.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/flowceptor/consumers/document_inserter.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/flowceptor/telemetry_capture.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/instrumentation/__init__.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/instrumentation/flowcept_agent_task.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/instrumentation/flowcept_decorator.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/instrumentation/flowcept_task.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/instrumentation/flowcept_torch.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/src/flowcept/instrumentation/task_capture.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/tests/__init__.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/tests/adapters/__init__.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/tests/adapters/dask_test_utils.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/tests/adapters/test_broker.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/tests/adapters/test_dask.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/tests/adapters/test_dask_with_context_mgmt.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/tests/adapters/test_mlflow.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/tests/adapters/test_tensorboard.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/tests/api/__init__.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/tests/api/db_api_test.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/tests/api/flowcept_api_test.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/tests/api/sample_data.json +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/tests/api/sample_data_with_telemetry_and_rai.json +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/tests/api/task_query_api_test.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/tests/doc_db_inserter/__init__.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/tests/doc_db_inserter/doc_db_inserter_test.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/tests/instrumentation_tests/__init__.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/tests/instrumentation_tests/flowcept_explicit_tasks.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/tests/instrumentation_tests/flowcept_loop_test.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/tests/instrumentation_tests/ml_tests/__init__.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/tests/instrumentation_tests/ml_tests/dl_trainer.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/tests/instrumentation_tests/ml_tests/ml_decorator_dask_test.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/tests/instrumentation_tests/ml_tests/ml_decorator_test.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/tests/misc_tests/__init__.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/tests/misc_tests/log_test.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/tests/misc_tests/singleton_test.py +0 -0
- {flowcept-0.9.10 → flowcept-0.9.12}/tests/misc_tests/telemetry_test.py +0 -0
|
@@ -46,6 +46,7 @@ clean:
|
|
|
46
46
|
@find . -type f -name "*nohup*" -exec sh -c 'rm -f "$$@" 2>/dev/null || true' sh {} +
|
|
47
47
|
@sh -c 'sphinx-build -M clean docs docs/_build > /dev/null 2>&1 || true'
|
|
48
48
|
@sh -c 'rm -f docs/generated/* 2>/dev/null || true'
|
|
49
|
+
@sh -c 'rm -f docs/_build/* 2>/dev/null || true'
|
|
49
50
|
|
|
50
51
|
# Build the HTML documentation using Sphinx
|
|
51
52
|
.PHONY: docs
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: flowcept
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.12
|
|
4
4
|
Summary: Capture and query workflow provenance data using data observability
|
|
5
5
|
Author: Oak Ridge National Laboratory
|
|
6
6
|
License-Expression: MIT
|
|
@@ -149,11 +149,16 @@ Description-Content-Type: text/markdown
|
|
|
149
149
|
|
|
150
150
|
<p align="center">
|
|
151
151
|
<picture>
|
|
152
|
+
<!-- Dark theme -->
|
|
153
|
+
<source srcset="./docs/img/flowcept-logo-dark.png" media="(prefers-color-scheme: dark)" />
|
|
154
|
+
<!-- Light theme -->
|
|
155
|
+
<source srcset="./docs/img/flowcept-logo.png" media="(prefers-color-scheme: light)" />
|
|
156
|
+
<!-- Fallback -->
|
|
152
157
|
<img src="./docs/img/flowcept-logo.png" alt="Flowcept Logo" width="200"/>
|
|
153
158
|
</picture>
|
|
154
159
|
</p>
|
|
155
|
-
<h3 align="center">Lightweight Distributed Workflow Provenance</h3>
|
|
156
160
|
|
|
161
|
+
<h3 align="center">Lightweight Distributed Workflow Provenance</h3>
|
|
157
162
|
|
|
158
163
|
|
|
159
164
|
---
|
|
@@ -162,6 +167,7 @@ Flowcept captures and queries workflow provenance at runtime with minimal code c
|
|
|
162
167
|
|
|
163
168
|
---
|
|
164
169
|
|
|
170
|
+
|
|
165
171
|
[](https://flowcept.readthedocs.io/)
|
|
166
172
|
[](https://github.com/ORNL/flowcept/actions/workflows/create-release-n-publish.yml)
|
|
167
173
|
[](https://pypi.org/project/flowcept)
|
|
@@ -169,6 +175,15 @@ Flowcept captures and queries workflow provenance at runtime with minimal code c
|
|
|
169
175
|
[](https://github.com/ORNL/flowcept/actions/workflows/checks.yml)
|
|
170
176
|
[](LICENSE)
|
|
171
177
|
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
<h4 align="center">
|
|
182
|
+
<a href="https://flowcept.readthedocs.io/">Documentation</a> •
|
|
183
|
+
<a href="./docs/publications">Publications</a>
|
|
184
|
+
</h4>
|
|
185
|
+
|
|
186
|
+
|
|
172
187
|
---
|
|
173
188
|
|
|
174
189
|
# Quickstart
|
|
@@ -220,7 +235,7 @@ def main():
|
|
|
220
235
|
if __name__ == "__main__":
|
|
221
236
|
main()
|
|
222
237
|
|
|
223
|
-
prov_messages = Flowcept.
|
|
238
|
+
prov_messages = Flowcept.read_buffer_file()
|
|
224
239
|
assert len(prov_messages) == 2
|
|
225
240
|
print(json.dumps(prov_messages, indent=2))
|
|
226
241
|
```
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
<p align="center">
|
|
2
2
|
<picture>
|
|
3
|
+
<!-- Dark theme -->
|
|
4
|
+
<source srcset="./docs/img/flowcept-logo-dark.png" media="(prefers-color-scheme: dark)" />
|
|
5
|
+
<!-- Light theme -->
|
|
6
|
+
<source srcset="./docs/img/flowcept-logo.png" media="(prefers-color-scheme: light)" />
|
|
7
|
+
<!-- Fallback -->
|
|
3
8
|
<img src="./docs/img/flowcept-logo.png" alt="Flowcept Logo" width="200"/>
|
|
4
9
|
</picture>
|
|
5
10
|
</p>
|
|
6
|
-
<h3 align="center">Lightweight Distributed Workflow Provenance</h3>
|
|
7
11
|
|
|
12
|
+
<h3 align="center">Lightweight Distributed Workflow Provenance</h3>
|
|
8
13
|
|
|
9
14
|
|
|
10
15
|
---
|
|
@@ -13,6 +18,7 @@ Flowcept captures and queries workflow provenance at runtime with minimal code c
|
|
|
13
18
|
|
|
14
19
|
---
|
|
15
20
|
|
|
21
|
+
|
|
16
22
|
[](https://flowcept.readthedocs.io/)
|
|
17
23
|
[](https://github.com/ORNL/flowcept/actions/workflows/create-release-n-publish.yml)
|
|
18
24
|
[](https://pypi.org/project/flowcept)
|
|
@@ -20,6 +26,15 @@ Flowcept captures and queries workflow provenance at runtime with minimal code c
|
|
|
20
26
|
[](https://github.com/ORNL/flowcept/actions/workflows/checks.yml)
|
|
21
27
|
[](LICENSE)
|
|
22
28
|
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
<h4 align="center">
|
|
33
|
+
<a href="https://flowcept.readthedocs.io/">Documentation</a> •
|
|
34
|
+
<a href="./docs/publications">Publications</a>
|
|
35
|
+
</h4>
|
|
36
|
+
|
|
37
|
+
|
|
23
38
|
---
|
|
24
39
|
|
|
25
40
|
# Quickstart
|
|
@@ -71,7 +86,7 @@ def main():
|
|
|
71
86
|
if __name__ == "__main__":
|
|
72
87
|
main()
|
|
73
88
|
|
|
74
|
-
prov_messages = Flowcept.
|
|
89
|
+
prov_messages = Flowcept.read_buffer_file()
|
|
75
90
|
assert len(prov_messages) == 2
|
|
76
91
|
print(json.dumps(prov_messages, indent=2))
|
|
77
92
|
```
|
|
@@ -65,7 +65,9 @@ FlowceptTask
|
|
|
65
65
|
FlowceptLoop
|
|
66
66
|
-------------------
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
Can be imported via ``from flowcept import FlowceptLoop``
|
|
69
|
+
|
|
70
|
+
.. autoclass:: flowcept.instrumentation.flowcept_loop.FlowceptLoop
|
|
69
71
|
:members:
|
|
70
72
|
:special-members: __init__
|
|
71
73
|
:undoc-members:
|
|
@@ -75,7 +77,9 @@ FlowceptLoop
|
|
|
75
77
|
FlowceptLightweightLoop
|
|
76
78
|
------------------------------
|
|
77
79
|
|
|
78
|
-
|
|
80
|
+
Can be imported via ``from flowcept import FlowceptLightweightLoop``
|
|
81
|
+
|
|
82
|
+
.. autoclass:: flowcept.instrumentation.flowcept_loop.FlowceptLightweightLoop
|
|
79
83
|
:members:
|
|
80
84
|
:special-members: __init__
|
|
81
85
|
:undoc-members:
|
|
@@ -1,31 +1,39 @@
|
|
|
1
1
|
# Configuration file for the Sphinx documentation builder.
|
|
2
2
|
#
|
|
3
|
-
# For the full list of built-in configuration values, see the documentation:
|
|
4
3
|
# https://www.sphinx-doc.org/en/master/usage/configuration.html
|
|
5
4
|
|
|
6
5
|
# -- Project information -----------------------------------------------------
|
|
7
|
-
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
|
|
8
|
-
|
|
9
6
|
project = "Flowcept"
|
|
10
7
|
copyright = "Oak Ridge National Lab"
|
|
11
8
|
author = "Oak Ridge National Lab"
|
|
12
9
|
|
|
13
10
|
# -- General configuration ---------------------------------------------------
|
|
14
|
-
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
|
|
15
|
-
|
|
16
11
|
extensions = [
|
|
17
12
|
"sphinx.ext.autodoc",
|
|
18
13
|
"sphinx.ext.autosummary",
|
|
19
14
|
]
|
|
20
|
-
|
|
21
15
|
autosummary_generate = True
|
|
22
16
|
templates_path = ["_templates"]
|
|
23
17
|
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
|
|
24
18
|
|
|
25
|
-
# --
|
|
26
|
-
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
|
|
27
|
-
|
|
19
|
+
# -- HTML output -------------------------------------------------------------
|
|
28
20
|
html_theme = "furo"
|
|
29
21
|
html_title = "Flowcept"
|
|
22
|
+
|
|
23
|
+
# Keep using your existing 'img' folder as the static path so you don't have to move files.
|
|
24
|
+
# Sphinx will treat everything inside 'img/' as static assets.
|
|
30
25
|
html_static_path = ["img"]
|
|
31
|
-
|
|
26
|
+
|
|
27
|
+
# Furo supports automatic dark/light logo switching.
|
|
28
|
+
# IMPORTANT: Paths below are relative to the *root* of each static path ('img' here),
|
|
29
|
+
# so do NOT prefix with 'img/'.
|
|
30
|
+
html_theme_options = {
|
|
31
|
+
"light_logo": "flowcept-logo.png",
|
|
32
|
+
"dark_logo": "flowcept-logo-dark.png",
|
|
33
|
+
# Optional extras:
|
|
34
|
+
"sidebar_hide_name": True,
|
|
35
|
+
# "light_css_variables": {},
|
|
36
|
+
# "dark_css_variables": {},
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
# html_logo = "img/flowcept-logo.png
|
|
Binary file
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
Flowcept
|
|
2
|
+
========
|
|
3
|
+
|
|
4
|
+
.. raw:: html
|
|
5
|
+
|
|
6
|
+
<style>
|
|
7
|
+
/* Show/hide logos based on Furo's theme attribute */
|
|
8
|
+
.logo-light { display: inline; }
|
|
9
|
+
.logo-dark { display: none; }
|
|
10
|
+
|
|
11
|
+
html[data-theme="dark"] .logo-light { display: none; }
|
|
12
|
+
html[data-theme="dark"] .logo-dark { display: inline; }
|
|
13
|
+
|
|
14
|
+
/* When Furo is in 'auto', follow the OS preference */
|
|
15
|
+
html[data-theme="auto"] .logo-light { display: inline; }
|
|
16
|
+
html[data-theme="auto"] .logo-dark { display: none; }
|
|
17
|
+
@media (prefers-color-scheme: dark) {
|
|
18
|
+
html[data-theme="auto"] .logo-light { display: none; }
|
|
19
|
+
html[data-theme="auto"] .logo-dark { display: inline; }
|
|
20
|
+
}
|
|
21
|
+
</style>
|
|
22
|
+
|
|
23
|
+
<p align="center">
|
|
24
|
+
<!-- Keep both images in the DOM and toggle via CSS -->
|
|
25
|
+
<img src="_static/flowcept-logo.png" alt="Flowcept Logo" width="200" class="logo-light">
|
|
26
|
+
<img src="_static/flowcept-logo-dark.png" alt="Flowcept Logo (Dark)" width="200" class="logo-dark">
|
|
27
|
+
</p>
|
|
28
|
+
|
|
29
|
+
.. image:: https://img.shields.io/badge/GitHub-Flowcept-black?logo=github&logoColor=white
|
|
30
|
+
:target: https://github.com/ORNL/flowcept
|
|
31
|
+
:alt: GitHub
|
|
32
|
+
:align: center
|
|
33
|
+
:width: 120px
|
|
34
|
+
|
|
35
|
+
.. toctree::
|
|
36
|
+
:maxdepth: 2
|
|
37
|
+
:caption: Contents:
|
|
38
|
+
|
|
39
|
+
quick_start
|
|
40
|
+
architecture
|
|
41
|
+
setup
|
|
42
|
+
prov_capture
|
|
43
|
+
telemetry_capture
|
|
44
|
+
prov_storage
|
|
45
|
+
prov_query
|
|
46
|
+
schemas
|
|
47
|
+
contributing
|
|
48
|
+
cli-reference
|
|
49
|
+
api-reference
|
|
@@ -381,10 +381,8 @@ Optimized for **HPC** and tight loops; minimal interception overhead:
|
|
|
381
381
|
|
|
382
382
|
**When to use**: massive iteration counts, sensitive microbenchmarks, or very low overhead needs.
|
|
383
383
|
|
|
384
|
-
|
|
385
|
-
|
|
386
384
|
Loop Instrumentation
|
|
387
|
-
|
|
385
|
+
---------------------
|
|
388
386
|
|
|
389
387
|
Instrument iterative loops directly (see
|
|
390
388
|
`loop example <https://github.com/ORNL/flowcept/blob/main/examples/instrumented_loop_example.py>`_).
|
|
@@ -403,10 +401,116 @@ Combine the context manager (below) with per-iteration tasks or custom events.
|
|
|
403
401
|
loop.end_iter({"item": item, "loss": loss})
|
|
404
402
|
|
|
405
403
|
|
|
404
|
+
|
|
406
405
|
FlowceptLoop vs FlowceptLightweightLoop
|
|
407
|
-
|
|
406
|
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
407
|
+
|
|
408
|
+
Both classes instrument iterative code and attach each iteration to provenance. They differ in how they trade detail for speed.
|
|
409
|
+
|
|
410
|
+
- **FlowceptLoop**: opens and closes a tiny “iteration task” around every `next()` call. It can attach `started_at`, `status`, and (if enabled) **per-iteration telemetry** at the end of each iteration. Messages are sent one by one. Works with sized iterables, integers, and iterators. If you pass a pure iterator without a known length, it will materialize it into a list unless you provide `items_length`.
|
|
411
|
+
|
|
412
|
+
- **FlowceptLightweightLoop**: pre-allocates a task object for every iteration up front, updates `used` and `generated` as the loop progresses, and **sends everything in a single batch** when the loop ends. No per-iteration telemetry capture. Requires a known length. If you pass a pure iterator, you **must** provide `items_length`.
|
|
413
|
+
|
|
414
|
+
When to use which
|
|
415
|
+
~~~~~~~~~~~~~~~~~
|
|
416
|
+
|
|
417
|
+
Choose **FlowceptLoop** if you need:
|
|
418
|
+
- Per-iteration telemetry, `started_at`, and fine-grained timing.
|
|
419
|
+
- Streaming of iteration records to the MQ/DB as the loop runs.
|
|
420
|
+
- Constant memory usage independent of the number of iterations.
|
|
421
|
+
|
|
422
|
+
Choose **FlowceptLightweightLoop** if you need:
|
|
423
|
+
- The lowest overhead for very large loops.
|
|
424
|
+
- A single batched publish at the end of the loop.
|
|
425
|
+
- You can provide, or already have, the exact iteration count.
|
|
426
|
+
|
|
427
|
+
Behavioral differences at a glance
|
|
428
|
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
429
|
+
|
|
430
|
+
- **Telemetry**: FlowceptLoop records telemetry at the end of each iteration when telemetry is enabled. Lightweight does not.
|
|
431
|
+
- **Publishing**: FlowceptLoop calls `intercept(...)` per iteration. Lightweight calls `intercept_many([...])` once after the loop finishes.
|
|
432
|
+
- **Memory**: FlowceptLoop keeps only the current iteration in memory. Lightweight pre-allocates a list of task objects of size `len(items)`.
|
|
433
|
+
- **Unknown lengths**: FlowceptLoop can materialize an unknown-length iterator into a list if you do not provide `items_length` (may be expensive). Lightweight requires a known `items_length` for iterators.
|
|
434
|
+
|
|
435
|
+
API quick links
|
|
436
|
+
~~~~~~~~~~~~~~~
|
|
437
|
+
|
|
438
|
+
- `FlowceptLoop API <https://flowcept.readthedocs.io/en/latest/api-reference.html#flowceptloop>`_
|
|
439
|
+
- `FlowceptLightweightLoop API <https://flowcept.readthedocs.io/en/latest/api-reference.html#flowceptlightweightloop>`_
|
|
440
|
+
|
|
441
|
+
Examples
|
|
442
|
+
~~~~~~~~
|
|
443
|
+
|
|
444
|
+
Per-iteration telemetry and streaming
|
|
445
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
446
|
+
|
|
447
|
+
.. code-block:: python
|
|
448
|
+
|
|
449
|
+
from time import sleep
|
|
450
|
+
from flowcept import Flowcept
|
|
451
|
+
from flowcept import FlowceptLoop
|
|
452
|
+
|
|
453
|
+
with Flowcept(workflow_name="telemetry_stream"):
|
|
454
|
+
loop = FlowceptLoop(range(5), loop_name="train_loop", item_name="epoch")
|
|
455
|
+
for epoch in loop:
|
|
456
|
+
loss = 0.1 * (5 - epoch)
|
|
457
|
+
sleep(0.02)
|
|
458
|
+
# Attach values produced inside this iteration
|
|
459
|
+
loop.end_iter({"loss": loss})
|
|
460
|
+
|
|
461
|
+
# Each iteration is sent with status and, if enabled, telemetry_at_end.
|
|
462
|
+
|
|
463
|
+
Ultra-low overhead and batched publish
|
|
464
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
465
|
+
|
|
466
|
+
.. code-block:: python
|
|
467
|
+
|
|
468
|
+
from flowcept import Flowcept
|
|
469
|
+
from flowcept import FlowceptLightweightLoop
|
|
470
|
+
|
|
471
|
+
data = [0, 1, 2, 3, 4]
|
|
472
|
+
|
|
473
|
+
with Flowcept(workflow_name="batched_publish"):
|
|
474
|
+
loop = FlowceptLightweightLoop(data, loop_name="eval_loop", item_name="batch")
|
|
475
|
+
for batch in loop:
|
|
476
|
+
metric = batch * 2
|
|
477
|
+
loop.end_iter({"metric": metric})
|
|
478
|
+
|
|
479
|
+
# All iteration tasks are published together after the loop completes.
|
|
480
|
+
|
|
481
|
+
Iterating an unknown-length iterator
|
|
482
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
483
|
+
|
|
484
|
+
.. code-block:: python
|
|
485
|
+
|
|
486
|
+
import itertools as it
|
|
487
|
+
from flowcept import Flowcept
|
|
488
|
+
from flowcept.instrumentation.loop import FlowceptLoop, FlowceptLightweightLoop
|
|
489
|
+
|
|
490
|
+
stream = it.islice(it.count(), 0, 100) # iterator without __len__
|
|
491
|
+
|
|
492
|
+
with Flowcept(workflow_name="iterators"):
|
|
493
|
+
# Option A: FlowceptLoop can materialize if you do not know the length,
|
|
494
|
+
# but this may be expensive for large streams.
|
|
495
|
+
loop_a = FlowceptLoop(stream, loop_name="loop_a", item_name="i", items_length=100)
|
|
496
|
+
for i in loop_a:
|
|
497
|
+
loop_a.end_iter({"v": i*i})
|
|
498
|
+
|
|
499
|
+
# Option B: Lightweight requires items_length for iterators.
|
|
500
|
+
stream2 = it.islice(it.count(), 0, 100)
|
|
501
|
+
loop_b = FlowceptLightweightLoop(stream2, loop_name="loop_b", item_name="i", items_length=100)
|
|
502
|
+
for i in loop_b:
|
|
503
|
+
loop_b.end_iter({"v": i*i})
|
|
504
|
+
|
|
505
|
+
Tips and caveats
|
|
506
|
+
~~~~~~~~~~~~~~~~
|
|
507
|
+
|
|
508
|
+
- Set `item_name` to control the key stored under `used`, for example `{"epoch": 3}` instead of `{"item": 3}`.
|
|
509
|
+
- Use `parent_task_id` to nest loop iterations under another task.
|
|
510
|
+
- For very large loops where you only need `used` and `generated`, prefer Lightweight to reduce interceptor calls.
|
|
511
|
+
- If you use FlowceptLoop with a huge iterator, pass `items_length` to avoid accidental materialization.
|
|
512
|
+
- Both classes honor `INSTRUMENTATION_ENABLED` and `capture_enabled`. If disabled, they behave like regular iterators and `end_iter(...)` becomes a no-op.
|
|
408
513
|
|
|
409
|
-
TODO
|
|
410
514
|
|
|
411
515
|
PyTorch Models
|
|
412
516
|
~~~~~~~~~~~~~~
|
|
@@ -485,7 +589,7 @@ See `MCP Agent example <https://github.com/ORNL/flowcept/blob/main/examples/agen
|
|
|
485
589
|
|
|
486
590
|
|
|
487
591
|
Custom Task Creation (fully customizable)
|
|
488
|
-
|
|
592
|
+
-----------------------------------------
|
|
489
593
|
|
|
490
594
|
Build tasks programmatically with ``FlowceptTask``—useful for non-decorator flows or custom payloads.
|
|
491
595
|
Requires an active workflow (``with Flowcept(...)`` or ``Flowcept().start()``).
|
|
@@ -506,10 +610,13 @@ Requires an active workflow (``with Flowcept(...)`` or ``Flowcept().start()``).
|
|
|
506
610
|
task.end({"records": 42})
|
|
507
611
|
task.send() # publishes to MQ
|
|
508
612
|
|
|
613
|
+
If you need to store something that is not publicly exposed in the API (yet), you can use the private instance of ``FlowceptTask._task`` to access the task object fields directly. If that happens, open an issue in the repository and we will try to expose that in the public API.
|
|
614
|
+
|
|
509
615
|
**Notes**:
|
|
510
616
|
|
|
511
617
|
- Use **context** (``with FlowceptTask(...)``) *or* call ``send()`` explicitly.
|
|
512
618
|
- Flows publish to the MQ; persistence/queries require a DB (e.g., MongoDB).
|
|
619
|
+
- See also: `FlowceptTask API reference <file:///Users/rsr/Documents/GDrive/ORNL/dev/flowcept/docs/_build/html/api-reference.html#flowcepttask>`_
|
|
513
620
|
- See also: `Consumer example <https://flowcept.readthedocs.io/en/latest/prov_storage.html#example-extending-the-base-consumer>`_
|
|
514
621
|
- See also: `Ping pong example via PubSub with Flowcept <https://github.com/ORNL/flowcept/blob/main/examples/consumers/ping_pong_example.py>`_
|
|
515
622
|
|
|
@@ -72,72 +72,85 @@ Below is a typical usage pattern:
|
|
|
72
72
|
|
|
73
73
|
The `DBAPI` exposes many other methods, such as `get_tasks_recursive` to retrieve all descendants of a task, or `dump_tasks_to_file_recursive` to export tasks to Parquet. See the API reference for details.
|
|
74
74
|
|
|
75
|
-
Accessing the
|
|
75
|
+
Accessing the in-memory buffer
|
|
76
76
|
------------------------------
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
Flowcept keeps recently captured messages in memory as a list of dictionaries. This is handy for debugging and lightweight scripts. In online mode the buffer may be flushed to the MQ periodically.
|
|
79
79
|
|
|
80
|
-
|
|
80
|
+
.. code-block:: python
|
|
81
|
+
|
|
82
|
+
from flowcept import Flowcept
|
|
83
|
+
|
|
84
|
+
with Flowcept(workflow_name="demo") as f:
|
|
85
|
+
# ... run your tasks ...
|
|
86
|
+
raw_list = f.get_buffer() # list[dict]
|
|
87
|
+
df = f.get_buffer(return_df=True) # pandas.DataFrame with dotted columns
|
|
88
|
+
assert "generated.attention" in df.columns
|
|
89
|
+
|
|
90
|
+
Dumping the buffer to disk (online or offline)
|
|
91
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
92
|
+
|
|
93
|
+
You can persist the buffer to a JSON Lines file in both offline and online runs.
|
|
81
94
|
|
|
82
95
|
.. code-block:: python
|
|
83
96
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
"mime_type": "image/png",
|
|
111
|
-
"file_name": "flowcept-logo.png",
|
|
112
|
-
"file_extension": "png"})
|
|
113
|
-
t.send()
|
|
114
|
-
|
|
115
|
-
# inspect the buffer
|
|
116
|
-
assert len(Flowcept.buffer) == 3 # includes the workflow message
|
|
117
|
-
assert Flowcept.buffer[1]["data"] # binary data is captured as bytes
|
|
118
|
-
|
|
119
|
-
At any point inside the running workflow you can access `Flowcept.buffer` to retrieve a list of dictionaries representing messages. Each element contains the original JSON payload plus any binary `data` field. Because the buffer lives in memory, it reflects the most recent state of the workflow and is cleared when the process ends.
|
|
120
|
-
|
|
121
|
-
Working Offline: Reading a Messages File
|
|
122
|
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
123
|
-
|
|
124
|
-
When persistence is enabled in offline mode, Flowcept dumps the buffer to a JSONL file. Use :func:`Flowcept.read_messages_file` to load these messages later. If you pass `return_df=True` Flowcept will normalise nested fields into dot‑separated columns and return a pandas DataFrame. This is handy for ad‑hoc analysis with pandas.
|
|
97
|
+
with Flowcept(workflow_name="demo") as f:
|
|
98
|
+
# ... run your tasks ...
|
|
99
|
+
f.dump_buffer() # uses settings path (see below)
|
|
100
|
+
f.dump_buffer(\"my_buffer.jsonl\") # custom path
|
|
101
|
+
|
|
102
|
+
Default configuration enables dumping to ``flowcept_buffer.jsonl``:
|
|
103
|
+
|
|
104
|
+
- ``\"project\": {\"dump_buffer\": {\"enabled\": True, \"path\": \"flowcept_buffer.jsonl\"}}``
|
|
105
|
+
|
|
106
|
+
You can control DB flushing and the buffer path in your settings:
|
|
107
|
+
|
|
108
|
+
.. code-block:: yaml
|
|
109
|
+
|
|
110
|
+
project:
|
|
111
|
+
db_flush_mode: online # \"online\" or \"offline\"
|
|
112
|
+
dump_buffer:
|
|
113
|
+
enabled: true
|
|
114
|
+
path: flowcept_buffer.jsonl
|
|
115
|
+
|
|
116
|
+
- **Offline mode**: set ``project.db_flush_mode: offline`` to keep messages local.
|
|
117
|
+
- **Online mode**: keep ``online``; you can still dump and read the file at any time.
|
|
118
|
+
|
|
119
|
+
Reading a buffer file (list or DataFrame)
|
|
120
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
121
|
+
|
|
122
|
+
Use :meth:`Flowcept.read_buffer_file` to load a buffer file later. If no file path is provided, the one configured in the settings.yaml will be used.
|
|
125
123
|
|
|
126
124
|
.. code-block:: python
|
|
127
125
|
|
|
128
|
-
|
|
126
|
+
from flowcept import Flowcept
|
|
129
127
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
128
|
+
# 1) List of dicts
|
|
129
|
+
msgs = Flowcept.read_buffer_file(\"flowcept_buffer.jsonl\")
|
|
130
|
+
print(f\"Loaded {len(msgs)} messages\")
|
|
131
|
+
|
|
132
|
+
# 2) DataFrame without flattening (nested dicts stay as objects)
|
|
133
|
+
df_raw = Flowcept.read_buffer_file(\"flowcept_buffer.jsonl\", return_df=True, normalize_df=False)
|
|
134
|
+
|
|
135
|
+
# 3) DataFrame with dotted columns (normalized)
|
|
136
|
+
df_norm = Flowcept.read_buffer_file(\"flowcept_buffer.jsonl\", return_df=True, normalize_df=True)
|
|
137
|
+
assert \"generated.attention\" in df_norm.columns
|
|
138
|
+
|
|
139
|
+
Deleting a buffer file
|
|
140
|
+
^^^^^^^^^^^^^^^^^^^^^^
|
|
141
|
+
|
|
142
|
+
.. code-block:: python
|
|
133
143
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
print("generated.attention" in df.columns)
|
|
144
|
+
from flowcept import Flowcept
|
|
145
|
+
Flowcept.delete_buffer_file() # deletes default path from settings
|
|
146
|
+
Flowcept.delete_buffer_file(\"my_buffer.jsonl\")
|
|
138
147
|
|
|
139
|
-
|
|
148
|
+
Notes
|
|
149
|
+
^^^^^
|
|
140
150
|
|
|
151
|
+
- DataFrame returns require ``pandas``. If you installed Flowcept with optional extras, ``pandas`` is included.
|
|
152
|
+
- Binary payloads, when present, are stored under the ``data`` key in the buffer messages. However, they are not stored in the buffer file.
|
|
153
|
+
- See also: `persisting the in-memory buffer. <https://flowcept.readthedocs.io/en/latest/prov_storage.html#saving-the-in-memory-buffer-to-disk>`_
|
|
141
154
|
|
|
142
155
|
Working Directly with MongoDB
|
|
143
156
|
-----------------------------
|
|
@@ -12,9 +12,9 @@ For optional persistence, you can choose between:
|
|
|
12
12
|
- `MongoDB <https://www.mongodb.com/>`_
|
|
13
13
|
A robust, service-based database with advanced query support.
|
|
14
14
|
Required to use Flowcept's Query API (``flowcept.Flowcept.db``) for complex queries and features like ML model management or runtime queries (query while writing).
|
|
15
|
-
To use MongoDB, start the service with ``make services-mongo``.
|
|
16
15
|
|
|
17
16
|
Flowcept supports writing to both databases simultaneously (default), individually, or to neither, depending on configuration.
|
|
17
|
+
See `setup instructions <https://flowcept.readthedocs.io/en/latest/setup.html#setup>`_.
|
|
18
18
|
|
|
19
19
|
If persistence is disabled, captured data is sent to the MQ without any default consumer subscribing to it.
|
|
20
20
|
In this case, querying requires writing a custom consumer to subscribe and store the data.
|
|
@@ -26,6 +26,95 @@ In this case, querying requires writing a custom consumer to subscribe and store
|
|
|
26
26
|
If neither is enabled, an error occurs.
|
|
27
27
|
Data stored in MongoDB and LMDB are interchangeable and can be transferred between them.
|
|
28
28
|
|
|
29
|
+
Saving the In-Memory Buffer to Disk
|
|
30
|
+
-----------------------------------
|
|
31
|
+
|
|
32
|
+
Flowcept can persist the in-memory message buffer to a **JSON Lines (JSONL)** file in both **offline** and **online** modes. This is useful for audits, simple centralized runs, and quick ad‑hoc analysis.
|
|
33
|
+
|
|
34
|
+
Configuration
|
|
35
|
+
^^^^^^^^^^^^^
|
|
36
|
+
|
|
37
|
+
Default dumping is enabled and writes to ``flowcept_buffer.jsonl``:
|
|
38
|
+
|
|
39
|
+
To favor local files (**offline**), set:
|
|
40
|
+
|
|
41
|
+
.. code-block:: yaml
|
|
42
|
+
|
|
43
|
+
project:
|
|
44
|
+
db_flush_mode: offline # keeps messages local (no DB writes)
|
|
45
|
+
dump_buffer:
|
|
46
|
+
enabled: true
|
|
47
|
+
path: flowcept_buffer.jsonl
|
|
48
|
+
|
|
49
|
+
For standard **online** runs (DB writes enabled) while still keeping a file copy:
|
|
50
|
+
|
|
51
|
+
.. code-block:: yaml
|
|
52
|
+
|
|
53
|
+
project:
|
|
54
|
+
db_flush_mode: online # default
|
|
55
|
+
dump_buffer:
|
|
56
|
+
enabled: true
|
|
57
|
+
path: flowcept_buffer.jsonl
|
|
58
|
+
|
|
59
|
+
Usage
|
|
60
|
+
^^^^^
|
|
61
|
+
|
|
62
|
+
Dump the buffer (during or at the end of a run):
|
|
63
|
+
|
|
64
|
+
.. code-block:: python
|
|
65
|
+
|
|
66
|
+
from flowcept import Flowcept
|
|
67
|
+
|
|
68
|
+
with Flowcept(workflow_name="demo") as f:
|
|
69
|
+
# ... your tasks ...
|
|
70
|
+
f.dump_buffer() # uses settings path
|
|
71
|
+
f.dump_buffer("my_buffer.jsonl") # custom path
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
Read the buffer file later (as list or DataFrame):
|
|
75
|
+
|
|
76
|
+
.. code-block:: python
|
|
77
|
+
|
|
78
|
+
from flowcept import Flowcept
|
|
79
|
+
|
|
80
|
+
# 1) List of dicts
|
|
81
|
+
msgs = Flowcept.read_buffer_file("flowcept_buffer.jsonl")
|
|
82
|
+
|
|
83
|
+
# 2) DataFrame without flattening (nested dicts stay as objects)
|
|
84
|
+
df_raw = Flowcept.read_buffer_file("flowcept_buffer.jsonl", return_df=True, normalize_df=False)
|
|
85
|
+
|
|
86
|
+
# 3) DataFrame with dotted columns (normalized)
|
|
87
|
+
df_norm = Flowcept.read_buffer_file("flowcept_buffer.jsonl", return_df=True, normalize_df=True)
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
Delete a buffer file if needed:
|
|
91
|
+
|
|
92
|
+
.. code-block:: python
|
|
93
|
+
|
|
94
|
+
from flowcept import Flowcept
|
|
95
|
+
Flowcept.delete_buffer_file() # deletes default path from settings
|
|
96
|
+
Flowcept.delete_buffer_file("my_buffer.jsonl")
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
.. note::
|
|
100
|
+
|
|
101
|
+
The file-based method is **best suited for offline mode** or small, centralized runs.
|
|
102
|
+
Each ``interceptor`` in a Flowcept instance maintains its own in-memory buffer.
|
|
103
|
+
In distributed settings (e.g., HPC jobs or distributed workflows), this creates separate buffer
|
|
104
|
+
files per interceptor. To run an end-to-end analysis, you must manually merge all files.
|
|
105
|
+
|
|
106
|
+
For distributed runs, prefer the **MongoDB** provenance storage option, which consolidates all
|
|
107
|
+
captured provenance into a single database automatically.
|
|
108
|
+
Alternatively, implement a **custom consumer** to centralize message ingestion and
|
|
109
|
+
enable real-time analysis.
|
|
110
|
+
|
|
111
|
+
See also
|
|
112
|
+
^^^^^^^^
|
|
113
|
+
|
|
114
|
+
- `Buffer querying <https://flowcept.readthedocs.io/en/latest/prov_query.html#accessing-the-in-memory-buffer>`_
|
|
115
|
+
- `Implementing a custom consumer <https://flowcept.readthedocs.io/en/latest/prov_storage.html#example-extending-the-base-consumer>`_
|
|
116
|
+
- `Flowcept API Reference <https://flowcept.readthedocs.io/en/latest/api-reference.html#main-flowcept-object>`_
|
|
117
|
+
|
|
29
118
|
---
|
|
30
119
|
|
|
31
120
|
Provenance Consumer
|
|
@@ -84,6 +173,7 @@ This can serve as a template for building custom provenance consumers.
|
|
|
84
173
|
consumer = MyConsumer()
|
|
85
174
|
consumer.start(daemon=False)
|
|
86
175
|
|
|
176
|
+
|
|
87
177
|
**Notes**:
|
|
88
178
|
|
|
89
179
|
- See also: `Explicit publish example <file:///Users/rsr/Documents/GDrive/ORNL/dev/flowcept/docs/_build/html/prov_capture.html#custom-task-creation-fully-customizable>`_
|