Compare commits

...

15 Commits

Author SHA1 Message Date
bra1z dd1c85d920 Update 'apt.txt' 2020-02-11 11:36:57 +00:00
bra1z 416ae3c2d8 Update 'apt.txt' 2020-02-11 10:57:24 +00:00
bra1z 9c197798cc Add 'postBuild' 2020-02-11 10:55:32 +00:00
bra1z 4b60360911 Update 'apt.txt' 2020-02-11 10:53:09 +00:00
bra1z a9cfc5ab3f Update 'apt.txt' 2020-02-11 10:45:10 +00:00
bra1z c7b34e30c2 Update 'README.md' 2020-02-11 09:54:13 +00:00
bra1z bacd1d45ca Update 'README.md' 2020-02-11 09:52:22 +00:00
bra1z 7c69bfc651 Update 'README.md' 2020-02-11 09:50:05 +00:00
bra1z 07a2ec74b9 Update 'README.md' 2020-02-11 09:48:34 +00:00
bra1z dbff85d918 Update 'apt.txt' 2020-02-11 09:47:18 +00:00
YuviPanda b6dee24cff Revert "Add a jupyter server extension to render desktop/"
Removes the server extension, so the HTML for the interface
*is* served by websockify itself. This is a fix for
https://github.com/yuvipanda/jupyter-desktop-server/issues/10
This reverts commit 18d7fb7b2a.
2019-11-19 16:59:38 -08:00
YuviPanda 18d7fb7b2a Add a jupyter server extension to render desktop/
A mess of a commit, should have been several.

- Finish renaming package from jupyter_desktop to
  jupyter_desktop_server
- Revert 360f9b04c5. Looks like
  websockify gets super confused when you put shell in the middle
  of it and the process it is spawning.
- Add a server extension that renders a slightly modified copy
  of vnc_lite.html as /desktop. This will be modified more and more
  as we go forward. This also helps us remove the mapping present
  in the jupyter server proxy entry
2019-11-19 16:36:54 -08:00
YuviPanda bda9a7ec21 Fix README to point to new name
- jupyter-desktop sounds like a desktop installation of
  Jupyter
- This matches the package name
2019-11-19 11:10:16 -08:00
YuviPanda 98b7723943 Explicitly specify version of jupyter-server-proxy needed
We made a release!
2019-11-19 11:07:46 -08:00
YuviPanda 360f9b04c5 Set CWD of desktop environment to CWD of notebook
Otherwise it'll be cwd of webroot, which is confusing as
soon as you open a terminal
2019-11-19 11:06:53 -08:00
6 changed files with 68 additions and 15 deletions

View File

@ -1,6 +1,7 @@
# Jupyter Desktop
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/yuvipanda/jupyter-desktop/master?urlpath=desktop)
# Jupyter Desktop Server with golang
Run XFCE on a JupyterHub.
https://mybinder.org/v2/git/https%3A%2F%2Fgit.disroot.org%2Fbra1z%2Fjupyter-desktop-server-golang.git/master?urlpath=desktop
Run XFCE (or other desktop environments) on a JupyterHub.
This is based on https://github.com/ryanlovett/nbnovnc and a fork of https://github.com/manics/jupyter-omeroanalysis-desktop

15
apt.txt
View File

@ -1,8 +1,19 @@
dbus-x11
firefox
xfce4
xfce4-panel
xfce4-session
xfce4-settings
xorg
xubuntu-icon-theme
gtk2-engines-murrine
ttf-ubuntu-font-family
mesa-utils
libgl1-mesa-dri
gtk2-engines-pixbuf
gtk2-engines-murrine
pinta
dbus-x11
x11-utils
gcc
libgl1-mesa-dev
xorg-dev
xubuntu-icon-theme

View File

@ -3,5 +3,4 @@ channels:
dependencies:
- websockify
- pip:
- https://github.com/jupyterhub/jupyter-server-proxy/archive/0e67e1afd0bab1342443f13bd147a2f8c682e9e0.zip
- .

View File

@ -1,4 +1,5 @@
import os
import shlex
import tempfile
@ -9,6 +10,17 @@ def setup_desktop():
# This is only readable, writeable & searchable by our uid
sockets_dir = tempfile.mkdtemp()
sockets_path = os.path.join(sockets_dir, 'vnc-socket')
vnc_command = ' '.join((shlex.quote(p) for p in [
os.path.join(HERE, 'share/tigervnc/bin/vncserver'),
'-verbose',
'-xstartup', os.path.join(HERE, 'share/xstartup'),
'-geometry', '1680x1050',
'-SecurityTypes', 'None',
'-rfbunixpath', sockets_path,
'-fg',
':1',
]))
return {
'command': [
'websockify', '-v',
@ -17,14 +29,8 @@ def setup_desktop():
'5901',
'--unix-target', sockets_path,
'--',
os.path.join(HERE, 'share/tigervnc/bin/vncserver'),
'-verbose',
'-xstartup', os.path.join(HERE, 'share/xstartup'),
'-geometry', '1680x1050',
'-SecurityTypes', 'None',
'-rfbunixpath', sockets_path,
'-fg',
':1',
'/bin/sh', '-c',
f'cd {os.getcwd()} && {vnc_command}'
],
'port': 5901,
'timeout': 30,

36
postBuild Normal file
View File

@ -0,0 +1,36 @@
#!/bin/bash
set -e
GOVERS=1.13
mkdir -p \
$HOME/.local/go/$GOVERS \
$HOME/go
echo "::: install Go ${GOVERS}..."
curl -O -L https://golang.org/dl/go${GOVERS}.linux-amd64.tar.gz
tar -C $HOME/.local/go/$GOVERS -zxf go${GOVERS}.linux-amd64.tar.gz
/bin/rm go${GOVERS}.linux-amd64.tar.gz
export GOROOT=$HOME/.local/go/$GOVERS/go
export GOPATH=$HOME/go
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
echo "::: installing neugram..."
go get golang.org/x/tools/cmd/goimports
go get neugram.io/ng/...
echo "::: installing neugram... [done]"
## setup environment for Go
cat >> $HOME/.setup-go << EOF
## setup Go
export GOROOT=$GOROOT
export GOPATH=$GOPATH
export PATH=\$GOPATH/bin:\$GOROOT/bin:\$PATH
EOF
cat >> $HOME/.bashrc << EOF
. ~/.setup-go
EOF

View File

@ -10,7 +10,7 @@ setup(
'desktop = jupyter_desktop:setup_desktop',
]
},
install_requires=['jupyter-server-proxy'],
install_requires=['jupyter-server-proxy>=1.2.0'],
include_package_data=True,
zip_safe=False
)