## DACA Deployment Stages: The Ascent

DACA’s “ascent” refers to its progressive deployment pipeline, scaling from local development to planetary-scale production while optimizing cost and complexity.

![](./img/ascent.png)

### 1. Local Development: Open-Source Stack

<p align="center">

</p>

- **Goal**: Rapid iteration with production-like features.
- **Setup**:
  - **Rancher Desktop with Lens**: Runs the agent app, Dapr sidecar, A2A endpoints and local services on local Kubernetes.
  - **LLM APIs**: OpenAI Chat Completion, Google Gemini (free tier).
  - **Agents and MCP Servers**: OpenAI Agents SDK as Dapr Actors with MCP Servers and with A2A integration.
  - **REST APIs**: FastAPI.
  - **Messaging**: Local RabbitMQ container.
  - **Scheduling**: python-crontab, APScheduler, or Schedule or Dapr Scheduler.
  - **Database**: Local Postgres container, SQLModel ORM.
  - **In-Memory Store**: Local Redis container, redis-py or Redis OM Python.
  - **Dev Tools**: VS Code Dev Containers for containerized development.
  - **Open Core and Managed Edges**: Uses open-source Kubernetes (Rancher Desktop) and Dapr for the core, with local open-source services (Postgres, Redis) to simulate production. Managed services like OpenAI APIs are used at the edges for prototyping LLM inference.
- **Scalability**: Single machine (1-10 req/s with OpenAI).
- **Cost**: Free, using open-source tools.

### 2. Prototyping: Free Deployment

<p align="center">

</p>
<p align="center">

</p>

