Pranor Deploy

docker run -p 8088:8088 ghcr.io/vyuvaraj/pranor-deploy:latest

Pranor Deploy is the managed deployment platform and process orchestrator for the Pranor ecosystem. It provides PaaS-style service deployment, blue/green and canary strategies, per-branch preview environments, container isolation, and deep integration with Pranor Gate for automatic routing registration.


Table of Contents


Key Features

🚀 Core Deployment Platform

  • PaaS deployment API: Compile and run .pnr background services on demand via REST API
  • Process isolation: Dedicated port allocation per deployment; process metrics tracking
  • Dynamic gateway routing registration: Newly deployed services are automatically registered with Pranor Gate — zero manual route configuration
  • Ring-buffer log streaming: Capture stdout/stderr into a ring buffer; stream logs via REST API
  • OTel tracing: Deep integration with Pranor Trace via shared tracing — per-deployment spans

🔵🟢 Blue/Green Deployment

  • Zero-downtime traffic switch: Atomic cutover — Pranor Gate switches 100% of traffic to new (green) deployment in a single atomic update
  • Instant rollback: If issues arise, switch back to blue with one API call
  • Health gate: Green deployment must pass health checks before cutover is triggered
  • Audit trail: Every cutover and rollback event logged with timestamp and operator identity

🐤 Canary Deployment

  • Configurable traffic split: Route a percentage (e.g., 5%, 10%, 25%) of traffic to the canary deployment
  • Automatic rollback: Monitor error rate on canary; if it exceeds configurable threshold, automatically revert 100% traffic to stable
  • Progressive promotion: Incrementally increase canary traffic weight on success (5% → 25% → 50% → 100%)
  • Pranor Gate integration: Traffic split is enforced by Pranor Gate's weighted routing — no client-side changes required

🌿 Preview Environments

  • Per-branch preview provisioner: Automatically create complete isolated Pranor environments per git branch — ideal for PR review workflows
  • Ephemeral lifecycle: Preview environments are automatically cleaned up when the branch is deleted or after a configurable TTL
  • Independent routing: Each preview gets its own Pranor Gate subdomain (e.g., feature-x.preview.pranor.net)
  • Full stack provisioning: Preview environments include isolated Pranor Pulse, Pranor Vault, and Pranor Cache instances

🐳 Container Isolation

  • Docker/OCI container mode: Deploy services as fully isolated containers (via Docker or OCI runtime) rather than raw processes
  • Resource limits: Configure per-container CPU and memory limits
  • Network isolation: Container deployments run in isolated bridge networks

Architecture

Developer API Request
        │ POST /api/v1/deployments
        ▼
┌───────────────────────────────────────────────┐
│                 Pranor Deploy                      │
│                                               │
│  ┌────────────────────────────────────────┐   │
│  │  Deployment Orchestrator               │   │
│  │  Build → Deploy → Health Check         │   │
│  └───────────┬────────────────────────────┘   │
│              │                                │
│  ┌───────────▼────────────────────────────┐   │
│  │  Strategy Manager                      │   │
│  │  Direct │ Blue/Green │ Canary           │   │
│  └───────────┬────────────────────────────┘   │
│              │                                │
│  ┌───────────▼────────────────────────────┐   │
│  │  Pranor Gate Registration                 │   │
│  │  (auto-register routes on deploy)      │   │
│  └────────────────────────────────────────┘   │
│                                               │
│  ┌────────────────────┐  ┌─────────────────┐  │
│  │  Log Streamer       │  │ Preview Env Mgr │  │
│  │  (ring buffer)      │  │ (branch → env)  │  │
│  └────────────────────┘  └─────────────────┘  │
└───────────────────────────────────────────────┘

API Endpoints

MethodPathDescription
POST/api/v1/deploymentsDeploy a service (direct, blue/green, or canary)
GET/api/v1/deploymentsList all deployments
GET/api/v1/deployments/{id}Get deployment status and metrics
POST/api/v1/deployments/{id}/promotePromote canary to stable
POST/api/v1/deployments/{id}/rollbackRoll back to previous version
POST/api/v1/deployments/{id}/cutoverBlue/Green: cut all traffic to new version
GET/api/v1/deployments/{id}/logsStream deployment logs (ring buffer)
DELETE/api/v1/deployments/{id}Stop and remove a deployment
POST/api/v1/previewsCreate a preview environment for a branch
GET/api/v1/previewsList active preview environments
DELETE/api/v1/previews/{id}Destroy a preview environment
/metricsGETPrometheus metrics (deployments active, error rates, rollback events)
/healthzGETLiveness probe

Deployment Strategies

Direct Deploy

curl -X POST http://pranor-deploy:8088/api/v1/deployments \
  -d '{"service": "orders-api", "image": "ghcr.io/myorg/orders:v2.1.0", "strategy": "direct", "port": 3000}'

Blue/Green Deploy

# Deploy green (new version)
curl -X POST http://pranor-deploy:8088/api/v1/deployments \
  -d '{"service": "orders-api", "image": "ghcr.io/myorg/orders:v2.2.0", "strategy": "blue-green"}'
# → { "id": "dep-456", "status": "green-standby", "green_url": "http://green-orders:3001" }

# Cut over all traffic to green
curl -X POST http://pranor-deploy:8088/api/v1/deployments/dep-456/cutover
# → Pranor Gate atomically switches all /api/orders traffic to green

# Rollback if needed
curl -X POST http://pranor-deploy:8088/api/v1/deployments/dep-456/rollback

Canary Deploy

# Deploy canary at 5% traffic
curl -X POST http://pranor-deploy:8088/api/v1/deployments \
  -d '{
    "service": "orders-api",
    "image": "ghcr.io/myorg/orders:v2.3.0",
    "strategy": "canary",
    "canary_weight": 5,
    "auto_rollback_error_rate": 0.05
  }'

# Progressive promotion: 5% → 25% → 50% → 100%
curl -X POST http://pranor-deploy:8088/api/v1/deployments/dep-789/promote \
  -d '{"weight": 25}'

Preview Environments

# Create preview environment for a feature branch
curl -X POST http://pranor-deploy:8088/api/v1/previews \
  -d '{"branch": "feature/new-checkout", "ttl": "7d"}'
# → { "id": "prev-001", "url": "https://feature-new-checkout.preview.pranor.net", "expires_at": "..." }

# Destroy preview
curl -X DELETE http://pranor-deploy:8088/api/v1/previews/prev-001

Getting Started

docker run -p 8088:8088 \
  -e PRANOR_DEPLOY_PRANOR_GATE_URL=http://pranor-gate:8080 \
  -e PRANOR_DEPLOY_OTEL_ENDPOINT=http://pranor-trace:4318 \
  -e PRANOR_DEPLOY_CONTAINER_RUNTIME=docker \
  -v /var/run/docker.sock:/var/run/docker.sock \
  ghcr.io/vyuvaraj/pranor-deploy:latest

Environment Variables

VariableDefaultDescription
PRANOR_DEPLOY_PORT8088HTTP listener port
PRANOR_DEPLOY_PRANOR_GATE_URLPranor Gate URL for route registration
PRANOR_DEPLOY_OTEL_ENDPOINTOpenTelemetry collector URL
PRANOR_DEPLOY_CONTAINER_RUNTIMEprocessprocess (raw) or docker (OCI container)
PRANOR_DEPLOY_PREVIEW_DOMAINBase domain for preview environments
PRANOR_DEPLOY_PREVIEW_TTL7dDefault preview environment TTL