Closed dstndstn closed 5 years ago
+1 on this, thanks so much, been banging my head against a wall troubleshooting this.
If you don't do this. You get a 404 from the singleserver auth call back to the hub.
I have made some progress on this issue.
batchspawner.api
adds the handler to jupyterhub.default_handlers. When we use batchspawner directly in jupyterhub_config, the import of the api file is done before the JupyterHub app is launched and the batchspawner api handler is correctly appended to the Hub list of handlers.
However, when it is configurer through wrapspawner, the import of batchspawner.api come after jupyterhub app is initialized, and it is too late to add content do jupyterhub.default_handlers
.
Now that I know what is the issue, I am going to try to find a solution...
After a few hours of research, it appears that the only way to add a custom handler to JupyterHub except for what I already did in batchspawner.api
is to add the api handler in jupyterhub_config.py
.
So instead of import batchspawner.api
, to solve your initial issue you could add the following line to your jupyterhub_config.py
:
c.JupyterHub.extra_handlers = [(r"/api/batchspawner", 'batchspawner.api.BatchSpawnerAPIHandler')]
We will need to add this line to the documentation.
Hi,
I've just got my jupyterhub + profilespawner + batchspawner setup working on a typical academic compute cluster (slurm). Thanks for all your work on this -- it's impressively slick!
I found that I had to add an "import batchspawner.api" to my jupyterhub_config.py file, otherwise the batchspawner's API endpoint didn't get registered. Unless I have done something wrong, it would be worth adding a one-liner to the README file to this effect. (I'll send a PR if you tell me that I'm not wrong.)
Specifically, my jupyterhub_config looks like this, and without the import, the API endpoint gets called but not responded-to!
Thanks!