- **Goal**: Test and validate with minimal cost.
- **Setup**:
  - **Containers**: Deploy to Hugging Face Docker Spaces (free hosting, CI/CD). Both FastAPI, MCP Server, and A2A endpoints in containers.
  - **LLM APIs**: Google Gemini (free tier), Responses API.
  - **Messaging**: CloudAMQP RabbitMQ (free tier: 1M messages/month, 20 connections).
  - **Scheduling**: cron-job.org (free online scheduler).
  - **Database**: CockroachDB Serverless (free tier: 10 GiB, 50M RU/month).
  - **In-Memory Store**: Upstash Redis (free tier: 10,000 commands/day, 256 MB).
  - **Dapr**: Use [Managed Dapr Service Catalyst by Diagrid](https://www.diagrid.io/catalyst) free-tier.
- **Scalability**: Limited by free tiers (10s-100s of users, 5-20 req/s).
- **Cost**: Fully free, but watch free tier limits (e.g., Upstash’s 7 req/min cap).

### 3. Medium Enterprise Scale: Azure Container Apps (ACA)

#### Classification of the Spectrum of Managed Services

![](./img/spectrum-cloud-service.png)


1. **Fully Managed Services**:
   - **Google Cloud Run**: Provides the highest level of abstraction and management, completely handling infrastructure for stateless containers.
   - **Azure Container Apps**: Offers serverless scaling and deep integration with Azure, simplifying container management.
   - **GKE Autopilot**: Automates most of the Kubernetes management tasks, focusing on application deployment and scalability.

2. **Semi-Managed Services**:
   - **AWS Karpenter**: While it automates scaling and integrates with AWS services, it still requires some management and configuration of the Kubernetes environment.

3. **Self-Managed Services**:
   - **Native Kubernetes**: Provides full control and flexibility, but requires significant management effort, including setup, scaling, updates, and maintenance.

Choosing the right Kubernetes-powered platform depends on your needs for management and control. Fully managed services like Google Cloud Run, Azure Container Apps (ACA), and GKE Autopilot offer ease of use and scalability, ideal for teams focusing on application development without worrying about infrastructure. Semi-managed services like AWS Karpenter offer a balance, with some automation while allowing for more customization. Native Kubernetes provides maximum control and customization at the cost of increased management overhead. We have chossen Azure Container Apps (AKA) because it offers a perfect balance, with native Dapr support.

#### Azure Container Apps (ACA)

<p align="center">

</p>

- **Goal**: Scale to thousands of users with cost efficiency.
- **Setup**:
  - **Containers**: Deploy containers (FastAPI and MCP Servers) to ACA with Dapr support (via KEDA).
    ```yaml
    apiVersion: containerapps.azure.com/v1
    kind: ContainerApp
    metadata:
      name: agent-app
    spec:
      containers:
        - name: agent-app
          image: your-registry/agent-app:latest
          env:
            - name: OPENAI_API_KEY
              value: "sk-..."
      dapr:
        enabled: true
        appId: agent-app
        appPort: 8080
    ```
  - **Scaling**: ACA’s free tier (180,000 vCPU-s, 360,000 GiB-s/month) supports ~1-2 always-on containers, auto-scales on HTTP traffic or KEDA triggers.
  - **LLM APIs**: OpenAI Chat Completion, Responses API.
  - **Messaging**: CloudAMQP RabbitMQ (paid tier if needed).
  - **Scheduling**: ACA Jobs for scheduled tasks.
  - **Database**: CockroachDB Serverless (scale to paid tier if needed).
  - **In-Memory Store**: Upstash Redis (scale to paid tier if needed).
- **Scalability**: Thousands of users (e.g., 10,000 req/min), capped by OpenAI API limits (10,000 RPM = 166 req/s). Using Google Gemini will more economical. 
- **Cost**: Free tier covers light traffic; paid tier ~$0.02/vCPU-s beyond that.

### 4. Planet-Scale: Kubernetes with Self-Hosted LLMs

<p align="center">

</p>
<p align="center">

</p>

- **Goal**: Achieve planetary scale with no API limits.
- **Setup**:
  - **Containers**: Kubernetes cluster (e.g., on Oracle Cloud’s free VMs: 2 AMD VMs or 4 Arm VMs). Both FastAPIs and MCP containers.
  - **LLM APIs**: Self-hosted LLMs (e.g., LLaMA, Mistral) with OpenAI-compatible APIs (via vLLM or llama.cpp).
  - **Messaging**: Kafka on Kubernetes (high-throughput, multi-broker).
  - **Scheduling**: Kubernetes CronJobs.
  - **Database**: Postgres on Kubernetes.
  - **In-Memory Store**: Redis on Kubernetes.
  - **Dapr**: Deployed on Kubernetes for cluster-wide resilience.
- **Training**: Use Oracle Cloud’s free tier to train devs on Kubernetes DevOps, ensuring skills for any cloud (AWS, GCP, Azure).
- **Scalability**: Millions of users (e.g., 10,000 req/s on 10 nodes with GPUs), limited by cluster size.
- **Cost**: Compute-focused ($1-2/hour/node), no API fees.

### Training Developers for DACA Production Deployment

To equip developers with Kubernetes DevOps skills for production deployment, we may leverage **Oracle Cloud Infrastructure (OCI)**, which offers a "free forever" tier which Offers 2 AMD VMs (1/8 OCPU, 1 GB RAM each) or up to 4 Arm-based VMs (24 GB RAM total). [These VMs are used to deploy our own Kubernetes cluster](https://github.com/nce/oci-free-cloud-k8s), providing a hands-on environment to learn cluster management, scaling, and deployment. Once developers master these skills, they can confidently deploy our agentic workflows to any cloud Kubernetes platform (e.g., AWS, GCP, Azure), ensuring portability and flexibility. This training bridges the gap between prototyping and production, empowering developers to handle real-world deployments.

References:

https://www.ronilsonalves.com/articles/how-to-deploy-a-free-kubernetes-cluster-with-oracle-cloud-always-free-tier 

https://medium.com/@Phoenixforge/a-weekend-project-with-k3s-and-oracle-cloud-free-tier-99eda1aa49a0

---