-
Notifications
You must be signed in to change notification settings - Fork 304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
c.KubeSpawner.default_url = '/lab' is correct? #149
Comments
I see the difference between KubeSpawner and dockerspawner KubeSpawner
dockerspawner
|
Workaround: Looking at the code here https://github.com/jupyterhub/kubespawner/blob/master/kubespawner/spawner.py#L1159 , you can see that I guess this check is there to avoid overriding the default |
I am currently also facing the issue that I can not set jupyterlab as the default, even though it seems to be more complicated in my case. I am using a custom spawner build upon the kubespawner and providing
Does not lead to jupyterlab being loaded initially. I am instead even getting an error This seems to have to do with me providing an own entrypoint script in the image used for the single user, because I have to execute some steps that can not be executed during the construction in the Dockerfile: End of Dockerfile:
end of my-entrypoint.sh:
It seems that this way, the parameters do not have any effect. To mention: I am using z2jh, adding the lab parameters directly via the z2jh interface instead of in the extraconfig also didn't help. I already tried to replace the command at the end of my entrypoint-script with:
(Also tried that without the path to the file) As this should according to the docker-stacks be a way to execute jupyter lab after startup of the notebook environment, but this just causes the container to terminate directly, so it does not even start up successfully. My question: I guess I would somehow have to hand in the parameters to the exec command in the entrypoint script? Or is there really an issue with the lab parameters for kubespawner? I also already tried
as well as leaving away the outer quotes. But that also had the startup failing completely |
I am using custom docker images as well, but I went with the startup scripts from https://github.com/jupyter/docker-stacks/tree/master/base-notebook Just be careful with scripts in that folder as scripts ending with .sh will be sourced and all other executable file will run in a sub shell. I guess most of the documentation and examples are tied to the entry point scripts provided by the docker-stacks images. |
Hmmm I dont understand why, but perhaps you need to set c.Spawner.default_url rather than c.KubeSpawner.defualt_url? I recall some issue with this myself that i never grasped. PS: this may be useful to have watched to better grasp whats going om: https://m.youtube.com/watch?v=_gYEVTaNuKU See https://github.com/jupyterhub/zero-to-jupyterhub-k8s/blob/master/images/hub/jupyterhub_config.py |
Thank you both for your feedback! @gweis That is amazing. I didn't read the scripts careful enough to know that this is possible. Hopefully that already simplifies the image and script and makes the jupyterlab thing work @consideRatio Thanks for the resources! Yeah I already tried setting the attributes on my custom spawner and directly on the spawner class. I think the entrypoint script was blocking it. Will have a look, what is the easiest/most intuitive way to make it work now. |
UPDATE: So the method as suggested by gweis works, then the Spawner.default_url and the Spawner.cmd are respected. However this is not working out of the box when you try to grant sudo to the users. Referring to jupyterhub/zero-to-jupyterhub-k8s#562, you would have to set
which results in the following error:
Following the tip to set:
as provided in the thread (jupyterhub/zero-to-jupyterhub-k8s#562 (comment)) is not an option, as setting Guess one would have to fall back to provide the sudo rights in our custom image as proposed in the same thread: |
This issue is quite old and many things have changed since it was written, but to summarize.
|
I still face this issue. |
I still face this issue. Does someone have a workaround solution? |
If you were using JupyterHub 2.0, it might be fixed by jupyterhub/jupyterhub#3918 in 2.3.1. |
I set
c.KubeSpawner.default_url = '/lab'
, but when I login from hub , the default url still is/tree
.Other configuration:
The text was updated successfully, but these errors were encountered: