Docker Watchdog

File location:
  • Bundled implementation: source/server/python/

  • Cluster implementation: cluster/daemon/python/

This module provides a handy way to always keep the underlying BroAPT system in Docker containers running.


A context to manager Docker containers. This function will start watch_container() as a background process.


When start, the function will start the Docker containers through start_container().

Before exit, the function will toggle the value of UP_FLAG to False and wait for the process to exit. And gracefully stop the Docker containers through stop_container().


Supervise the status of Docker containers while the system is running, i.e. UP_FLAG is True.


ComposeWarning – If fail to poll status of Docker containers.


Start Docker container using Docker Compose in detached mode.


Stop Docker container gracefully using Docker Compose, and clean up Docker caches.

compose.flask_exit(signum: signal.Signals | None = None, frame: types.FrameType | None = None)

Flask exit signal handler. This function is registered as handler for const.KILL_SIGNAL through register().


Register flask_exit() as signal handler of const.KILL_SIGNAL.

compose.UP_FLAG = multiprocessing.Value('B', True)

If the BroAPT system is actively running.

exception compose.ComposeWarning


Warn if fail to poll status of Docker containers.