refactor: remove all postgresql related
Some checks failed
Build Worker Base and Application Images / check-base-changes (push) Successful in 7s
Build Worker Base and Application Images / build-base (push) Has been skipped
Build Worker Base and Application Images / build-docker (push) Successful in 2m38s
Build Worker Base and Application Images / deploy-stack (push) Failing after 16s

This commit is contained in:
ziesorx 2025-11-03 17:20:19 +07:00
parent d1276885c0
commit eb9bedae67
6 changed files with 545 additions and 497 deletions

View file

@ -11,7 +11,7 @@ from .pipeline import (
Action,
ActionType,
RedisConfig,
PostgreSQLConfig
# PostgreSQLConfig # Disabled - moved to microservices
)
from .inference import (
YOLOWrapper,
@ -32,7 +32,7 @@ __all__ = [
'Action',
'ActionType',
'RedisConfig',
'PostgreSQLConfig',
# 'PostgreSQLConfig', # Disabled - moved to microservices
# Inference
'YOLOWrapper',

View file

@ -16,6 +16,8 @@ class ActionType(Enum):
"""Supported action types in pipeline"""
REDIS_SAVE_IMAGE = "redis_save_image"
REDIS_PUBLISH = "redis_publish"
# PostgreSQL actions below are DEPRECATED - kept for backward compatibility only
# These actions will be silently skipped during pipeline execution
POSTGRESQL_UPDATE = "postgresql_update"
POSTGRESQL_UPDATE_COMBINED = "postgresql_update_combined"
POSTGRESQL_INSERT = "postgresql_insert"
@ -41,7 +43,15 @@ class RedisConfig:
@dataclass
class PostgreSQLConfig:
"""PostgreSQL connection configuration"""
"""
PostgreSQL connection configuration - DISABLED
NOTE: This configuration is kept for backward compatibility with existing
pipeline.json files, but PostgreSQL operations are disabled. All database
operations have been moved to microservices architecture.
This config will be parsed but not used for any database connections.
"""
host: str
port: int
database: str
@ -50,6 +60,7 @@ class PostgreSQLConfig:
@classmethod
def from_dict(cls, data: Dict[str, Any]) -> 'PostgreSQLConfig':
"""Parse PostgreSQL config from dict (kept for backward compatibility)"""
return cls(
host=data['host'],
port=data.get('port', 5432),
@ -272,17 +283,19 @@ class PipelineParser:
if not self._validate_actions(self.pipeline_config):
return False
# Validate parallel actions
# Validate parallel actions (PostgreSQL actions are skipped)
for action in self.pipeline_config.parallel_actions:
if action.type == ActionType.POSTGRESQL_UPDATE_COMBINED:
wait_for = action.params.get('waitForBranches', [])
if wait_for:
# Check that referenced branches exist
branch_ids = self._get_all_branch_ids(self.pipeline_config)
for branch_id in wait_for:
if branch_id not in branch_ids:
logger.error(f"Referenced branch '{branch_id}' in waitForBranches not found")
return False
logger.warning(f"PostgreSQL parallel action {action.type.value} found but will be SKIPPED (PostgreSQL disabled)")
# Skip validation for PostgreSQL actions since they won't be executed
# wait_for = action.params.get('waitForBranches', [])
# if wait_for:
# # Check that referenced branches exist
# branch_ids = self._get_all_branch_ids(self.pipeline_config)
# for branch_id in wait_for:
# if branch_id not in branch_ids:
# logger.error(f"Referenced branch '{branch_id}' in waitForBranches not found")
# return False
logger.info("Pipeline configuration validated successfully")
return True
@ -305,11 +318,14 @@ class PipelineParser:
logger.error(f"Action {action.type} requires Redis configuration")
return False
# Validate PostgreSQL actions need PostgreSQL config
# PostgreSQL actions are disabled - log warning instead of failing
# Kept for backward compatibility with existing pipeline.json files
if action.type in [ActionType.POSTGRESQL_UPDATE, ActionType.POSTGRESQL_UPDATE_COMBINED, ActionType.POSTGRESQL_INSERT]:
if not self.postgresql_config:
logger.error(f"Action {action.type} requires PostgreSQL configuration")
return False
logger.warning(f"PostgreSQL action {action.type.value} found but will be SKIPPED (PostgreSQL disabled)")
# Do not fail validation - just skip these actions during execution
# if not self.postgresql_config:
# logger.error(f"Action {action.type} requires PostgreSQL configuration")
# return False
# Recursively validate branches
if hasattr(config, 'branches'):