Modules not found while login again from same credentials.

37 views
Skip to first unread message

vishal sharma

unread,
Nov 12, 2020, 8:59:25 AM11/12/20
to Project Jupyter
When we login on jupyterhub , a POD creates . but if we log out pod deleted ,
Why it deleted  ?

When we login again from same credentials , again same new pod created but it did not have previously downloaded modules although it is using same pvc

For example :
I installed pandas as below in notebook.
pip install pandas 
Next day , when i opened it with same credentials , pandas module was not present .

How to fix it ?

Robert Schroll

unread,
Nov 12, 2020, 2:50:31 PM11/12/20
to jup...@googlegroups.com, Project Jupyter
On Nov 12 2020, at 5:59 am, vishal sharma <vis...@gmail.com> wrote:
When we login on jupyterhub , a POD creates . but if we log out pod deleted ,
Why it deleted  ?

Without knowing anything about your configuration, my first guess would be that shutdown_on_logout [1] is set to be true.


When we login again from same credentials , again same new pod created but it did not have previously downloaded modules although it is using same pvc

For example :
I installed pandas as below in notebook.
pip install pandas 
Next day , when i opened it with same credentials , pandas module was not present .

I'm assuming, based on references to a pod and a pvc, that you're running JupyterHub on Kubernetes.  Is that correct?

If so, the usual configuration is to mount the persistent volume as the user's home directory.  If that's what you've done, only changes to the home directory will persist; changes to any other part of the filesystem will be lost when the container stops.  If your Python system is set up to install packages someplace other than the user's home directly, those will be lost when the pod shuts down.

If you're trying to solve this in general, you'd need to adjust your singleuser image to make installs go somewhere in the home directory.  But if you're just trying to solve it for you, I'd recommend making a virtual environment in your home directory and installing the packages you need within that virtual environment.  (Note that you can install and register an ipython kernel within that environment, so that you can run notebooks within it.)

Hope that helps,
Robert

vishal sharma

unread,
Nov 13, 2020, 1:44:10 AM11/13/20
to Project Jupyter
Can we handle " shutdown_on_logout" from Jupyter UI ?  if not from UI , then where i need to change it to 'false' .
After changing do i need to perform helm upgrade again , if yes then is there any affect on my current notebooks.


Regards,
Vishal

Robert Schroll

unread,
Nov 15, 2020, 9:55:22 PM11/15/20
to jup...@googlegroups.com, Project Jupyter
On Nov 12 2020, at 10:44 pm, vishal sharma <vis...@gmail.com> wrote:
Can we handle " shutdown_on_logout" from Jupyter UI ?  if not from UI , then where i need to change it to 'false' .

I'm not aware of any UI access to this setting.  It's set as are all JupyterHub settings: in the jupyterhub_config.py file or via command-line options.  The JupyterHub documentation explains the details: https://jupyterhub.readthedocs.io/en/stable/getting-started/config-basics.html
Note that if you're using Zero to JupyterHub, you can add configuration in the hub.extraConfig property: https://zero-to-jupyterhub.readthedocs.io/en/latest/resources/reference.html#hub-extraconfig

After changing do i need to perform helm upgrade again , if yes then is there any affect on my current notebooks.

This will depend entirely on how you've configured your deploy.  Your hub will have to be restarted to pick up the new settings.  If the new settings are included in your helm config, then a helm upgrade is probably the easiest thing to do.

If you're running a separate proxy, existing users should not notice a hub restart.  If not, I suspect, though I do not know for sure, that all existing websocket connections will be dropped, and users would have to reconnect to their kernels to continue.

As an aside, you're more likely to get definite answers if you actually take the time to describe your system, instead of making us guess what you did.

Robert

vishal sharma

unread,
Nov 18, 2020, 7:55:35 AM11/18/20
to Project Jupyter
Hi Robert
I have deployed Jupyterhub via Zero to JupyterHub with Kubernetes , so can I add module "shutdown_on_logout" in my config.yaml and run the helm upgrade , will helm upgrade entertain these changes ? and is there any data loss with it ?

Robert Schroll

unread,
Nov 18, 2020, 10:11:33 PM11/18/20
to jup...@googlegroups.com, Project Jupyter
On Nov 18 2020, at 4:55 am, vishal sharma <vis...@gmail.com> wrote:
I have deployed Jupyterhub via Zero to JupyterHub with Kubernetes , so can I add module "shutdown_on_logout" in my config.yaml and run the helm upgrade , will helm upgrade entertain these changes ? and is there any data loss with it ?

Helm upgrade will update and restart any services necessary to achieve your desired state, so that should be all you need.  The default with z2jh is to run a separate proxy, so only users trying to access the hub directly will notice any delay during the upgrade.  Users interacting with their individual servers should remain blissfully unaware of any change.

I should point out that I'm just guessing about this particular parameter, so you may want to test this theory out on a test hub before changing configurations on a production deploy.

Robert

Reply all
Reply to author
Forward
0 new messages