From fdcd053cd378049c6dd5d4ca65fc74d91cc7267b Mon Sep 17 00:00:00 2001 From: YuviPanda Date: Tue, 29 Oct 2019 12:28:15 -0700 Subject: [PATCH] Remove all parts that aren't just XFCE - Move everything to base directory, since this repo is only for jupyter-desktop - Remove packages not needed for base functionality from apt.txt and environment.yml - Remove extra desktop shortcuts --- binder/apt.txt => apt.txt | 8 +- binder/environment.yml | 36 --------- binder/postBuild | 74 ------------------- environment.yml | 6 ++ .../jupyter_desktop.py => jupyter_desktop.py | 0 jupyter_desktop/share/Fiji.desktop | 14 ---- jupyter_desktop/share/OMERO.insight.desktop | 13 ---- napari.ipynb | 66 ----------------- postBuild | 31 ++++++++ jupyter_desktop/setup.py => setup.py | 0 {jupyter_desktop/share => share}/xstartup | 0 binder/start => start | 0 12 files changed, 38 insertions(+), 210 deletions(-) rename binder/apt.txt => apt.txt (51%) delete mode 100644 binder/environment.yml delete mode 100644 binder/postBuild create mode 100644 environment.yml rename jupyter_desktop/jupyter_desktop.py => jupyter_desktop.py (100%) delete mode 100644 jupyter_desktop/share/Fiji.desktop delete mode 100644 jupyter_desktop/share/OMERO.insight.desktop delete mode 100644 napari.ipynb create mode 100644 postBuild rename jupyter_desktop/setup.py => setup.py (100%) rename {jupyter_desktop/share => share}/xstartup (100%) rename binder/start => start (100%) diff --git a/binder/apt.txt b/apt.txt similarity index 51% rename from binder/apt.txt rename to apt.txt index 8c32d83..d133c25 100644 --- a/binder/apt.txt +++ b/apt.txt @@ -1,14 +1,8 @@ -curl dbus-x11 firefox -less -net-tools -openjdk-8-jre -unzip -vim xfce4 xfce4-panel xfce4-session xfce4-settings xorg -xubuntu-icon-theme +xubuntu-icon-theme diff --git a/binder/environment.yml b/binder/environment.yml deleted file mode 100644 index f0a4709..0000000 --- a/binder/environment.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: napari -channels: - - conda-forge - - manics -dependencies: - - python=3.6 - - pip - - websockify=0.9.0 - - zeroc-ice-python=3.6.5 - # https://github.com/napari/napari/blob/v0.2.2/requirements/default.txt - - dask - - zarr - - fsspec - - imageio - - ipykernel - - numpy - - qtpy - - qtconsole - - scipy - - scikit-image - - vispy - - ipython - - backcall - - pyopengl - - pyside2 - - wrapt - - numpydoc - - pip: - # Recent jupyter-server-proxy to load vnc_lite.html instead of / - # https://github.com/jupyterhub/jupyter-server-proxy/pull/151 - - https://github.com/jupyterhub/jupyter-server-proxy/archive/0e67e1afd0bab1342443f13bd147a2f8c682e9e0.zip - - https://github.com/ome/omero-py/archive/v5.6.dev1.zip - # The conda pyside2 package doesn't appear in pip list so napari tries to reinstall it - # https://github.com/conda-forge/pyside-feedstock/issues/35 - # napari==0.2.2 - # Manually install in postBuild instead with --no-dependencies diff --git a/binder/postBuild b/binder/postBuild deleted file mode 100644 index 3016635..0000000 --- a/binder/postBuild +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/bash -set -eux - -env - -VNC_APPLICATION_DIR=$CONDA_DIR/vnc -mkdir $VNC_APPLICATION_DIR -pushd $VNC_APPLICATION_DIR - -# Novnc: just want web files -curl -sSfL https://github.com/novnc/noVNC/archive/v1.1.0.tar.gz | tar -zxf - - -# Patch novnc to use correct path to websockify (defaults to /) -# Note if you use vnc.html you will need to patch ui.js to use the correct path -# and also to override localstorage which may store an incorrect path from a -# different session -# Also resize server instead of scaling client -sed -i.bak \ - -e "s%\('path', 'websockify'\)%'path', window.location.pathname.replace(/[^/]*$/, '').substring(1) + 'websockify'); console.log('websockify path:' + path%" \ - -re "s%rfb.scaleViewport = .+%rfb.resizeSession = readQueryVariable('resize', true);%" \ - noVNC-1.1.0/vnc_lite.html - -# Install tigervnc -curl -sSfL 'https://bintray.com/tigervnc/stable/download_file?file_path=tigervnc-1.9.0.x86_64.tar.gz' | tar -zxf - --strip=2 - - -cp $REPO_DIR/jupyter_desktop/share/xstartup . -chmod +x xstartup - - -# Desktop applications -# Fiji and OMERO insight - -#OMERO_INSIGHT_VERSION=5.5.6 -#OMERO_INSIGHT_URL_BASE=https://github.com/ome/omero-insight/releases/download/v$OMERO_INSIGHT_VERSION/ -OMERO_INSIGHT_VERSION=5.5.7-SNAPSHOT -OMERO_INSIGHT_URL_BASE=https://users.openmicroscopy.org.uk/~spli/insight - -wget -q https://downloads.imagej.net/fiji/latest/fiji-nojre.zip -unzip -q fiji-nojre.zip -rm fiji-nojre.zip - -pushd Fiji.app/plugins -wget -q $OMERO_INSIGHT_URL_BASE/OMERO.imagej-$OMERO_INSIGHT_VERSION.zip -unzip -q OMERO.imagej-$OMERO_INSIGHT_VERSION.zip -rm OMERO.imagej-$OMERO_INSIGHT_VERSION.zip -popd - -wget -q $OMERO_INSIGHT_URL_BASE/OMERO.insight-$OMERO_INSIGHT_VERSION.zip -unzip -q OMERO.insight-$OMERO_INSIGHT_VERSION.zip -rm OMERO.insight-$OMERO_INSIGHT_VERSION.zip -pushd OMERO.insight-$OMERO_INSIGHT_VERSION && \ -wget -q https://www.openmicroscopy.org/img/logos/omero-logomark.svg -popd - -ln -s OMERO.insight-$OMERO_INSIGHT_VERSION OMERO.insight -mkdir Desktop -cp $REPO_DIR/jupyter_desktop/share/*.desktop Desktop -chmod +x Desktop/*.desktop - -popd - - -pushd $REPO_DIR/jupyter_desktop - -# Configure jupyter-server-proxy VNC -# https://jupyter-server-proxy.readthedocs.io/en/latest/server-process.html#specifying-config-from-python-packages -pip install . -python -c "from pkg_resources import iter_entry_points; print(list(iter_entry_points(group='jupyter_serverproxy_servers')))" - -popd - -# Napari (dependencies already installed using conda) -pip install --no-dependencies napari==0.2.2 diff --git a/environment.yml b/environment.yml new file mode 100644 index 0000000..b2c7016 --- /dev/null +++ b/environment.yml @@ -0,0 +1,6 @@ +channels: + - manics +dependencies: + - websockify + - pip: + - https://github.com/jupyterhub/jupyter-server-proxy/archive/0e67e1afd0bab1342443f13bd147a2f8c682e9e0.zip \ No newline at end of file diff --git a/jupyter_desktop/jupyter_desktop.py b/jupyter_desktop.py similarity index 100% rename from jupyter_desktop/jupyter_desktop.py rename to jupyter_desktop.py diff --git a/jupyter_desktop/share/Fiji.desktop b/jupyter_desktop/share/Fiji.desktop deleted file mode 100644 index 0d9beda..0000000 --- a/jupyter_desktop/share/Fiji.desktop +++ /dev/null @@ -1,14 +0,0 @@ -[Desktop Entry] -Version=1.0 -Name=Fiji Is Just ImageJ -GenericName=Fiji Is Just ImageJ -X-GNOME-FullName=Fiji Is Just ImageJ -Comment=Scientific Image Analysis -Type=Application -Categories=Education;Science;ImageProcessing; -Exec=/srv/conda/vnc/Fiji.app/ImageJ-linux64 -TryExec=/srv/conda/vnc/Fiji.app/ImageJ-linux64 -Terminal=false -StartupNotify=true -Icon=/srv/conda/vnc/Fiji.app/images/icon.png -StartupWMClass=fiji-Main diff --git a/jupyter_desktop/share/OMERO.insight.desktop b/jupyter_desktop/share/OMERO.insight.desktop deleted file mode 100644 index e7d66f1..0000000 --- a/jupyter_desktop/share/OMERO.insight.desktop +++ /dev/null @@ -1,13 +0,0 @@ -[Desktop Entry] -Version=1.0 -Name=OMERO.insight -GenericName=OMERO.insight -X-GNOME-FullName=OMERO.insight -Comment=OMERO desktop client -Type=Application -Categories=Education;Science;ImageProcessing; -Exec=/srv/conda/vnc/OMERO.insight/bin/omero-insight -TryExec=/srv/conda/vnc/OMERO.insight/bin/omero-insight -Terminal=false -StartupNotify=true -Icon=/srv/conda/vnc/OMERO.insight/omero-logomark.svg diff --git a/napari.ipynb b/napari.ipynb deleted file mode 100644 index 01cf832..0000000 --- a/napari.ipynb +++ /dev/null @@ -1,66 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Napari\n", - "\n", - "\n", - "## Setup: start the [desktop](../desktop)\n", - "The link should open in a different window. If you see an error message try refreshing the window.\n", - "\n", - "Then run the first cell and wait for QT to be initialised before running the following cells. `Run all cells` will not work.\n", - "\n", - "If you are running this locally you should see some log messages. If you are running this on mybinder wait a few seconds before running the Napari cell. Note adding `time.sleep(5)` to the cell does not work!" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Use the novnc Desktop in the other window\n", - "import os\n", - "os.environ['DISPLAY'] = ':1.0'\n", - "# instantiate Qt GUI\n", - "%gui qt5" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "import napari\n", - "from skimage.data import astronaut\n", - "\n", - "# create the viewer on the Desktop and display the image\n", - "viewer = napari.view_image(astronaut(), rgb=True)" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.7.3" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} diff --git a/postBuild b/postBuild new file mode 100644 index 0000000..d99725a --- /dev/null +++ b/postBuild @@ -0,0 +1,31 @@ +#!/bin/bash +set -eux + +env + +VNC_APPLICATION_DIR=$CONDA_DIR/vnc +mkdir $VNC_APPLICATION_DIR +pushd $VNC_APPLICATION_DIR + +# Novnc: just want web files +curl -sSfL https://github.com/novnc/noVNC/archive/v1.1.0.tar.gz | tar -zxf - + + +# Install tigervnc +curl -sSfL 'https://bintray.com/tigervnc/stable/download_file?file_path=tigervnc-1.9.0.x86_64.tar.gz' | tar -zxf - --strip=2 + +# Patch novnc to use correct path to websockify (defaults to /) +# Note if you use vnc.html you will need to patch ui.js to use the correct path +# and also to override localstorage which may store an incorrect path from a +# different session +# Also resize server instead of scaling client +sed -i.bak \ + -e "s%\('path', 'websockify'\)%'path', window.location.pathname.replace(/[^/]*$/, '').substring(1) + 'websockify'); console.log('websockify path:' + path%" \ + -re "s%rfb.scaleViewport = .+%rfb.resizeSession = readQueryVariable('resize', true);%" \ + noVNC-1.1.0/vnc_lite.html + + +cp $REPO_DIR/share/xstartup . +chmod +x xstartup + +pip install $REPO_DIR \ No newline at end of file diff --git a/jupyter_desktop/setup.py b/setup.py similarity index 100% rename from jupyter_desktop/setup.py rename to setup.py diff --git a/jupyter_desktop/share/xstartup b/share/xstartup similarity index 100% rename from jupyter_desktop/share/xstartup rename to share/xstartup diff --git a/binder/start b/start similarity index 100% rename from binder/start rename to start