Containers and Server Infrastructure

HiveMind runs on a number of different Docker containers, both in production and on local dev systems. The system is intended to make local dev systems run similarly to production without requiring extensive setup.

Containers

Web/API Services

The public-facing containers. In production, these run on the app servers. See Websocket Documentation for more info on what data each websocket server provides.

  • web - nginx web server. Routes requests to containers, and serves some static files.
  • nextjs - frontend web application (React/NextJS)
  • app - backend API server (Python/Django)
  • stats_listener_v3 - websocket server to handle connections from stats clients (Node)
  • stats_listener_v4 - temporary use to test client features (Node)
  • Websocket servers for outgoing data (Node):
    • gamestate
    • ingame_stats
    • signin
    • event_relay
    • tournament_relay
    • whiteboard_relay

Worker Processes

Background services. In production, these run on the worker server.

  • web - in production only, runs the webserver at https://worker.kqhivemind.com
  • worker - handles the execution of any background process such as API calls to external services, postgame processing, and achievements (Python/Django/Celery)
  • scheduler - schedules periodic tasks to run on the worker (Python/Django/Celery)
  • event_manager - mostly obsolete - listens to gamestate feed and triggers postgame processing to be run by the worker (Python)
  • kquity - handles game prediction based on Rob Renaud's KQuity
  • flower - web application to provide monitoring of the worker process (Python/Celery/Flower)

Log Handling

Runs Graylog for log handling. In production, these run on the logs server.

  • web - in production only, runs the webserver at https://logs.kqhivemind.com
  • elasticsearch - ElasticSearch container for Graylog
  • mongo - MongoDB container for Graylog
  • graylog - Graylog application

Database Processes

The database and Redis servers. These containers are only used for local or dev environments. In production, these run directly on the db server, without Docker containers.

  • db - the primary database (PostgreSQL)
  • redis - cache, data channels, and task queue (Redis)