Skip to content

Multi-Cloud Provider Abstraction Layer (Production Blocker)

Multi-Cloud Provider Abstraction Layer

Priority: CRITICAL (Production Blocker)
Status: Not Started
Estimated Time: 3-5 days

Description

Create the foundation for multi-cloud support by implementing a provider abstraction layer that allows Genesis to work with any infrastructure provider.

Implementation Details

  1. Create Provider Interface (app/services/providers/base_provider.py):
from abc import ABC, abstractmethod

class CloudProvider(ABC):
    @abstractmethod
    async def create_instance(self, config: Dict) -> Dict:
        """Create compute instance"""
        pass
    
    @abstractmethod
    async def start_instance(self, instance_id: str) -> bool:
        pass
    
    @abstractmethod
    async def stop_instance(self, instance_id: str) -> bool:
        pass
    
    @abstractmethod
    async def delete_instance(self, instance_id: str) -> bool:
        pass
    
    @abstractmethod
    async def get_instance_status(self, instance_id: str) -> Dict:
        pass
    
    @abstractmethod
    async def test_connection(self) -> bool:
        pass
  1. Database Schema Update:

    • Create CloudProviderConfig model
    • Fields: name, provider_type, config_encrypted, is_primary, is_active, priority, region, last_health_check, is_healthy
  2. Update Container Model:

    • Add provider_id, provider_type, provider_resource_id, provider_region, provider_metadata fields
  3. Refactor Proxmox Integration:

    • Create ProxmoxProvider class implementing CloudProvider
    • Migrate existing ProxmoxServer to new architecture
    • Update ProxmoxService to use new pattern
  4. Update Service Templates:

    • Add supported_providers and provider_configs fields to ServiceTemplate model

Test Strategy

  • Verify Proxmox still works after refactoring
  • Test provider factory pattern
  • Verify database migration
  • Test provider configuration API
  • Unit tests for CloudProvider interface

Deliverables

  • CloudProvider base class
  • CloudProviderConfig model
  • ProxmoxProvider implementation
  • Database migration
  • Updated Container model
  • Provider factory

Dependencies: Tasks 1-13 (all foundation work) Labels: backend, architecture, multi-cloud, critical

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information