Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add slicer-notebook image #33

Merged
merged 2 commits into from
May 25, 2020
Merged

Conversation

jcfr
Copy link
Member

@jcfr jcfr commented May 12, 2020

This work was adapted from https://github.com/ihnorton/dockerfiles/tree/master/slicer2binder

Todo:

@jcfr
Copy link
Member Author

jcfr commented May 12, 2020

  • Image slicer/slicer-notebook is being published and there is currently only the latest tag. Should be available in 1hr or so.
  • The branch associated with this PR Use slicer/slicer-notebook docker image based of Slicer-4.11 SlicerNotebooks#5 can be used to test in binder
  • when trying to run the notebook, it currently complain with this message ModuleNotFoundError: No module named 'traitlets'. After running pip_install('traitlets'), it doesn't complain .. but the image associated with view is not rendered

This URL will be shortly be valid:
https://mybinder.org/v2/gh/jcfr/SlicerNotebooks/use-slicer-notebook-image?filepath=01_Data_Loading_and_Visualization.ipynb

cc: @lassoan

@jcfr
Copy link
Member Author

jcfr commented May 12, 2020

Binder link is now working, here is a screenshot:

image

@lassoan
Copy link
Contributor

lassoan commented May 12, 2020

Remaining issues:

  • Traitlets import error
    • a traitlet import was left in JupyterNotebooksLib accidentally, removed it now, updating to latest JupyterNotebooks extension will fix the issue
  • ImportError: /home/sliceruser/Slicer-4.11.0-2020-05-11-linux-amd64/lib/Python/lib/python3.6/site-packages/PIL/_imaging.cpython-36m-x86_64-linux-gnu.so: ELF load command address/offset not properly aligned
    • workaround: need to force reinstall PIL, using Pillow: pip_install('--upgrade pillow --force-reinstall') then restart the kernel
    • It would be better to install Pillow in the docker container.
  • ipycanvas widget does not appear
    • probably we need to install ipycanvas in the jupyter notebook (not in the kernel) python3 -m pip install ipycanvas ipyevents

@pieper
Copy link
Member

pieper commented May 12, 2020

ImportError: /home/sliceruser/Slicer-4.11.0-2020-05-11-linux-amd64/lib/Python/lib/python3.6/site-packages/PIL/_imaging.cpython-36m-x86_64-linux-gnu.so: ELF load command address/offset not properly aligned

I have been getting this same error when using the linux build. It should probably be split out as its own build issue.

@lassoan
Copy link
Contributor

lassoan commented May 13, 2020

I've managed to fix all the issues (interactive slice viewer works nicely) and even configured desktop vnc access. You can try it here:

https://mybinder.org/v2/gh/lassoan/SlicerNotebooks/use-slicer-notebook-image

I just need to clean things up a bit and then send a pull request.

@lassoan
Copy link
Contributor

lassoan commented May 14, 2020

@jcfr please check my proposed fixes. This should be ready to go, we can create an issue for the remaining tasks.

@jcfr
Copy link
Member Author

jcfr commented May 15, 2020

Thanks, i will do this tomorrow (or may be tonight)

Thanks for your patience 🙏

@lassoan lassoan force-pushed the add-slicer-notebook branch from 630d802 to b79fe62 Compare May 15, 2020 16:14
@jcfr
Copy link
Member Author

jcfr commented May 15, 2020

Re-building image locally for testing.

@jcfr
Copy link
Member Author

jcfr commented May 15, 2020

Going on a 🏃 .... will check when build is complete.

- install ipython widgets required by JupyterNotebookLib in Slicer (both in Jupyter kernel and client)
- download Slicer application and SlicerJupyter packages from Midas
- fix remote desktop access (switch to jupyter-desktop-server), disable window manager for a cleaner look
- force update PIL using pillow to fix ImportError: ...python3.6/site-packages/PIL/_imaging.cpython-36m-x86_64-linux-gnu.so: ELF load command address/offset not properly aligned
@lassoan lassoan force-pushed the add-slicer-notebook branch from b79fe62 to 89b6bb5 Compare May 15, 2020 17:00
@jcfr
Copy link
Member Author

jcfr commented May 15, 2020

Outstanding ! 🎉 🙏 😄

After building the latest image, I was able to run the image and connect to the notebook using the following:

docker run \
  -p 8888:8888 -p49053:49053 \
  -v /home/jcfr/Projects/SlicerNotebooks:/work  \
  -w /work \
  --rm -ti slicer/slicer-notebook

I tried to run the notebook associated with branch 20200515 and having the prefix binder-NN- and they are great 🥇 Also well done on implementing JupyterNotebooksLib/display et al

Todo:

  • Before integrating the branch Slicer/SlicerNotebooks@20200515, we should probably rename the notebook and remove the prefix binder ... indeed they work well when directly running the image like I did.

  • add slicer-notebook/README.md

Few observations (non blocker):

  • To avoid passing -w /work, we should change the workdir to /home/sliceruser/nb .. that would also be consistent with what is done in the Dockerfile from SlicerNotebooks

  • VNC viewing show two applications when multiple notebooks have been started:

image

  • At some point I got an already used connection message ... but I am not able to reproduce it yet. I think it was due to the fact I first open 01_Data_Loading_and_Visualization.ipynb

  • Download progress was not reported (e.g with SampleData.SampleDataLogic().downloadCTChest())

@lassoan
Copy link
Contributor

lassoan commented May 16, 2020

Before integrating the branch Slicer/SlicerNotebooks@20200515, we should probably rename the notebook and remove the prefix binder ... indeed they work well when directly running the image like I did.

Notebooks are renamed. We can update the docker image name after the official image is pushed.

add slicer-notebook/README.md

I have updated the top-level README.md (there was not readme file in the slicer-base folder either but it was documented in the top-level readme).

To avoid passing -w /work, we should change the workdir to /home/sliceruser/nb .. that would also be consistent with what is done in the Dockerfile from SlicerNotebooks

I'm not sure what you mean, please fix this.

VNC viewing show two applications when multiple notebooks have been started:

Documented the limitation in JupyterNotebooksLib.AppWindowmethod.

At some point I got an already used connection message ... but I am not able to reproduce it yet. I think it was due to the fact I first open 01_Data_Loading_and_Visualization.ipynb

Added an issue to track this: Slicer/SlicerJupyter#44. Happens rearely enough so that it is not annoying.

Download progress was not reported (e.g with SampleData.SampleDataLogic().downloadCTChest())

Progress reporting is implemented in JupyterNotebooksLib.downloadFromURL.

There are a few remaining tasks in the first post (automatic update, reduce image size, etc.). @jcfr if you can resolve those then it's great, if not then you can create bug reports for them.

@lassoan
Copy link
Contributor

lassoan commented May 25, 2020

I'll merge this and create issues for the items that we have not addressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants