SIENTIAPDE-1646
Update GITHUB_BRANCH in values.yaml to feature/SIENTIAPDE-1646, refactor mongo_db.py for cleaner code, and enhance worker.py by adding missing commas for improved syntax consistency.
This commit is contained in:
@@ -2,7 +2,7 @@ from temporalio import activity, workflow
|
|||||||
|
|
||||||
with workflow.unsafe.imports_passed_through():
|
with workflow.unsafe.imports_passed_through():
|
||||||
import traceback
|
import traceback
|
||||||
from datetime import UTC, datetime
|
from datetime import UTC
|
||||||
from logging import Logger
|
from logging import Logger
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
@@ -147,9 +147,7 @@ class MongoDB(SientiaMonitoring):
|
|||||||
raise e
|
raise e
|
||||||
|
|
||||||
@activity.defn(name='aggregate_documents_in_mongodb')
|
@activity.defn(name='aggregate_documents_in_mongodb')
|
||||||
def aggregate_documents_in_mongodb(
|
def aggregate_documents_in_mongodb(self, input_data: dict[str, Any]) -> list[dict[str, Any]]:
|
||||||
self, input_data: dict[str, Any]
|
|
||||||
) -> list[dict[str, Any]]:
|
|
||||||
"""
|
"""
|
||||||
Aggregate documents in a MongoDB collection based on the provided aggregation pipeline.
|
Aggregate documents in a MongoDB collection based on the provided aggregation pipeline.
|
||||||
|
|
||||||
@@ -344,9 +342,7 @@ class MongoDB(SientiaMonitoring):
|
|||||||
data_filter = {'$or': argument} if argument else {}
|
data_filter = {'$or': argument} if argument else {}
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.mongo_db_repository.delete_many(
|
self.mongo_db_repository.delete_many('orchestrated_schedules', data_filter, metadata)
|
||||||
'orchestrated_schedules', data_filter, metadata
|
|
||||||
)
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
trace = traceback.format_exc()
|
trace = traceback.format_exc()
|
||||||
self.send_notification(
|
self.send_notification(
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ async def main():
|
|||||||
activities.report_slot_orchestration,
|
activities.report_slot_orchestration,
|
||||||
activities.format_schedule_config,
|
activities.format_schedule_config,
|
||||||
],
|
],
|
||||||
logger=logger
|
logger=logger,
|
||||||
),
|
),
|
||||||
prepare_worker(
|
prepare_worker(
|
||||||
temporal_client=temporal_client,
|
temporal_client=temporal_client,
|
||||||
@@ -158,7 +158,7 @@ async def main():
|
|||||||
# Store notification cache
|
# Store notification cache
|
||||||
activities.store_notification_cache,
|
activities.store_notification_cache,
|
||||||
],
|
],
|
||||||
logger=logger
|
logger=logger,
|
||||||
),
|
),
|
||||||
prepare_worker(
|
prepare_worker(
|
||||||
temporal_client=temporal_client,
|
temporal_client=temporal_client,
|
||||||
@@ -178,7 +178,7 @@ async def main():
|
|||||||
activities.format_log_report,
|
activities.format_log_report,
|
||||||
activities.export_data_to_postgres,
|
activities.export_data_to_postgres,
|
||||||
],
|
],
|
||||||
logger=logger
|
logger=logger,
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ env:
|
|||||||
- name: GITHUB_REPO_URL
|
- name: GITHUB_REPO_URL
|
||||||
value: "git@github.com:Aignosi/sientia-dataops-orchestrator_temporal.git"
|
value: "git@github.com:Aignosi/sientia-dataops-orchestrator_temporal.git"
|
||||||
- name: GITHUB_BRANCH
|
- name: GITHUB_BRANCH
|
||||||
value: "fix/SIENTIAPDE-1712"
|
value: "feature/SIENTIAPDE-1646"
|
||||||
- name: PYTHON_APP
|
- name: PYTHON_APP
|
||||||
value: "orchestrator.worker.worker"
|
value: "orchestrator.worker.worker"
|
||||||
|
|
||||||
@@ -263,3 +263,5 @@ ssh:
|
|||||||
# kubectl create secret generic smtp-credentials \
|
# kubectl create secret generic smtp-credentials \
|
||||||
# --namespace sientia \
|
# --namespace sientia \
|
||||||
# --from-literal=app_password='sua-senha-de-app-de-16-digitos'
|
# --from-literal=app_password='sua-senha-de-app-de-16-digitos'
|
||||||
|
|
||||||
|
# helm upgrade --install sientia-orchestrator-worker /home/grezewave/Documents/projects/sientia/sientia-core-applications/sientia-module -n sientia --create-namespace -f ./values.yaml
|
||||||
Reference in New Issue
Block a user