jupyanno icon indicating copy to clipboard operation
jupyanno copied to clipboard

Run locally

Open joshy opened this issue 7 years ago • 9 comments

Is there a way to run it locally? If there is how, instructions would be nice.

joshy avatar Aug 15 '18 13:08 joshy

yea you can use https://github.com/jupyter/repo2docker

jupyter-repo2docker https://github.com/chestrays/jupyanno

then just run the docker with port 8888 (jupyter) public

kmader avatar Aug 15 '18 15:08 kmader

Hmm, seems not to work or I did something wrong.

  • I did checkout locally.
  • Then run juypter-repo2docker <path to checkout jupyanno> Got error:
Traceback (most recent call last):
  File "/home/joshy/anaconda3/envs/jupyter/bin/jupyter-repo2docker", line 11, in <module>
    sys.exit(main())
  File "/home/joshy/anaconda3/envs/jupyter/lib/python3.6/site-packages/repo2docker/__main__.py", line 6, in main
    f.start()
  File "/home/joshy/anaconda3/envs/jupyter/lib/python3.6/site-packages/repo2docker/app.py", line 557, in start
    self.log.debug(picked_buildpack.render(),
  File "/home/joshy/anaconda3/envs/jupyter/lib/python3.6/site-packages/repo2docker/buildpacks/base.py", line 311, in render
    post_build_scripts=self.get_post_build_scripts(),
  File "/home/joshy/anaconda3/envs/jupyter/lib/python3.6/site-packages/repo2docker/buildpacks/base.py", line 415, in get_post_build_scripts
    DOC_URL+'#system-post-build-scripts'))
ValueError: binder/postBuild is not executable, see http://repo2docker.readthedocs.io/en/latest/samples.html#system-post-build-scripts for help.

The url http://repo2docker.readthedocs.io/en/latest/samples.html#system-post-build-scripts is not a valid one.

Why am I doing this? Because if we want to annotate with "our" data it should run inside the hospital.

joshy avatar Aug 15 '18 15:08 joshy

I think you have an outdated version of repo2docker the postBuild not being executable has already been fixed @betatim in any event chmod a+X binder/postBuild should fix it

kmader avatar Aug 15 '18 15:08 kmader

The version installed by pip is version 0.5.0 which is the latest, but this is quite old, Feb 7th. However chmod a+x binder/postBuild fixed the postBuild not being executable.

Next error is: ./binder/postBuild: line 9: unzip: command not found.

Here is the output:

Installing /srv/conda/lib/python3.6/site-packages/fileupload/static -> fileupload
Making directory: /home/joshy/.local/share/jupyter/nbextensions/fileupload/
Copying: /srv/conda/lib/python3.6/site-packages/fileupload/static/widget.js -> /home/joshy/.local/share/jupyter/nbextensions/fileupload/widget.js
Copying: /srv/conda/lib/python3.6/site-packages/fileupload/static/extension.js -> /home/joshy/.local/share/jupyter/nbextensions/fileupload/extension.js
Making directory: /home/joshy/.local/share/jupyter/nbextensions/fileupload/fileupload
Copying: /srv/conda/lib/python3.6/site-packages/fileupload/static/fileupload/widget.js -> /home/joshy/.local/share/jupyter/nbextensions/fileupload/fileupload/widget.js
- Validating: OK

    To initialize this nbextension in the browser every time the notebook (or other app) loads:
    
          jupyter nbextension enable fileupload --user --py
    
Enabling notebook extension fileupload/extension...
      - Validating: OK
./binder/postBuild: line 9: unzip: command not found
Removing intermediate container f49911bfabb3
 ---> 42751f5094fe
{"aux": {"ID": "sha256:42751f5094fe9fea1fb928fef1548825e6386264a9241be219d4c4b96f60f543"}}Successfully built 42751f5094fe
Successfully tagged r2djupyanno-2f1534348754:latest
[I 16:05:09.324 NotebookApp] Writing notebook server cookie secret to /home/joshy/.local/share/jupyter/runtime/notebook_cookie_secret
[I 16:05:09.503 NotebookApp] Appmode server extension loaded.
[I 16:05:09.516 NotebookApp] JupyterLab alpha preview extension loaded from /srv/conda/lib/python3.6/site-packages/jupyterlab
[I 16:05:09.516 NotebookApp] JupyterLab application directory is /srv/conda/share/jupyter/lab
[I 16:05:09.518 NotebookApp] nteract extension loaded from /srv/conda/lib/python3.6/site-packages/nteract_on_jupyter
[I 16:05:09.520 NotebookApp] Serving notebooks from local directory: /home/joshy
[I 16:05:09.520 NotebookApp] 0 active kernels
[I 16:05:09.520 NotebookApp] The Jupyter Notebook is running at:
[I 16:05:09.520 NotebookApp] http://0.0.0.0:51333/?token=69dcd55a930fb1ec79c69e39ee24964e4c51a9d12dfce678
[I 16:05:09.520 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[W 16:05:09.520 NotebookApp] No web browser found: could not locate runnable browser.
[C 16:05:09.521 NotebookApp]

    Copy/paste this URL into your browser when you connect for the first time,
    to login with a token:
        http://0.0.0.0:51333/?token=69dcd55a930fb1ec79c69e39ee24964e4c51a9d12dfce678

Despite the error I can open the url but I guess it should directly run the annotation application, right?

joshy avatar Aug 15 '18 16:08 joshy

yea unzip was added to the main repo2docker awhile back as well, so without it the images wont be extracted.

kmader avatar Aug 15 '18 16:08 kmader

you can open the url, open the anno_app.ipynb and click the appmode button or you can add /muapps/random_user/anno_app.ipynb to the url and it should run

so in your case: http://0.0.0.0:51333/muapps/random_user/anno_app.ipynb

kmader avatar Aug 15 '18 16:08 kmader

(Sorry for the poor repo2docker experience. We are about 10 years behind with making releases. You should be Ok running directly from master. This is what mybinder.org does ... which is why we are so behind on making releases.)

I think for using it locally we shouldn't use repo2docker. We should aim to get to a point where you can pip install jupyanno and have an example notebook you can use with an already existing notebook server (for example if someone runs a JupyterHub for you). This would allow you to annotate your own data yourself.

In a second step we then figure out some opinionated examples of how to have several users of the same jupyterhub annotate the same data. This is going to be a bit more tricky/needs to make assumptions in order to share the annotation notebook with others etc.

Connected to #34

betatim avatar Aug 16 '18 06:08 betatim

Pip install will be tricky with appmode, I guess we will need to setup conda builds as part of CI

kmader avatar Aug 16 '18 07:08 kmader

What specifically won't work with appmode? There must be a PyPI entry for appmode.

Let's move a discussion about how to package/distribute juypanno to #41.

betatim avatar Aug 16 '18 07:08 betatim