gunicorn_config.py 692 B

123456789101112131415161718192021222324
  1. """Gunicorn configuration for the independent DataOps Runner."""
  2. import os
  3. bind = (
  4. f"{os.environ.get('RUNNER_LISTEN_HOST', '0.0.0.0')}:"
  5. f"{os.environ.get('RUNNER_LISTEN_PORT', '5600')}"
  6. )
  7. workers = int(os.environ.get("RUNNER_WORKERS", "2"))
  8. threads = int(os.environ.get("RUNNER_THREADS", "2"))
  9. timeout = int(os.environ.get("RUNNER_TIMEOUT", "120"))
  10. capture_output = True
  11. enable_stdio_inheritance = True
  12. loglevel = os.environ.get("RUNNER_LOG_LEVEL", "info")
  13. def worker_exit(server, worker):
  14. del server, worker
  15. from app.runner.wsgi import application
  16. runtime = application.extensions.get("dataops_runner_runtime")
  17. if runtime is not None:
  18. runtime.close()