alan-turing-institute / hub23-deploy

A repo to manage the Turing BinderHub instance
https://alan-turing-institute.github.io/hub23-deploy
MIT License
9 stars 4 forks source link

Hub23 Binder launch fails: User already has a server running #17

Closed sgibson91 closed 4 years ago

sgibson91 commented 5 years ago

Summary

An authenticated user gets a named pod on the Kubernetes cluster. This mean if they try to relaunch a Binder or launch a new Binder without either:

they will receive the following launch error:

Found built image, launching...
Launching server...
Launch attempt 1 failed, retrying...
Launch attempt 2 failed, retrying...
Launch attempt 3 failed, retrying...
User <username> already has a running server.
Config below ``` config: BinderHub: use_registry: true image_prefix: - hub_url: http:// auth_enabled: true jupyterhub: cull: every: 660 timeout: 600 maxAge: 21600 hub: services: binder: oauth_redirect_uri: "http:///oauth_callback" oauth_client_id: "binder-oauth-client-test" extraConfig: hub_extra: | c.JupyterHub.redirect_to_server = False binder: | from kubespawner import KubeSpawner class BinderSpawner(KubeSpawner): def start(self): if 'image' in self.user_options: # binder service sets the image spec via user options self.image = self.user_options['image'] return super().start() c.JupyterHub.spawner_class = BinderSpawner singleuser: cmd: jupyterhub-singleuser auth: type: github github: clientId: "xxxx" clientSecret: "xxxx" callbackUrl: "http:///hub/oauth_callback" orgWhitelist: - "binderhub-test-org" scopes: - "read:user" ```

https://discourse.jupyter.org/t/binder-failed-to-launch-user-already-has-a-server-running/929

What needs to be done?

Who can help?


Updates

sgibson91 commented 5 years ago

Going to investigate "named servers" to label user pods with the repo name rather than the user's name. This should recover the functionality of an "anonymous" BinderHub and allow the same user to launch the same or different repos in quick succession without having to wait for the culler to remove their pod.

sgibson91 commented 4 years ago

Named servers: https://binderhub.readthedocs.io/en/latest/authentication.html#authentication-with-named-servers