Deployment Guide Overview
Comprehensive guide for deploying Epochly in production environments.
Deployment Methods
| Method | Use Case | Complexity | Control |
|---|---|---|---|
| pip install | Standard deployments | Low | High |
| sitecustomize | Transparent activation | Low | Medium |
| Docker | Containerized apps | Medium | High |
| Kubernetes | Orchestrated at scale | High | High |
| Enterprise | Custom deployment | High | Maximum |
Quick Installation
# Standard installationpip install epochly# Verify installationepochly doctor# Check versionepochly --version
Transparent Activation with sitecustomize
Zero-code-change activation:
# Install sitecustomizeepochly sitecustomize install# Validate installationepochly sitecustomize validate# Check statusepochly sitecustomize status# Uninstall if neededepochly sitecustomize uninstall
Activation Modes
Epochly supports five activation modes via EPOCHLY_MODE:
| Mode | Level Range | Description |
|---|---|---|
| DISABLED | 0 | No optimization, monitoring only |
| MONITORING | 0 | Metrics collection only |
| CONSERVATIVE | 1-2 | Safe optimizations (threading, JIT) |
| BALANCED | 2-3 | Balanced performance/stability |
| AGGRESSIVE | 3-4 | Maximum performance (requires license) |
# Set activation modeexport EPOCHLY_MODE=conservativeexport EPOCHLY_LEVEL=2
Emergency Controls
Immediate Disable
Highest priority - overrides all other settings:
export EPOCHLY_EMERGENCY_DISABLE=1
Standard Disable
export EPOCHLY_DISABLE=1
Docker Quick Start
FROM python:3.12-slimWORKDIR /app# Install EpochlyRUN pip install --no-cache-dir epochly# Copy applicationCOPY . .# Configure for productionENV EPOCHLY_MODE=conservativeENV EPOCHLY_LEVEL=2ENV EPOCHLY_MAX_WORKERS=8CMD ["python", "app.py"]
Kubernetes Deployment
apiVersion: v1kind: ConfigMapmetadata:name: epochly-configdata:EPOCHLY_MODE: "conservative"EPOCHLY_LEVEL: "2"EPOCHLY_MAX_WORKERS: "8"EPOCHLY_LOG_LEVEL: "WARNING"---apiVersion: apps/v1kind: Deploymentmetadata:name: appspec:replicas: 3template:spec:containers:- name: appimage: myapp:latestenvFrom:- configMapRef:name: epochly-configresources:requests:cpu: "2"memory: "4Gi"limits:cpu: "4"memory: "8Gi"
Production Recommendations
Resource Allocation
| Workload Type | CPU | Memory | EPOCHLY_LEVEL | EPOCHLY_MODE |
|---|---|---|---|---|
| Web servers (I/O) | 2-4 cores | 2-4GB | 1 | conservative |
| Data processing | 4-8 cores | 4-8GB | 2 | balanced |
| Scientific computing | 8+ cores | 8+ GB | 3 | balanced |
| ML/GPU workloads | 8+ cores + GPU | 16+ GB | 4 | aggressive |
Best Practices
- Start Conservative: Begin with Level 2 in production
- Monitor Closely: Watch CPU, memory, and error rates
- Test Thoroughly: Validate in staging before production
- Plan Rollback: Have emergency disable procedures ready
CI/CD Integration
GitHub Actions Example
name: Deploy with Epochlyon: [push]jobs:deploy:runs-on: ubuntu-lateststeps:- uses: actions/checkout@v2- name: Install Epochlyrun: |pip install epochlyepochly doctor- name: Run tests with Epochlyenv:EPOCHLY_LEVEL: 2EPOCHLY_MODE: conservativerun: pytest- name: Deployrun: ./deploy.sh
GitLab CI Example
test:script:- pip install epochly- epochly doctor- EPOCHLY_LEVEL=2 pytestvariables:EPOCHLY_MODE: conservative
Health Monitoring
Health Check Endpoint
from flask import Flask, jsonifyimport epochlyapp = Flask(__name__)@app.route('/health/epochly')def epochly_health():status = epochly.get_status()return jsonify({'healthy': status['initialized'],'level': status['enhancement_level'],'mode': status['mode'],'version': epochly.__version__}), 200 if status['initialized'] else 503
Monitoring Metrics
Key metrics to track:
epochly_initialized: System initialization statusepochly_current_level: Active enhancement levelepochly_optimization_count: Total optimizations appliedepochly_error_count: Optimization errors
CLI Runner
Run scripts with Epochly optimization:
# Basic usageepochly run script.py# With configurationepochly run --level 2 --mode conservative script.py# With argumentsepochly run script.py --arg1 value1 --arg2 value2
Related Documentation
- Production Setup - Production best practices
- Docker Deployment - Container deployments
- sitecustomize Installation - Transparent activation
- Emergency Controls - Emergency disable procedures
- Monitoring Integration - Observability setup