From 3083ca8a55cb75fc6ca44926fcc894dacd39dff9 Mon Sep 17 00:00:00 2001 From: Renan Souza Date: Wed, 18 Dec 2024 09:05:40 -0500 Subject: [PATCH] Fix dockerfile --- deployment/Dockerfile | 2 +- src/flowcept/commons/daos/docdb_dao/docdb_dao_base.py | 3 +++ src/flowcept/commons/daos/docdb_dao/lmdb_dao.py | 2 +- src/flowcept/commons/daos/docdb_dao/mongodb_dao.py | 2 +- src/flowcept/flowcept_api/flowcept_controller.py | 7 +++++-- src/flowcept/instrumentation/flowcept_task.py | 2 +- 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/deployment/Dockerfile b/deployment/Dockerfile index 111df73c..95106079 100644 --- a/deployment/Dockerfile +++ b/deployment/Dockerfile @@ -22,6 +22,6 @@ RUN conda create -n flowcept python=3.11.10 -y \ # The following command is an overkill and will install many things you might not need. Please modify this Dockerfile in case you do not need to install "all" dependencies. RUN conda run -n flowcept pip install -e .[all] -RUN conda run -n flowcept pip install -e .[ml_all] +RUN conda run -n flowcept pip install -e .[ml_dev] CMD ["bash"] diff --git a/src/flowcept/commons/daos/docdb_dao/docdb_dao_base.py b/src/flowcept/commons/daos/docdb_dao/docdb_dao_base.py index 1efb7d6d..cdb9ab23 100644 --- a/src/flowcept/commons/daos/docdb_dao/docdb_dao_base.py +++ b/src/flowcept/commons/daos/docdb_dao/docdb_dao_base.py @@ -60,15 +60,18 @@ def get_instance(*args, **kwargs) -> "DocumentDBDAO": if MONGO_ENABLED: from flowcept.commons.daos.docdb_dao.mongodb_dao import MongoDBDAO + DocumentDBDAO._instance = MongoDBDAO(*args, **kwargs) elif LMDB_ENABLED: from flowcept.commons.daos.docdb_dao.lmdb_dao import LMDBDAO + DocumentDBDAO._instance = LMDBDAO() else: raise NotImplementedError # TODO: revise, this below may be better in subclasses DocumentDBDAO._instance._initialized = True return DocumentDBDAO._instance + def close(self): """Close DAO connections and release resources.""" del DocumentDBDAO._instance diff --git a/src/flowcept/commons/daos/docdb_dao/lmdb_dao.py b/src/flowcept/commons/daos/docdb_dao/lmdb_dao.py index f6fdd3b3..2acd6123 100644 --- a/src/flowcept/commons/daos/docdb_dao/lmdb_dao.py +++ b/src/flowcept/commons/daos/docdb_dao/lmdb_dao.py @@ -30,7 +30,7 @@ class LMDBDAO(DocumentDBDAO): # return DocumentDBDAO._instance def __init__(self): - #if not hasattr(self, "_initialized"): + # if not hasattr(self, "_initialized"): self._initialized = True self._open() diff --git a/src/flowcept/commons/daos/docdb_dao/mongodb_dao.py b/src/flowcept/commons/daos/docdb_dao/mongodb_dao.py index a180decb..217eb07d 100644 --- a/src/flowcept/commons/daos/docdb_dao/mongodb_dao.py +++ b/src/flowcept/commons/daos/docdb_dao/mongodb_dao.py @@ -49,7 +49,7 @@ class MongoDBDAO(DocumentDBDAO): # return DocumentDBDAO._instance def __init__(self, create_indices=MONGO_CREATE_INDEX): - #if not hasattr(self, "_initialized"): + # if not hasattr(self, "_initialized"): from flowcept.configs import ( MONGO_HOST, MONGO_PORT, diff --git a/src/flowcept/flowcept_api/flowcept_controller.py b/src/flowcept/flowcept_api/flowcept_controller.py index 56d4b4b4..9975d760 100644 --- a/src/flowcept/flowcept_api/flowcept_controller.py +++ b/src/flowcept/flowcept_api/flowcept_controller.py @@ -131,12 +131,15 @@ def start(self): def _init_persistence(self, mq_host=None, mq_port=None): from flowcept.flowceptor.consumers.document_inserter import DocumentInserter - self._db_inserters.append(DocumentInserter( + + self._db_inserters.append( + DocumentInserter( check_safe_stops=True, bundle_exec_id=self._bundle_exec_id, mq_host=mq_host, mq_port=mq_port, - ).start()) + ).start() + ) def stop(self): """Stop it.""" diff --git a/src/flowcept/instrumentation/flowcept_task.py b/src/flowcept/instrumentation/flowcept_task.py index 1e91867a..be4b1630 100644 --- a/src/flowcept/instrumentation/flowcept_task.py +++ b/src/flowcept/instrumentation/flowcept_task.py @@ -86,7 +86,7 @@ def wrapper(*args, **kwargs): task_dict = dict( type="task", # User must explicitly set workflow_id in kwargs to reduce overhead finding for it - #workflow_id=kwargs.pop("workflow_id", None), + # workflow_id=kwargs.pop("workflow_id", None), activity_id=func.__name__, used=kwargs, generated=result,