-
Notifications
You must be signed in to change notification settings - Fork 0
Base_stories
US High-Level Project Jobs : Manage the execution context for high-level project jobs with integrated services.
- US High-Level Project Jobs : Manage the execution context for high-level project jobs with integrated services.
classDiagram
class Job {
<<abstract>>
+KIND: str
+logger_service: services.LoggerService = services.LoggerService()
+alerts_service: services.AlertsService = services.AlertsService()
+mlflow_service: services.MlflowService = services.MlflowService()
+__enter__() T.Self
+__exit__(exc_type, exc_value, exc_traceback) Literal[False]
+run()* Locals
}
class LoggerService {
+start() None
+stop() None
+logger() Logger
}
class AlertsService {
+start() None
+stop() None
}
class MlflowService {
+start() None
+stop() None
}
Job --|> pdt.BaseModel : inherits
Job --|> abc.ABC : inherits
Job *-- LoggerService : composes
Job *-- AlertsService : composes
Job *-- MlflowService : composes
Job ..> Locals : returns
Title:
As a developer, I want to define a context for executing high-level jobs, so that proper setup and teardown procedures for integrated services are followed.
Description:
The Job class serves as a base for executing high-level project jobs while managing the lifecycle of various services, including logging, alerts, and MLflow tracking. By using context management, it ensures that services are correctly initialized and cleaned up.
Acceptance Criteria:
- The
__enter__method initializes relevant services when entering the context. - The
__exit__method cleans up and stops services when exiting the context. - Exceptions that occur during execution are properly propagated.
Title:
As a developer, I want to integrate a logging service within my job context, so that I can monitor the job execution process through logs.
Description:
The logger_service attribute of the Job class allows for logging messages during the execution of the job, enabling visibility into the processing stages.
Acceptance Criteria:
- Logging is initialized as soon as a job context is entered.
- Log messages provide insights into the status of services being used (logger service, alerts service, MLflow service).
- Cleanup of the logging service occurs upon exit of the job context.
Title:
As a developer, I want to manage an alerts service during job execution, so that important events or errors can be communicated as notifications.
Description:
The alerts_service attribute allows the job to manage notifications regarding alerting mechanisms, keeping the user informed about crucial events.
Acceptance Criteria:
- The alerts service is started when entering the job context.
- Notifications related to the job execution can be triggered through the alerts service.
- The alerts service is stopped appropriately after job execution.
Title:
As a data scientist, I want to integrate MLflow tracking during job execution, so I can automatically log models, parameters, and metrics to the MLflow server.
Description:
The mlflow_service attribute enables the job to track experiments and model metrics, making it easier to analyze the performance of various models.
Acceptance Criteria:
- The MLflow service should be started in the job context, allowing active tracking of the job.
- All relevant information logged during job execution should be captured via MLflow.
- The MLflow service should be stopped properly when exiting the context.
-
Implementation Requirements:
- The
Jobclass is abstract and cannot be instantiated directly; all subclasses must implement therunmethod. - The context management methods (
__enter__,__exit__) must be properly implemented.
- The
-
Error Handling:
- Any exceptions triggered in the context must be captured and logged appropriately, ensuring they propagate upwards for further handling.
-
Testing:
- Unit tests validate the context management behavior, ensuring services are started and stopped correctly without leaks or errors.
- Tests check the logging output and alert notifications during execution.
-
Documentation:
- Each class and method should have clear docstrings explaining their purpose and usage.
- Examples of extending the Job class for specific job implementations should be included.
- The
Jobclass is fully implemented with the required methods. - Subclasses of
Jobare created and demonstrate expected behavior during execution. - All functionality has been tested and passes the relevant unit tests.
- Documentation is comprehensive, with clear examples for users.
Powered by MLOps Factory