SIENTIAPDE-1174
SIENTIAPDE-1174 Add pod_id initialization in Activities class and update Scouter to reference it for improved consistency in environment variable handling.
This commit is contained in:
@@ -8,6 +8,7 @@ with workflow.unsafe.imports_passed_through():
|
|||||||
from scouter.activities.gates import Gates
|
from scouter.activities.gates import Gates
|
||||||
from scouter.activities.mongodb import MongoDB
|
from scouter.activities.mongodb import MongoDB
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
from os import getenv
|
||||||
|
|
||||||
|
|
||||||
class Activities(Postgres, Redis, Gates, MongoDB,):
|
class Activities(Postgres, Redis, Gates, MongoDB,):
|
||||||
@@ -61,6 +62,8 @@ class Activities(Postgres, Redis, Gates, MongoDB,):
|
|||||||
notification_handler=notification_handler
|
notification_handler=notification_handler
|
||||||
)
|
)
|
||||||
|
|
||||||
|
self.pod_id = getenv("HOSTNAME", "localhost")
|
||||||
|
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
Postgres.close(self)
|
Postgres.close(self)
|
||||||
MongoDB.shutdown(self)
|
MongoDB.shutdown(self)
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ class Scouter:
|
|||||||
'model_name': input_data['model_name'],
|
'model_name': input_data['model_name'],
|
||||||
'schedule_name': input_data['schedule_name'],
|
'schedule_name': input_data['schedule_name'],
|
||||||
'workflow_name': input_data['workflow_name'],
|
'workflow_name': input_data['workflow_name'],
|
||||||
'pod_id': getenv("HOSTNAME", "localhost")
|
'pod_id': Activities.pod_id
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user