Deploy your Hyrex applications reliably to production with proper environment setup and containerization.

Production on Hyrex Cloud

Hyrex Cloud handles infrastructure, scaling, and monitoring automatically.

Environment Setup

  1. Set Your API Key
# Production API key
export HYREX_API_KEY="prod_hx_..."
  1. Configure App for Workers
# hyrex_app.py
from hyrex import HyrexApp

app = HyrexApp("production-app")

Docker Deployment

Deploy workers using Docker:
FROM python:3.11-slim

WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt

COPY . .

CMD ["hyrex", "run-worker", "hyrex_app:app"]
Run with your API key:
docker run -e HYREX_API_KEY=$HYREX_API_KEY myapp:latest

Configuration

  1. Use separate API keys for dev/staging/prod
  2. Set num_processes based on task type
  3. Use queues to separate workload types

Deployment Checklist

Pre-Deployment

  • Load test your tasks to determine resource needs
  • Configure appropriate task timeouts
  • Set up error tracking (Sentry, etc.)
  • Plan queue structure for workload separation
  • Document task dependencies

Deployment

  • Use environment variables for configuration
  • Set up secrets management
  • Configure resource limits
  • Enable health checks
  • Set up log aggregation

Environment Variables

# Required
export HYREX_API_KEY="prod_hx_..."              # For Cloud
export HYREX_DATABASE_URL="postgresql://..."   # For FOSS

# Optional
export HYREX_LOG_LEVEL="INFO"
export HYREX_MAX_CONCURRENCY="100"
export HYREX_WORKER_TIMEOUT="3600"

Next Steps