Documentation

Deployment Guide Overview

Comprehensive guide for deploying Epochly in production environments.

Deployment Methods

MethodUse CaseComplexityControl
pip installStandard deploymentsLowHigh
sitecustomizeTransparent activationLowMedium
DockerContainerized appsMediumHigh
KubernetesOrchestrated at scaleHighHigh
EnterpriseCustom deploymentHighMaximum

Quick Installation

# Standard installation
pip install epochly
# Verify installation
epochly doctor
# Check version
epochly --version

Transparent Activation with sitecustomize

Zero-code-change activation:

# Install sitecustomize
epochly sitecustomize install
# Validate installation
epochly sitecustomize validate
# Check status
epochly sitecustomize status
# Uninstall if needed
epochly sitecustomize uninstall

Activation Modes

Epochly supports five activation modes via EPOCHLY_MODE:

ModeLevel RangeDescription
DISABLED0No optimization, monitoring only
MONITORING0Metrics collection only
CONSERVATIVE1-2Safe optimizations (threading, JIT)
BALANCED2-3Balanced performance/stability
AGGRESSIVE3-4Maximum performance (requires license)
# Set activation mode
export EPOCHLY_MODE=conservative
export 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-slim
WORKDIR /app
# Install Epochly
RUN pip install --no-cache-dir epochly
# Copy application
COPY . .
# Configure for production
ENV EPOCHLY_MODE=conservative
ENV EPOCHLY_LEVEL=2
ENV EPOCHLY_MAX_WORKERS=8
CMD ["python", "app.py"]

Kubernetes Deployment

apiVersion: v1
kind: ConfigMap
metadata:
name: epochly-config
data:
EPOCHLY_MODE: "conservative"
EPOCHLY_LEVEL: "2"
EPOCHLY_MAX_WORKERS: "8"
EPOCHLY_LOG_LEVEL: "WARNING"
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: app
spec:
replicas: 3
template:
spec:
containers:
- name: app
image: myapp:latest
envFrom:
- configMapRef:
name: epochly-config
resources:
requests:
cpu: "2"
memory: "4Gi"
limits:
cpu: "4"
memory: "8Gi"

Production Recommendations

Resource Allocation

Workload TypeCPUMemoryEPOCHLY_LEVELEPOCHLY_MODE
Web servers (I/O)2-4 cores2-4GB1conservative
Data processing4-8 cores4-8GB2balanced
Scientific computing8+ cores8+ GB3balanced
ML/GPU workloads8+ cores + GPU16+ GB4aggressive

Best Practices

  1. Start Conservative: Begin with Level 2 in production
  2. Monitor Closely: Watch CPU, memory, and error rates
  3. Test Thoroughly: Validate in staging before production
  4. Plan Rollback: Have emergency disable procedures ready

CI/CD Integration

GitHub Actions Example

name: Deploy with Epochly
on: [push]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Epochly
run: |
pip install epochly
epochly doctor
- name: Run tests with Epochly
env:
EPOCHLY_LEVEL: 2
EPOCHLY_MODE: conservative
run: pytest
- name: Deploy
run: ./deploy.sh

GitLab CI Example

test:
script:
- pip install epochly
- epochly doctor
- EPOCHLY_LEVEL=2 pytest
variables:
EPOCHLY_MODE: conservative

Health Monitoring

Health Check Endpoint

from flask import Flask, jsonify
import epochly
app = 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 status
  • epochly_current_level: Active enhancement level
  • epochly_optimization_count: Total optimizations applied
  • epochly_error_count: Optimization errors

CLI Runner

Run scripts with Epochly optimization:

# Basic usage
epochly run script.py
# With configuration
epochly run --level 2 --mode conservative script.py
# With arguments
epochly run script.py --arg1 value1 --arg2 value2