SIENTIAPDE-1222

Update image tag in values.yaml and enhance debug logging in Gates and MLFlow activities

- Updated the image tag in values.yaml from '0.0.1' to '0.0.2'.
- Improved debug logging in the Gates activity to format input data and filters for better readability.
- Enhanced MLFlow activity logging to include formatted output for raw and transformed response data, ensuring consistent logging format.
This commit is contained in:
vitor-aignosi
2025-09-16 10:22:51 -03:00
parent 41af0a8032
commit eefd0815d8
4 changed files with 14 additions and 15 deletions

View File

@@ -206,8 +206,8 @@ class Gates(BaseActivity):
filter_output = [] filter_output = []
self.debug(create_sample_dict( self.debug(f"Input data: \n {create_sample_dict(
data, max_items=5, max_depth=2), metadata) data, max_items=5, max_depth=2)}", metadata)
self.debug(f"Filters: {filters}", metadata) self.debug(f"Filters: {filters}", metadata)
comments = [] comments = []
@@ -293,7 +293,7 @@ class Gates(BaseActivity):
filter_output = [] filter_output = []
self.debug(f"Input data:\n {data.head(5).to_string()}", metadata) self.debug(f"Input data:\n {data.head(5).to_string()}", metadata)
self.debug(create_sample_dict(filters), metadata) self.debug(f"Filters: \n {create_sample_dict(filters)}", metadata)
for fil, config in filters.items(): for fil, config in filters.items():
if fil not in mlflow_content_filter_functions: if fil not in mlflow_content_filter_functions:

View File

@@ -161,9 +161,8 @@ class MLFlow(BaseActivity):
model_name, data, model_config model_name, data, model_config
) )
self.debug("Transform raw response data:", metadata) self.debug(f"Transform raw response data: \n {create_sample_dict(
self.debug(create_sample_dict( response_data)}", metadata)
response_data), metadata)
if response_data['success']: if response_data['success']:
@@ -194,9 +193,8 @@ class MLFlow(BaseActivity):
response_data['content'] = response_dataframe.to_dict() response_data['content'] = response_dataframe.to_dict()
self.debug("Transform response data:", metadata) self.debug(f"Transform response data: \n {create_sample_dict(
self.debug(create_sample_dict( response_data)}", metadata)
response_data), metadata)
self.info("Data transformed successfully", metadata) self.info("Data transformed successfully", metadata)
@@ -248,9 +246,8 @@ class MLFlow(BaseActivity):
model_name, data, model_config model_name, data, model_config
) )
self.debug("Prediction response data:", metadata) self.debug(f"Prediction response data: \n {create_sample_dict(
self.debug(create_sample_dict( response_data)}", metadata)
response_data), metadata)
self.info("Data predicted successfully", metadata) self.info("Data predicted successfully", metadata)

View File

@@ -24,6 +24,7 @@ class MLFlowRepository():
self.model_serving = ModelServing(tracking_uri=host, self.model_serving = ModelServing(tracking_uri=host,
username=username, password=password, username=username, password=password,
logger=logger) logger=logger)
self.logger = logger
def transform(self, model_name: str, data: pd.DataFrame, model_config: dict) -> dict: def transform(self, model_name: str, data: pd.DataFrame, model_config: dict) -> dict:
""" """
@@ -90,7 +91,8 @@ class MLFlowRepository():
end_time = datetime.now() end_time = datetime.now()
data = pd.DataFrame(data, columns=['prediction']) data = pd.DataFrame(data, columns=['prediction'])
self.logger.info(f"Data: {data.to_string()}") self.logger.info(
f"Data received from model prediction: {data.to_string()}")
data.index = input_index data.index = input_index
data['response_time'] = (end_time - start_time).total_seconds() data['response_time'] = (end_time - start_time).total_seconds()

View File

@@ -11,9 +11,9 @@ image:
# This sets the pull policy for images. # This sets the pull policy for images.
pullPolicy: Always pullPolicy: Always
# Overrides the image tag whose default is the chart appVersion. # Overrides the image tag whose default is the chart appVersion.
tag: "0.0.1" tag: "0.0.2"
# This is for the secrets for pulling an image from a private repository more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ 0# This is for the secrets for pulling an image from a private repository more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
imagePullSecrets: imagePullSecrets:
- name: docker-hub-secret - name: docker-hub-secret
# This is to override the chart name. # This is to override the chart name.