feat: integrate PluginStore and MinIO repository into model manager activities
- Added PluginStore integration for model management. - Replaced StorageRepository with MinIORepository in Activities, Cleanup, and Training classes. - Updated training logic to handle validation files and improved data management. - Enhanced configuration for MinIO and PluginStore in connectors. - Removed deprecated model repository and storage repository files. - Updated environment variable handling for new configurations.
This commit is contained in:
@@ -289,17 +289,18 @@ def run_local_pipeline(
|
||||
csv_path: Path,
|
||||
save_mlflow: bool = False,
|
||||
) -> dict:
|
||||
"""Run the same training pipeline locally (validate + train + after_train).
|
||||
"""Run the same training pipeline locally (validate + train + metrics).
|
||||
|
||||
Reads CSV from disk, runs TrainingRepository.train and after_train_calculation.
|
||||
Optionally saves to MLflow if save_mlflow is True (requires MLflow env).
|
||||
Reads CSV from disk, runs DataManagerRepository.prepare_training_data and
|
||||
compute_regression_metrics. Optionally saves to MLflow if save_mlflow is
|
||||
True (requires MLflow env).
|
||||
|
||||
Returns:
|
||||
dict: {'success': bool, 'error': str | None, 'scenario': str, ...}
|
||||
"""
|
||||
from model_manager.utils.logger_helper import get_logger
|
||||
from model_manager.utils.models.train_model_params import TrainModelParams
|
||||
from model_manager.utils.repository.training_repository import TrainingRepository
|
||||
from model_manager.utils.repository.data_manager_repository import DataManagerRepository
|
||||
|
||||
result = {
|
||||
'scenario': scenario_name,
|
||||
@@ -327,14 +328,22 @@ def run_local_pipeline(
|
||||
return result
|
||||
|
||||
logger = get_logger(__name__)
|
||||
training_repository = TrainingRepository(logger)
|
||||
data_manager_repository = DataManagerRepository(logger)
|
||||
|
||||
with open(csv_path, 'rb') as f:
|
||||
file_content = BytesIO(f.read())
|
||||
|
||||
try:
|
||||
train_result = training_repository.train(file_content, train_params)
|
||||
train_result = training_repository.after_train_calculation(train_params, train_result)
|
||||
train_result = data_manager_repository.prepare_training_data(
|
||||
train_file_bytes=file_content.getvalue(),
|
||||
validation_file_bytes=None,
|
||||
params=train_params,
|
||||
metadata={'source': 'run_local_pipeline', 'scenario': scenario_name},
|
||||
)
|
||||
train_result = data_manager_repository.compute_regression_metrics(
|
||||
train_params,
|
||||
train_result,
|
||||
)
|
||||
except Exception as e:
|
||||
result['error'] = str(e)
|
||||
raise # re-raise so caller gets full traceback for diagnosis
|
||||
|
||||
Reference in New Issue
Block a user