Automated migration of local applications to Google Cloud Platform using AI agents
Cloudify is an intelligent, multi-agent system built with Dedalus AI that automates the complete migration process from local development to Google Cloud Platform. Perfect for hackathons and rapid prototyping!
- 🤖 AI-Powered Migration: Uses Claude AI for intelligent decision-making and recommendations
- 🔄 Event-Driven Architecture: Agents communicate via publish-subscribe pattern
- 📊 Real-Time Progress: Beautiful CLI with live progress tracking using Rich
- 🛡️ Safe Execution: Comprehensive error handling and validation
- 🎯 Zero Configuration: Works out-of-the-box with sensible defaults
- 🚀 One Command Deployment: Migrate entire stack with a single command
Cloudify uses a multi-agent system where each agent handles a specific migration task:
┌─────────────────────────────────────────────────────────────┐
│ ORCHESTRATOR AGENT │
│ (Coordinates all agents via event bus) │
└────────┬────────────────────────────────────────────────────┘
│
┌────┴─────┬──────────┬──────────────┬──────────────┐
│ │ │ │ │
┌───▼───┐ ┌──▼───┐ ┌───▼────┐ ┌──────▼─────┐ ┌────▼────┐
│ Code │ │Infra │ │Database│ │ Backend │ │Frontend │
│Analyze│─▶│Prov. │─▶│Migrat. │─▶│ Deployment │ │Deploym. │
└───────┘ └──────┘ └────────┘ └────────────┘ └─────────┘
│ │
▼ ▼
Cloud Run Firebase
Hosting
-
Code Analyzer Agent
- Scans Spring Boot
application.properties - Detects database configuration (H2, MySQL, PostgreSQL)
- Identifies API endpoints and CORS settings
- Analyzes React app for API configurations
- Outputs migration requirements report
- Scans Spring Boot
-
Infrastructure Provisioning Agent
- Creates GCP project resources using
gcloudCLI - Sets up Cloud Run service
- Configures Artifact Registry
- Sets up Firebase project for hosting
- Manages IAM permissions
- Creates GCP project resources using
-
Database Migration Agent
- Analyzes H2 database mode (in-memory vs file-based)
- Recommends Cloud SQL setup OR keeps H2 with warnings
- Optionally migrates data to Cloud SQL
- Updates Spring Boot datasource configuration
-
Backend Deployment Agent
- Generates optimized Dockerfile for Spring Boot
- Updates application properties with GCP configurations
- Builds Docker image
- Pushes to Artifact Registry
- Deploys to Cloud Run
- Configures environment variables
-
Frontend Deployment Agent
- Detects React build configuration (Vite/CRA)
- Updates API endpoint to Cloud Run URL
- Builds React production bundle
- Deploys to Firebase Hosting
- Configures custom domain if provided
Before using Cloudify, ensure you have the following installed:
- Python 3.10+ (Download)
- Google Cloud SDK (Install Guide)
- Docker (Install Guide)
- Node.js 18+ and npm (Download)
- Firebase CLI (for frontend hosting)
npm install -g firebase-tools
- Dedalus API Key (primary) (Get one here)
- Anthropic Claude API Key (fallback if Dedalus key not set) (Get one here)
git clone <your-repo-url>
cd Cloudify# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt# Copy example environment file
cp .env.example .env
# Edit .env and add your API keys
DEDALUS_API_KEY=your-dedalus-api-key-here
ANTHROPIC_API_KEY=your-claude-api-key-here # fallback if DEDALUS_API_KEY not set# Login to GCP
gcloud auth login
# Set your project
gcloud config set project YOUR_PROJECT_ID
# Configure Docker for Artifact Registry
gcloud auth configure-docker us-central1-docker.pkg.devpython migration_orchestrator.py initThis creates a migration_config.yaml template. Edit it with your settings:
source:
path: "./BasicApp" # Path to your application
gcp:
project_id: "cloudify-486706"
region: "us-central1"
migration:
mode: "interactive" # or "automated"python migration_orchestrator.py migrate \
--source-path /Users/anmolsahu2k/Stuff/Create/TartanHacks/BasicApp \
--gcp-project cloudify-486706 \
--region us-central1Or use the config file:
python migration_orchestrator.py migrate --config migration_config.yamlpython migration_orchestrator.py migrate [OPTIONS]
Options:
-s, --source-path PATH Path to source application directory
-c, --config PATH Path to migration configuration file
-p, --gcp-project TEXT GCP project ID (overrides config)
-r, --region TEXT GCP region (default: us-central1)
-m, --mode TEXT Execution mode: interactive or automated
-d, --dry-run Preview changes without executing
-v, --verbose Enable verbose logging
--help Show this message and exit# Initialize a new migration configuration file
python migration_orchestrator.py init
# Show version and SDK information
python migration_orchestrator.py versionThe migration_config.yaml file controls all aspects of the migration:
# Source Application Configuration
source:
path: "./BasicApp"
backend:
type: "spring-boot"
path: "backend"
build_tool: "maven"
java_version: "21"
frontend:
type: "react"
path: "frontend"
build_tool: "vite"
# GCP Configuration
gcp:
project_id: "my-project"
region: "us-central1"
backend:
service_name: "expense-calculator-backend"
memory: "1Gi"
cpu: "1"
min_instances: 0
max_instances: 10
allow_unauthenticated: true
frontend:
site_name: "expense-calculator-frontend"
database:
strategy: "keep-h2" # or "migrate-to-cloud-sql"
# Migration Behavior
migration:
mode: "interactive"
dry_run: false
verbose: true
backup_enabled: true
# AI Configuration
ai:
model: "claude-opus-4-6"
temperature: 0.3See migration_config.yaml for full configuration options.
Let's migrate the sample expense calculator app:
# 1. Clone the sample application
git clone https://github.com/sanathmahesh/BasicApp.git
# 2. Run migration with all defaults
python migration_orchestrator.py migrate \
--source-path /Users/aritraraychaudhuri/Downloads/BasicApp \
--gcp-project cloudify-486706 \
--mode automated
# Output:
# ╔═══════════════════════════════════════════════════════════╗
# ║ CLOUDIFY ║
# ║ Automated Cloud Migration to Google Cloud ║
# ╚═══════════════════════════════════════════════════════════╝
#
# ✓ Prerequisites check passed
# ✓ Configuration valid
#
# Starting migration...
#
# ✓ CodeAnalyzer ████████████████████ 100% 2.3s
# ✓ Infrastructure ████████████████████ 100% 8.1s
# ✓ DatabaseMigration ████████████████████ 100% 1.2s
# ✓ BackendDeployment ████████████████████ 100% 45.7s
# ✓ FrontendDeployment ████████████████████ 100% 32.4s
#
# Migration completed successfully! ✓
#
# Deployment URLs:
# • Backend API: https://expense-calculator-backend-abc123-uc.a.run.app
# • Frontend App: https://my-gcp-project.web.appRun unit tests:
pytest tests/unit -vRun integration tests (requires GCP credentials):
pytest tests/integration -vCloudify/
├── agents/
│ ├── __init__.py
│ ├── base_agent.py # Base agent class with event handling
│ ├── orchestrator.py # Main orchestrator agent
│ ├── code_analyzer.py # Code analysis agent
│ ├── infrastructure.py # GCP infrastructure provisioning
│ ├── database_migration.py # Database migration logic
│ ├── backend_deployment.py # Backend to Cloud Run
│ ├── frontend_deployment.py # Frontend to Firebase
│ └── dedalus_tools.py # Dedalus SDK tool definitions
├── utils/
│ ├── __init__.py
│ ├── gcp_helpers.py # GCP API helpers
│ ├── file_operations.py # File I/O utilities
│ └── logger.py # Logging configuration
├── templates/
│ ├── Dockerfile.spring-boot.template
│ └── cloudbuild.yaml
├── tests/
│ ├── unit/
│ └── integration/
├── frontend/ # Sample frontend application
├── migration_orchestrator.py # Main CLI entry point
├── migration_config.yaml # Configuration template
├── requirements.txt # Python dependencies
├── setup.py # Package setup
├── quickstart.sh # Quick start script
├── .env.example # Environment variables template
├── ARCHITECTURE.md # Architecture documentation
├── CONTRIBUTING.md # Contributing guide
├── PROJECT_SUMMARY.md # Project summary
├── LICENSE # MIT License
└── README.md # This file
gcp:
database:
strategy: "keep-h2"Note: H2 in-memory database will lose data on container restart. Only suitable for development/testing.
gcp:
database:
strategy: "migrate-to-cloud-sql"
cloud_sql:
instance_name: "my-database"
database_name: "appdb"
tier: "db-f1-micro"
database_version: "POSTGRES_15"gcp:
backend:
env_vars:
SPRING_PROFILES_ACTIVE: "prod"
CUSTOM_VAR: "value"migration:
agents:
parallel_execution: true # Deploy backend and frontend simultaneouslyContributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Dedalus AI for the agent framework
- Anthropic for the Claude API
- Google Cloud Platform for cloud infrastructure
- TartanHacks for the hackathon opportunity
# Re-authenticate with GCP
gcloud auth login
gcloud auth application-default login# Ensure Docker daemon is running
docker ps
# Check Docker authentication
gcloud auth configure-docker# Login to Firebase
firebase login
# Check project association
firebase projects:list# Check environment variables
echo $ANTHROPIC_API_KEY
# Make sure .env is loaded
source .env # or restart your terminalEnable verbose logging for detailed information:
python migration_orchestrator.py migrate --verbose- Dedalus AI Documentation
- Claude API Documentation
- Google Cloud Run Documentation
- Firebase Hosting Documentation
- Code Analysis: Claude AI analyzes your application structure and generates migration recommendations
- Infrastructure Setup: Automated GCP resource provisioning with proper IAM permissions
- Containerization: Optimized multi-stage Docker builds for minimal image size
- Deployment: Parallel deployment to Cloud Run and Firebase Hosting
- Configuration: Automatic environment variable injection and API endpoint updates
Agents communicate via an event bus using the publish-subscribe pattern:
# Agent publishes event
await event_bus.publish(Event(
event_type=EventType.BACKEND_DEPLOYED,
source_agent="BackendDeployment",
data={"service_url": "https://..."}
))
# Other agents subscribe
event_bus.subscribe(EventType.BACKEND_DEPLOYED, callback)This allows for:
- Loose coupling between agents
- Easy addition of new agents
- Parallel execution where possible
- Clear dependency management
-
Always run in dry-run mode first:
python migration_orchestrator.py migrate --dry-run
-
Enable backups for safety:
migration: backup_enabled: true
-
Use interactive mode for manual approval:
migration: mode: "interactive"
-
Monitor costs with Cloud Billing alerts
-
Review generated Dockerfiles before production use
-
Set up CI/CD with the provided
cloudbuild.yaml
Future enhancements planned:
- Support for additional frameworks (Django, Express.js)
- Multi-cloud support (AWS, Azure)
- Database data migration tools
- Web dashboard for migration monitoring
- Cost optimization recommendations
- Automated testing post-migration
- Rollback capabilities
Built with ❤️ for TartanHacks 2026
For questions or support, please open an issue on GitHub.