JupyterHub: Running the Cylc UI alongside other applications

I thought I’d have a quick play to see if I could get this working.

I created a clean conda environment and then ran:

conda install -y -c conda-forge "traitlets<5" jupyterhub jupyterlab
pip install wrapspawner

(I had to use “traitlets<5” due to https://github.com/jupyterhub/wrapspawner/issues/41)

I then ran jupyterhub with the following configuration:

c.JupyterHub.spawner_class = 'wrapspawner.ProfilesSpawner'
c.ProfilesSpawner.profiles = [
       ( "JupyterLab", 'jupyterlab', 'jupyterhub.spawner.LocalProcessSpawner', {} ),
       ( "Cylc UI", 'cylc', 'jupyterhub.spawner.LocalProcessSpawner', {'cmd': ['cylc', 'uiserver'], 'environment': {'CYLC_VERSION': '8.0b1'} }),
 ]

(note: I have the cylc wrapper installed so that the cylc command automatically activates the correct environment)

I was then able to choose whether to spawn JupyterLab or the Cylc UI.
As far as I can tell it seems to work OK (although I’ve only done a very brief test).
I don’t think it would work if you want to be able to authorise users to access other users UI servers (which we hope to support soon) but otherwise it may be fine?
(I only tried this running jupyterhub under my own account so there may be additional complications running this under a privileged hub.)

1 Like

I’m having trouble connecting this information with the documentation at nersc : Jupyter - NERSC Documentation Do I want to load a custom kernel as documented on that page with the cylc1 conda environment?

In this case you need to be able to launch cylc uiserver as the application rather than jupyterlab. That’s not something you are going to be able to do as a user - it would need to be configured by the Jupyterhub administrators. The NERSC documentation describes having to choose the notebook server when you login. I expect that is done via wrapspawner. The Cylc UI would have to become another option at this level.

Thank you David - I’ll talk to nersc staff and see if they are willing to try it.

Just to add that we’re still learning about what’s possible - there may well be better alternatives available in the future.