How d10s0vsky-oss/stack-lifecycle-deployment works
Main Components
• API Backend (sld-api-backend): This “brain” of the system exposes a FastAPI REST interface, implements domain-driven design (with dedicated modules for cloud providers such as AWS, Azure, GCP, custom providers, users, tasks, deploys, stacks, etc.), and integrates with external services.
• Dashboard (sld-dashboard): A web-based UI (based on volt-dashboard and Flask) that interacts with the API to let users manage accounts, stacks, deployments, and schedules.
• Remote State Service (sld-remote-state): Manages Terraform state files (with backends like MongoDB, S3, Azure, or local storage) and provides a way to remotely lock/unlock state during deployments.
• Scheduler (sld-schedule): Manages scheduled deployments and infrastructure lifecycle events.
• Workers: These are distributed task executors (using Celery) grouped by “squad” (e.g., worker-squad1, worker-squad2) that process deployment, destroy and other asynchronous tasks.
• Supporting Infrastructure: External service dependencies such as message brokers (RabbitMQ, Redis), databases (MongoDB for remote state), and cloud storage integrations.
Out Component Relationships and Interactions
• Users connect to the Dashboard for a front-end experience which, in turn, communicates with the API Backend.
• The API Backend orchestrates deployments, interacts with internal modules (for cloud providers, deploys, users, variables, tasks, etc.), and distributes tasks asynchronously via Celery.
• Workers (task executors) consume tasks from a broker (RabbitMQ, Redis) to run deployments and interact with the infrastructure as code modules (invoking Terraform commands).
• The Remote State service is used by the API and deployment tasks to store and retrieve state files; it interacts with various backends per configuration.
• The Scheduler service triggers periodic deployment or destruction events and calls into the backend services to drive these operations.
Architectural Patterns and Design Principles
• Microservices Architecture – Separate services for API, UI, state management, scheduling, and background workers.
• Asynchronous Task Processing – Use of Celery for executing long-running tasks (with separate worker deployments per squad).
• Domain-Driven Design – SLD’s API backend is organized into clear modules (e.g., activity logs, cloud providers, deployment, stacks, users, variables, worker, etc.) following clean boundaries (API, Domain, Infrastructure, and Application layers).
• Containerization & Orchestration – Dockerfiles for individual services and Kubernetes manifests (with Helm/Kustomize patterns) that support deployment, scaling, and service discovery.
• Cloud-Agnostic Integration – Multiple provider directories (aws, azure, gcp, custom) indicating plug-in points for various cloud integrations.
Relevant Technologies
• FastAPI (for the API backend)
• Flask with volt-dashboard (for the UI)
• Celery (for task distribution)
• Terraform (for IaC)
• Docker & Kubernetes (as deployment environments)
• Cloud-specific integrations for AWS, Azure, and GCP (in the backend modules)
• Supporting tools: RabbitMQ, Redis, MongoDB, S3 storage, etc.
Elements
• A labeled block for the “Dashboard” (user-facing web UI).
• A labeled block for the “API Backend” (with modules for cloud provider integration, deployment, users, stacks, etc.).
• Separate blocks for “Remote State” and “Scheduler” services.
• Blocks for “Worker” services with annotations indicating “squad1”, “squad2”, etc.
• External dependencies (message brokers, databases, storage backends).
• User interactions flowing into the Dashboard.
• Dashboard communicating with the API.
• API dispatching tasks to the workers.
• API and Workers interacting with the Remote State service.
• Scheduling events triggering deployments via the API.
• Annotations for container orchestration and deployment environments (Docker-compose and Kubernetes namespaces).