JuliaGizmos / WebIO.jl

A bridge between Julia and the Web.
https://juliagizmos.github.io/WebIO.jl/latest/
Other
228 stars 64 forks source link

No longer works with binderhub project #239

Open djsegal opened 5 years ago

djsegal commented 5 years ago

It looks for files at:

But the files are actually at:

twavv commented 5 years ago

What version of WebIO are you using?

djsegal commented 5 years ago

v0.2.8

// see the linked PR for one way to resolve this

djsegal commented 5 years ago

@travigd does this make sense?

twavv commented 5 years ago

That PR conflicts with the current version of WebIO as it seems to be based on an old version. The current version is 0.7.0, and new work is generally being focused on the webio-retool branch (which I believe will ultimately be v1.0.0).

djsegal commented 5 years ago

@shashi can you take a look at the PR and tell me if it'll break anything?

// if not, ill get it working on master or webio-retool

mmikhasenko commented 5 years ago

Is this thread still open? The title sounds exactly as I would be creating.

The `WebIO is not detected when running binder. https://mybinder.org/v2/gh/mmikhasenko/2019-10-16_MIAPP/master?filepath=julia-demo%2Fpole_vs_log.ipynb

Julia-1.2
WebIO v0.8.11
mmikhasenko commented 5 years ago
; jupyter nbextension list

tells that everything is ok

Known nbextensions:
  config dir: /home/jovyan/.jupyter/nbconfig
    notebook section
      webio-jupyter-notebook  enabled 
  config dir: /srv/conda/envs/notebook/etc/jupyter/nbconfig
    notebook section
      jupyter-js-widgets/extension  enabled 
      - Validating: OK
      - Validating: OK

reinstallation as suggested in https://juliagizmos.github.io/WebIO.jl/latest/troubleshooting/not-detected/#WebIO-Not-Detected-1 does not help

twavv commented 5 years ago

This issue is that we don't install the nbextension automatically anymore, so you have to run WebIO.install_jupyter_nbextension() and refresh the notebook page so that it is loaded. Based on your jupyter nbextension list output, it should work if you simply refresh.

Perhaps we can modify the build to detect if it's running under Binder. Perhaps checking for the BINDER_PORT environment variable? Then we could install the extension during the build process.

EDIT: Upon looking closer, I can see another issue. WebIO installs a server extension to run the asset server (AssetServer.jl). This requires the jupyter notebook process to be restarted to take effect which isn't possible in the binder environment. Perhaps the extra build check I described above might help (depending on when Binder installs and builds the Julia packages - before or after starting the notebook server).

mmikhasenko commented 5 years ago

What does it mean "to refresh"? I restarted the notebook several times, also after reinstalling, and couldn't make it work.

Did my binder notebook with @manipulate work fine for you?

Thank you for the quick response

twavv commented 5 years ago

By refresh I just mean Ctrl+R to refresh the page after running install_jupyter_nbextension.

No, interact doesn't work because of the asset server issue I described (it needs to load custom JS and CSS files and it does so using assetserver).

mmikhasenko commented 5 years ago

Ok, thanks for the clarification.

Do you think the required installation can be described in the environment.yml file? E.g. https://github.com/binder-examples/appmode/blob/master/environment.yml

mmikhasenko commented 5 years ago

Would it be a possible workaround to pin the older version of WebIO?

mmikhasenko commented 5 years ago

Just found a solution! - Adding a postBuild file to the repository.

#!/bin/bash
julia -e 'using WebIO; WebIO.install_jupyter_nbextension();'

I'm super happy, my examples are working again.

twavv commented 5 years ago

Awesome! Would be neat if we could incorporate that into WebIO's build process so as not to require people to do it manually.

mmikhasenko commented 5 years ago

I am not sure that a special case for the binder is the right idea. What is about checking if IJulia is installed?

haskey(Pkg.installed(),"IJulia") && WebIO.install_jupyter_nbextension()

Nevertheless, I checked ENV["BINDER_PORT"] when running at the binder,

"tcp://10.15.253.247:80"
twavv commented 5 years ago

IJulia is a dependency of WebIO (largely as a result of the lack of "optional dependencies" in Julia), so that wouldn't work. Also, I think the BINDER_PORT variable is set by the Kubernetes runtime and isn't set when the image is being built.

We could check for the NB_PYTHON_PREFIX variable which is (supposed to be?) set by repo2docker (which prepares a repo for binder).