-
Notifications
You must be signed in to change notification settings - Fork 232
Labels
choreLinting, formatting, dependency hygiene, or project maintenance choresLinting, formatting, dependency hygiene, or project maintenance chorescicdIssue with CI/CD process (GitHub Actions, scaffolding)Issue with CI/CD process (GitHub Actions, scaffolding)devopsDevOps activities (containers, automation, deployment, makefiles, etc)DevOps activities (containers, automation, deployment, makefiles, etc)triageIssues / Features awaiting triageIssues / Features awaiting triage
Milestone
Description
Title: Enhanced run-gunicorn.sh with process locking, dev mode, and improved production features
Description:
Enhance the run-gunicorn.sh
script with several production-ready features and developer conveniences:
New Features:
- Process Lock Protection: Prevents accidental duplicate instances via PID file checking (
/tmp/mcpgateway-gunicorn.lock
) - Developer Mode: Hot reload support with
GUNICORN_DEV_MODE=true
- automatically enables--reload
and watches config files - Application Preloading: Memory optimization with
GUNICORN_PRELOAD_APP=true
for production deployments - Auto Worker Detection: Dynamically calculates optimal worker count based on CPU cores (2×CPU+1)
- Database Init Control: Skip DB initialization with
SKIP_DB_INIT=true
for faster restarts - Force Start Option: Override lock check with
FORCE_START=true
when needed
Improvements:
- Added
--forwarded-allow-ips="*"
for proxy/Kubernetes deployments - Enhanced error handling with descriptive messages and recovery suggestions
- Proper signal handling and cleanup on exit
- Python 3.x verification to prevent Python 2 usage
- Comprehensive environment variable documentation
Environment Variables:
All existing vars preserved, plus:
GUNICORN_DEV_MODE
- Enable hot reload for developmentGUNICORN_PRELOAD_APP
- Preload app for memory savingsSKIP_DB_INIT
- Skip database initializationFORCE_START
- Force start despite existing instance
This makes the script suitable for both development (with hot reload) and production (with preloading, process protection) while maintaining backward compatibility.
Metadata
Metadata
Assignees
Labels
choreLinting, formatting, dependency hygiene, or project maintenance choresLinting, formatting, dependency hygiene, or project maintenance chorescicdIssue with CI/CD process (GitHub Actions, scaffolding)Issue with CI/CD process (GitHub Actions, scaffolding)devopsDevOps activities (containers, automation, deployment, makefiles, etc)DevOps activities (containers, automation, deployment, makefiles, etc)triageIssues / Features awaiting triageIssues / Features awaiting triage