I’m pretty new to developing in the JupyterHub environment. I’m looking to use Voila to create a dashboard from a notebook.
From the docs is sounds pretty straightforward. Thus far I have:
run voila my_notebook.ipynb from the terminal. This completes successfully and tells me that “Voilà is running at: http://localhost:8866/”
navigated to https://hub.cryointhecloud.com/user/rwegener2/voila
but I get a 404 not found error. The docs note that
Voilà can also be used as a notebook server extension, both with the notebook server or with the jupyter server.
but I’m not sure I understand how jupyter server fits in, or how it differs from jupyter server proxy. The jupyterhub-jupyter-server-proxy extension is installed on this hub.
So, my primary question is “What am I missing to set up the voila dashboard?”. Right now I am guessing the missing piece is related to my confusion about servers and server proxies.
If you have jupyter-server-proxy installed in your single user environment, try to navigate to https://hub.cryointhecloud.com/user/rwegener2/proxy/8866/ (trailing slash is important) assuming your voila dashboard is running at 8866 port.
To access the dashboard using /voila endpoint you need to register the endpoint with jupyter-server-proxy. Here are the docs on how to setup proxy servers
If you’ve installed the extension correctly you shouldn’t need jupyter-server-proxy, nor should you need to run voila from the command line. You should be able to go to /voila instead of /lab in your browser.
How did you install voila? Can you show us your full environment?
Using hub.cryointhecloud.com/user/rwegener2/proxy/8866/ definitely accesses Voila (progress!), although when testing it on the basics.ipynb voila notebook it spins for >15 minutes on “Executing 6 of 6”. So I’m not sure if that is an issue with the notebook or with the configuration.
I installed voila using conda install -c conda-forge voila. My environment is big, so I’m not allowed to post the full thing in this comment, but a gist with the output of conda listis here.
I came across this the other day with code that had worked before with Voila. In that case it was definitely the Plotly/ipywidgets code in notebook (or current Voila handling that code) and not the configuration. So my guess is that in the case where you are describing something similar is the notebook or how current Voila handles something now that didn’t hang it up before. In my case, I knew that Plotly code embedded in ipywidgets.interactive() had worked before in Voila and so I removed the plotly Plot and then it worked again in a very current Voila and via that experiment I knew it was Plotly or ipywidgets.interactive() or the combination of it with Voila (for the present).
Further complicating diagnosing this all, that basics.ipynb notebook you reference runs perfectly in Voila where I was seeing Plotly hang things up (code is hereand you absolutely don’t want the last line a.value=5 included at all because that really just causes Voila to spin without even saying it is executing, even though the code runs fine in Jupyter.). So who knows. (You can test in sessions launched from here if anyone is interested.)
Hi, can you please tell me what extension you are talking about here? I am trying to integrate Voila with Jupyterhub (TLJH on custom server), after authentication the user to redirect to voila dashboard. Is this even possible?
if you have voilà installed, you should have a server extension that provides pages at e.g. /user/:name/voila/render/path/to/notebook.ipynb, where /user/:name/lab/tree/path/to/notebook.ipynb would open the notebook in JupyterLab.
So if you have a specific voila notebook that you want to use as your landing page, you can set:
Thanks for your answer. Can you please tell me more about this server extension you are talking about? I have installed Voila using pip install voila command on my server.
the server extension is voila, it is part of the voila package. If you have done pip install voila, you have it. jupyter server extension list should show it under vola.server_extension:
that would be governed by the permissions of the JupyterHub users. If they have the relevant access:servers scope, they will be able to visit the dashboard.