Skip to content
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

singleuser.storage.homeMountPath not working? #3258

Closed
BlueCog opened this issue Oct 26, 2023 · 4 comments
Closed

singleuser.storage.homeMountPath not working? #3258

BlueCog opened this issue Oct 26, 2023 · 4 comments
Labels

Comments

@BlueCog
Copy link

BlueCog commented Oct 26, 2023

Bug description
When setting singleuser.storage.homeMountPath: to: /opt/app-root/src (https://z2jh.jupyter.org/en/stable/resources/reference.html#singleuser-storage-homemountpath)

The home directory is /opt/app-root (The Jupyter root dir) and not /opt/app-root/src.
Note: The personal pvc of the user is mounted to /opt/app-root/src so this works correctly.

The issue is that when a user spawns a Notebook the users starts in /opt/app-root and not in /opt/app-root/src.

When using older versions of the Helm Chart (v2) this was working correctly.

Expected behaviour
The home directory should be /opt/app-root/src

Actual behaviour
The home directory is /opt/app-root

personal set up

  • k8s (OpenShift)
  • hub is installed on: ubi8-minimal:8.7-1107

Settings:

    storage:
      capacity: 5Gi
      dynamic:
        pvcNameTemplate: personal-claim-{username}
      homeMountPath:  /opt/app-root/src    
@BlueCog BlueCog added the bug label Oct 26, 2023
@manics
Copy link
Member

manics commented Oct 26, 2023

homeMountPath should only affect where the storage is mounted, it shouldn't affect the users $HOME directory or the starting directory for the notebook. How have you configured the home/starting directory? Is it built-in to your image?

@BlueCog
Copy link
Author

BlueCog commented Oct 26, 2023

Hello @manics Thanks for the quick reply!

Ok that makes sense... I guess the base image settings are forcing $HOME to /opt/app-root We are using new images since version 2 of the helm chart so that could also be the case.

I've tried to set $HOME in the z2jh Helm chart: singleuser.extraEnv. Now $HOME points to the right directory but the Lab environment is still starting at /opt/app-root. After some searching there was a flag for jupiter (--NotebookApp.notebook_dir) to configure this. But i'm not sure how this is works in the context of z2jh... Do you maybe have a pointer on this?

@BlueCog
Copy link
Author

BlueCog commented Oct 26, 2023

Update:

We are using singleuser.profilelist and i've found an notebook_dir setting in kubespawner. I'm able to force to start in /opt/app-root/src by setting: notebook_dir: "/opt/app-root/src" (under singleuser.profilelist.[].kubespawner_override:)

Not sure if this is the best / global way to go. But this works for us.

https://jupyterhub-kubespawner.readthedocs.io/en/latest/spawner.html#kubespawner.KubeSpawner.notebook_dir

@yuvipanda
Copy link
Collaborator

@BlueCog you can also try setting working_dir instead.

@BlueCog BlueCog closed this as completed Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants