binderhub.launcher
Launch an image with a temporary user via JupyterHub
Launcher
binderhub.launcher.
Object for encapsulating launching an image for a user
config c.Launcher.allow_named_servers = Bool(False)
Named user servers are allowed. This is used only when authentication is enabled and to set unique names for user servers.
api_request
Make an API request to JupyterHub
launch
Launch a server for a given image
creates a temporary user on the Hub if authentication is not enabled
spawns a server for temporary/authenticated user
generates a token
returns a dict containing: - url: the URL of the server - image: image spec - repo_url: the url of the repo - extra_args: Dictionary of extra arguments passed to the server - token: the token for the server
url
image
repo_url
extra_args
token
config c.Launcher.named_server_limit_per_user = Int(0)
Maximum number of concurrent named servers that can be created by a user.
config c.Launcher.pre_launch_hook = Callable(None)
An optional hook function that you can use to implement checks before starting a user’s server. For example if you have a non-standard BinderHub deployment, in this hook you can check if the current user has right to launch a new repo.
Receives 5 parameters: launcher, image, username, server_name, repo_url
config c.Launcher.retries = Int(4)
Number of attempts to make on Hub API requests.
Adds resiliency to intermittent Hub failures, most commonly due to Hub, proxy, or ingress interruptions.
config c.Launcher.retry_delay = Int(4)
Time (seconds) to wait between retries for Hub API requests.
Time is scaled exponentially by the retry attempt (i.e. 2, 4, 8, 16 seconds)
unique_name_from_repo
Generate a unique name for a git repo url
e.g. minrk-binder-example-abc123 from https://github.com/minrk/binder-example.git