diff --git a/jupyterhub/spawner.py b/jupyterhub/spawner.py index fabed927..b650f270 100644 --- a/jupyterhub/spawner.py +++ b/jupyterhub/spawner.py @@ -27,40 +27,63 @@ from traitlets import ( from .traitlets import Command, MemorySpecification from .utils import random_port + class Spawner(LoggingConfigurable): - """Base class for spawning single-user notebook servers. - + """ + Abstract base class for spawning single-user notebook servers. + Subclass this, and override the following methods: - + - load_state - get_state - start - stop - poll + + An instance of a `Spawner` subclass is created for each user. """ - + db = Any() user = Any() hub = Any() authenticator = Any() api_token = Unicode() - ip = Unicode('127.0.0.1', - help="The IP address (or hostname) the single-user server should listen on" + + ip = Unicode( + '127.0.0.1', + help=""" + The IP address (or hostname) the single-user server should listen on. + + The JupyterHub proxy implementation should be able to send packets to this interface. + """ ).tag(config=True) - port = Integer(0, - help="The port for single-user servers to listen on. New in version 0.7." + + port = Integer( + 0, + help=""" + The port for single-user servers to listen on. + + Defaults to `0`, which uses the default port (8888). + + New in version 0.7. + """ ) - start_timeout = Integer(60, - help="""Timeout (in seconds) before giving up on the spawner. - + + start_timeout = Integer( + 60, + help=""" + Timeout (in seconds) before giving up on starting of single-user server. + This is the timeout for start to return, not the timeout for the server to respond. Callers of spawner.start will assume that startup has failed if it takes longer than this. start should return when the server process is started and its location is known. """ ).tag(config=True) - http_timeout = Integer(30, - help="""Timeout (in seconds) before giving up on a spawned HTTP server + http_timeout = Integer( + 30, + help=""" + Timeout (in seconds) before giving up on a spawned HTTP server Once a server has successfully been spawned, this is the amount of time we wait before assuming that the server is unable to accept @@ -68,22 +91,38 @@ class Spawner(LoggingConfigurable): """ ).tag(config=True) - poll_interval = Integer(30, - help="""Interval (in seconds) on which to poll the spawner.""" + poll_interval = Integer( + 30, + help=""" + Interval (in seconds) on which to poll the spawner for single-user server's status. + + At every poll interval, each User's Spawner's `.poll` method is called, which checks + if the single-user server is still running. If it isn't running, then JupyterHub modifies + its own state accordingly and removes appropriate routes from the configurable proxy. + """ ).tag(config=True) + _callbacks = List() _poll_callback = Any() - + debug = Bool(False, - help="Enable debug-logging of the single-user server" + help=""" + Enable debug-logging of the single-user server. + + These logs will be sent to wherever the single-user server is configured to send its logs + to (stderr by default). Your installation might need a log collection setup locally setup + if you want to capture all single-user server logs in one place. + """ ).tag(config=True) - - options_form = Unicode("", help=""" + + options_form = Unicode( + "", + help=""" An HTML form for options a user can specify on launching their server. The surrounding `