-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
How to configure a local volume for Jupyterhub_spawner.py #933
Comments
JupyterHub will use the default storage class to create a PV for every user's home directory. You probably don't want to give each user the same home directory. In addition to the volume mounted at /home/joyvan you could potentially mount another PV that maps to a shared location on the host system. To mount extra volumes you probably want to modify volumes and volume mounts here kubeflow/kubeflow/core/kubeform_spawner.py Line 154 in d90ffcc
You'll want to set them to the appropriate values for the volumes and volummounts parameters in PodTemplateSpecs. You can use that to mount whatever PVs you created. /cc pdmack |
I really appreciate the response. My setup may be a little unique in that I'm running minikube on a bare metal machine (i.e. vm-driver=none) so minikube's host path mounts directly to my host path (i.e. bare metal). I should be able to take advantage of the hostPath volume type, which doesn't require a persistent volume definition or persistent volume claim, nor does it seem to need a storage class. I got another pod running with this setup. This may not be the ideal setup in a multi-user environment, but it's sufficient for now. Here's the toy example I got running using a hostPath volume:
Following this toy example, I tried to follow a similar approach for kubeflow and made some changes to jupyterhub_spawner.py & jupyterhub.libsonnet but this didn't do the trick. NB: I'm on tag v0.1.2 per the the user_guide.md. The newly spawned jupyter pods continue to show up with the following volume mounted:
On a side note, I restored the default storage class to the standard OOTB one and deleted my storage class I mentioned above. Is there an issue with the way that I'm filling out/editing the volume specs or are there other changes required to use the hostPath volume? |
What is the pod spec for the resulting notebook pod that gets spawned? In particular does volumes and volumeMounts have the paths expected? |
I've pasted the yaml below, which doesn't reflect the updates to the jupyterhub_spawner.py or jupyterhub.libsonnet files.
|
It looks like the changes to kube_spawner.py Are only set if the pvc_mount parameter is set; this gets mapped to a ksonnet parameter. But for the host path there's no reason to make it conditional in your case; so you could just remove the if statement so that it is always set. |
All is well that ends well. I think kubeflow v0.1.2 wasn't respecting the changes I was making to jupyterhub_spawner.py. For example, Really excited to get to work with this. Thanks for the help. |
…flow#933) * image gcr.io/kubeflow-images-public/tf_operator:vmaster-gd455e6ef * Image built from kubeflow/kubeflow@d455e6ef
I'm in the last stretch of configuring a minikube cluster on bare metal. I've got the kubeflow app running and can spawn a jupyter notebook running tf 1.7 (gpu version). I'm trying to configure a local volume to be mounted into the spawned jupyter notebook pod. My goal is to be able to interact with the local storage folder on the desktop (i.e. move datasets around, persist notebooks, etc.) and also be able to access this data from within the pods across pod restarts. Ideally, I could just use most of the 2TB SSD drive on the computer for all users to share, though I'm open to each of ~3 users having their own storage volume. Any help is greatly appreciated.
Here's what I've done so far:
Create persistent volume so we can save our work
Create a storage class for this local storage
Change the default storage class
Edit the jupyterhub_spawner.py file to create a PVC for this newly created PV
What changes do I have to make to jupyterhub_spawner.py (or otherwise) to mount my local persistent volume to the jupyter pod when I start the server?
Start my jupyter notebook
Thanks again for any help here.
The text was updated successfully, but these errors were encountered: