Kubeflow "Unboxing" - Part 3 - Jupyter Notebooks (Almost)
- Derek Ferguson
- Dec 17, 2018
- 2 min read
So, as with the past 2 parts, we'll have to jump around a bit between different docs here, also. I'm starting with Jupyter because I think this represents the logical first step in most ML use cases - spawning a notebook in which to try out some model creation.
Doc 1 -- https://www.kubeflow.org/docs/guides/accessing-uis/
Since our previous steps dumped all the Kubeflow pods into the default namespace, the command to forward the required ports for the default UI is..
kubectl port-forward `kubectl get pods --selector=service=ambassador -o jsonpath='{.items[0].metadata.name}'` 8080:80
If this works, it will return a couple of lines indicating that it is now forwarding traffic from 80 to 8080 and your current terminal will be blocked - as this is now a foreground proxy process.
Open a browser to port 8080 and you should be prompted to login. Note: if it bombs at first - give it a couple of minutes... it seemed a little slow on my cluster.
Log in with whatever username and password you like, but note that the username use use is going to be appended to your Docker image, so will be used below to check the status of provisioning your notebook.
Doc 2 -- https://www.kubeflow.org/docs/guides/components/jupyter/
Doc 3 -- https://jupyterhub.readthedocs.io/en/stable/
Not having used Jupyter Notebook before (am I the only one who learned Python to use TensorFlow instead of the other way around? VS Code's always been my tool of choice - but, clearly I'm in the minority on this one), I struggled a bit to figure out what would be good values here. Honestly, was stuck for a bit on the images because it wasn't clear until I actually clicked in it that this is a pop-up element (at least Chrome doesn't make this clear)...
At the time of writing, the second-from-the-bottom is the latest version of TF and doesn't require GPU. I'm not sure I have GPU capacity in my cluster (sadly), so I'm going with that one.
Further instructions suggest 1.0 CPU and 2Gi memory as starters, so we'll try that next.
"Extra Resource Limits" -- leave blank
The instructions above warn that this could take a long time, and I can confirm that I found this to be the case. The 10 GB download is a killer. Check status with...
kubectl describe pods jupyter-XXXXX
Where XXXXX is the username you used to log into the Jupyter Notebook above (see - I told you that you'd need to remember it!)
When the web page updated, my luck had run out. The Jupyter Notebook was there, but it indicated that it could not connect to the server, but would keep trying. It kept trying - but never could. Restarting everything made no difference.
Thankfully, launching the Network monitor in Firefox provided a vital clue - a 403 error. So, the connection was being made, but refused. Some careful Googling lead to this defect report. So, fixing this issue will require upgrading Kubeflow.
Comments