Unable to get jupyter server proxy working on theia

Hey all, total newbie here.
I’m trying to get jupyter notebook working on Theia. I have installed jsp using the command “pip install jupyter-server-proxy” and proceeded to follow the instructions on https://jupyter-server-proxy.readthedocs.io/en/latest/convenience/packages/theia.html

Can anyone let me know what I’m doing wrong here?

I’m not sure what the solution is, however I do have a (very very) old binder repo that install theia: https://github.com/betatim/theia-binder maybe that gives you some new ideas for what to do.

Hi @nickhan123,

besides the configuration you linked to, you’ll also need to configure the server proxy in your ~/.jupyter/jupyter_notebook_config.py, e.g.

import os
c.ServerProxy.servers = {
  'theia': {
    'command': [
      '/path/to/bin/theia',
        'start', 
        os.environ.get("HOME"),
        '--hostname=127.0.0.1',
        '--port={port}'
    ],
    'timeout': 30,
    'launcher_entry': {
      'title': 'Theia'
    }
  }
}

Hope this helps.

1 Like

It’s also possible to package that as a “pip” python package for the configuration. I thought that https://github.com/jupyterhub/jupyter-server-proxy/tree/master/contrib/theia had this included.

For example, in https://github.com/dirkcgrunwald/jupyter_codeserver_proxy- I set up a proxy for VScode. The installation then looks like the code below. The challenge is that you need to install the jupyterlab-server-proxy to get any of this to work and the version that’s in pip or conda is too old for jupyterlab-1.0 and above, if I recall.

RUN     (cd /tmp && \
        git clone https://github.com/jupyterhub/jupyter-server-proxy && \
        cd /tmp/jupyter-server-proxy/jupyterlab-server-proxy && \
        npm install && npm run build && jupyter labextension link . && \
        rm -rf /tmp/jupyter-server-proxy )

RUN     $CONDA_DIR/bin/pip  install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple jupyter-codeserver-proxy==1.0b3

RUN     cd /opt && \
        mkdir /opt/code-server && \
        cd /opt/code-server && \
        wget -qO- https://github.com/cdr/code-server/releases/download/2.1698/code-server2.1698-vsc1.41.1-linux-x86_64.tar.gz | tar zxvf - --strip-components=1
ENV     PATH=/opt/code-server:$PATH

The resulting proxy display looks like the following on our setup. I could never get the VScode tile to get to where e.g the Terminal is (which would make more sense) but I didn’t invest much time in trying.
vscode