Closed consideRatio closed 4 years ago
@oesteban @satra @alexhuth see the last section of the post above. It will be available on in some minutes on the hub. I'm trying it out and reporting back.
If this works, and you want to make use of this, I suggest that you figure out what you would like to make available to all users in the jupyter_notebook_config.py, and I can make them get access to that.
@oesteban it did the trick! I tried it for your use case. This is the result.
Amazing! Thanks!
On Wed, Jul 29, 2020 at 5:43 PM Erik Sundell notifications@github.com wrote:
Closed #98 https://github.com/neurohackademy/nh2020-jupyterhub/issues/98 via #109 https://github.com/neurohackademy/nh2020-jupyterhub/pull/109.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/neurohackademy/nh2020-jupyterhub/issues/98#event-3599670869, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAESDRUOATLVERI324QBP53R6A7RHANCNFSM4PKH2KHA .
thanks @consideRatio
This was @alexhuth solution - to generate a link and start a webserver with a terminal command using !
from a cell.
@oesteban hope participants could be able to view a set of HTML files from JupyterLab's HTML viewer. There are some challenges and I'll see if I think we can overcome them.
JavaScript - status: disabled (workaround possible)
It's worth nothing that JavaScript in the HTML file viewed using the JupyterLab HTML viewer isn't allowed. I'm not sure about this topic in general but just wanted to make a note about that.
Note that instead of using JupyterLab's HTML viewer, it is possible to view the Jupyter Notebook's servers own HTML viewer, then JavaScript is allowed, this can be done with a link like below.
https://hub.neurohackademy.org/hub/user-redirect/view/data/openneuro/ds000114/derivatives/fmriprep-20.2.0rc0/fmriprep/sub-05.html
Relative file references - status: ok
The image reference
src="./sub-05/figures/sub-05_dseg.svg"
, when viewed with JupyterLab's HTML viewer, translated to a web request sent out from my browser tohttps://hub.neurohackademy.org/user/consideratio/files/data/openneuro/ds000114/derivatives/fmriprep-20.2.0rc0/fmriprep/sub-05/figures/sub-05_dseg.svg
.This worked as we hoped actually, as /user/consideratio was prepended, and /files/data/openneuro/ds000114/... etc was prepended to represent the
./
in the actual link. This was not possible in earlier version of JupyterLab.Access to referenced file - status: 403 error
The crux is that when our browsers parse the HTML and request the file
https://hub.neurohackademy.org/user/consideratio/files/data/openneuro/ds000114/derivatives/fmriprep-20.2.0rc0/fmriprep/sub-05/figures/sub-05_dseg.svg
, it turns out that we get a403: Forbidden
error from the Jupyter notebook server. Its worth noting that JupyterHub is not involved with this, and not even JupyterLab at this point.This is a response following this line of code in the jupyter notebook server.
(I'll update with more information as I continue thinking about this)
Using jupyter-server-proxy
We could perhaps opt to not use the HTML viewer as part of JupyterLab, but an actual dedicated web-server by using jupyterhub/jupyter-server-proxy.
In #108 I've installed the jupyter-server-proxy's labextension, which could if we add configuration, allow users to get a nice button in the launcher to startup a server. To trial this yourself:
Add the following to the file as a demonstrative example.
Hopefully, you should have a button like this showing up alongside the JupyterLab launcher buttons.
NOTE: You must have started your JupyterHub server with the latest image, which followed #108 being merged.