generated from ome/guide-template
/
postBuild
63 lines (43 loc) · 1.86 KB
/
postBuild
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/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://sourceforge.net/projects/tigervnc/files/stable/1.9.0/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.19
OMERO_INSIGHT_URL_BASE=https://github.com/ome/omero-insight/releases/download/v$OMERO_INSIGHT_VERSION
wget 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_ij-$OMERO_INSIGHT_VERSION-all.jar
popd
mkdir Desktop
# Copy the script to the Desktop
cp -R $REPO_DIR/scripts 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