How rajkp10/orchestration works
This is an event-driven infrastructure orchestrator for PostgreSQL lifecycle changes. A caller submits a lifecycle event through the trigger, which parses it and starts a Temporal workflow; the workflow validates the request, applies Terraform changes, verifies the live resource, and reports a result. Activities resolve a platform adapter and use per-resource Terraform workspaces. The README documents provision, patch, decommission, duplicate handling, status queries, and failure outcomes. Some implementation details are unsampled; edges below are limited to shown calls or documented behavior.
Main entry points: workflow.py Lifecycle workflow · postgres.py Live verification · trigger.py Trigger CLI · activities.py Terraform activity
Components 21
Event entry
- Trigger CLI
orchestrator/trigger.py - Event parser
orchestrator/events.py - Lifecycle models
orchestrator/models.py - Result JSON record
orchestrator/config.py
Temporal orchestration
- Temporal service
- Lifecycle workflow
orchestrator/workflow.py - Temporal worker
orchestrator/worker.py - Activity dispatch
orchestrator/activities.py - Result reporting
orchestrator/activities.py
Platform lifecycle
- Request validation
orchestrator/activities.py - Adapter registry
orchestrator/platforms/registry.py - Adapter contract
orchestrator/platforms/base.py - Postgres lifecycle
orchestrator/platforms/postgres.py - Live verification
orchestrator/platforms/postgres.py
Infrastructure execution
- Terraform activity
orchestrator/activities.py - Terraform runner
orchestrator/terraform/runner.py - Error classifier
orchestrator/terraform/classifier.py - Postgres module
terraform/modules/postgres/main.tf
Other components
- Event caller
- Docker engine
- Postgres container
Connections 30
- Event caller → Trigger CLI: submits event
README.md - Trigger CLI → Event parser: parses event
orchestrator/trigger.py - Trigger CLI → Temporal service: starts workflow
orchestrator/trigger.py - Trigger CLI → Lifecycle workflow: starts
orchestrator/trigger.py - Trigger CLI → Lifecycle workflow: queries status
orchestrator/trigger.py - Temporal worker → Temporal service: connects to
orchestrator/worker.py - Temporal worker → Lifecycle workflow: registers
orchestrator/worker.py - Temporal worker → Activity dispatch: registers
orchestrator/worker.py - Lifecycle workflow → Request validation: executes
orchestrator/workflow.py - Lifecycle workflow → Terraform activity: executes
orchestrator/workflow.py - Lifecycle workflow → Live verification: executes
orchestrator/workflow.py - Lifecycle workflow → Result reporting: reports outcome
orchestrator/workflow.py - Request validation → Adapter registry: resolves adapter
orchestrator/activities.py - Terraform activity → Adapter registry: resolves adapter
orchestrator/activities.py - Live verification → Adapter registry: resolves adapter
orchestrator/platforms/registry.py - Adapter registry → Postgres lifecycle: registers
orchestrator/platforms/registry.py - Adapter registry → Adapter contract: uses contract
orchestrator/platforms/registry.py - Request validation → Postgres lifecycle: validates request
orchestrator/activities.py - Terraform activity → Postgres lifecycle: builds variables
orchestrator/activities.py - Live verification → Postgres lifecycle: checks resource
orchestrator/platforms/postgres.py - Request validation → Terraform runner: reads state
orchestrator/activities.py - Terraform activity → Terraform runner: applies or destroys
orchestrator/activities.py - Live verification → Terraform runner: reads outputs
- Terraform runner → Error classifier: classifies errors
orchestrator/terraform/runner.py - Terraform activity → Postgres module: selects module
- Postgres module → Docker engine: manages containers
README.md - Docker engine → Postgres container: hosts
README.md - Live verification → Postgres container: checks live database
orchestrator/platforms/postgres.py - Live verification → Docker engine: checks removal
orchestrator/platforms/postgres.py - Result reporting → Result JSON record: writes result
orchestrator/activities.py