Hi there! I am trying to set up a cylc hub. I managed to get to the point of users being able to login but the cylc UI does not show, only a page that says “A Jupyter Server is running”. I am at a bit of a loss. There are no errors in the logs.
I am running version 5.2.1 of jupyterhub with “out of the box” configuration, using sudospawner.
Some pointers would be highly appreciated.
Cheers!
Gaby
Hi Gaby,
Are you starting it as cylc hub
?
Have you read the Jupyter docs on how to do that?
Run JupyterHub without root privileges using sudo — JupyterHub documentation
Notably:
Note: Setting up
sudo
permissions involves many pieces of system configuration. It is quite easy to get wrong and very difficult to debug. Only do this if you are very sure you must.
…
Since JupyterHub needs to spawn processes as other users, the simplest way is to run it as root, spawning user servers with setuid. But this isn’t especially safe, because you have a process running on the public web as root.
…
A more prudent way to run the server while preserving functionality is to create a dedicated user withsudo
access restricted to launching and monitoring single-user servers.
It might be worth back-tracking to try running the hub as root on (e.g.) your own Linux box, to see how it should work.
If I do that, “out of the box” the server starts, and I can’t log in to it, but it prints a warning for the default PAM authenticator,
No allow config found, it’s possible that nobody can login to your Hub!
You can setc.Authenticator.allow_all = True
to allow any user who can login to access the Hub,
or e.g.allowed_users
to a set of users who should have access.
If then add the c.Authenticator.allow_all = True
to $HOME/.cylc/uiserver/jupyter_config.py
, I can log in with my system username and password, and everything works like a charm.
On logging in to the hub, it takes me straight to my Cylc UI, but I can get back to the Hub via the Cylc UI dashboard. The Hub Home page looks like this (clicking on My Server take me back to my Cylc UI):
The Hub Admin page looks like this:
I take it that page does not look like my screenshots above?
I was able to run as root without any issues. But this is not an acceptable solution on the server that will eventually host cylc_hub (mind you, using sudospawner is not a given either )
What I am getting when I login is a “plain” page:
Once I am there I am “stuck”, no way to log out even.
I am thinking that I am now missing some settings on the user side.
It’s not clear to me exactly what settings are required at the site and user level as described in UI Server Configuration — Cylc 8.3.4 documentation. I have a feeling that it is not working because (some of) those settings are missing.
As the test user, I have installed cylc-flow and cylc-uiserver.
Hi,
You appear to be running a vanilla Juypyter setup (this provides the hub and server model), however, you have not configured any apps for Jupyter to run. The hub and server are working, but with no apps to run, it will just show you the “A Jupyter Server is running” message.
We provide a Jupyter config for running the Cylc app which is activated automatically when you start the hub using the cylc hub
command (this launches Jupyter Hub with the Cylc configuration). This is the recommended way to run the Cylc UI Server.
Alternatively, you can configure a vanilla Jupyter setup to run the Cylc app. This is how sites can add Cylc to pre-existing Jupyter Hub deployments. The config that the cylc hub
command is defined in the file linked below, copy the relevant bits to your own Jupyter config and restart the service:
Aha, it may be a path issue maybe? Because the file is definitively there, in the python environment installation folder /home/cylc/.conda/envs/cylc/lib/python3.9/site-packages/cylc/uiserver
I added two lines to it:
c.Authenticator.delete_invalid_users = True
c.JupyterHub.spawner_class = ‘sudospawner.SudoSpawner’ (replacement)
Mind you, it must see that file, because it knows to use sudospawner
If you’re using sudospawner, then I think you either need to:
-
Modify the command sudospawner runs (what we do)
Get the sudospawne to run the
cylc hubapp
command (i.e. launch a Cylc server rather than a vanilla Jupyter server with no apps installed).We use:
#!/bin/bash -l exec ${0%/*}/path/to/env cylc hubapp
GitHub - jupyterhub/sudospawner: Spawn JupyterHub single-user servers with sudo
-
Configure jupyter server to use any required Cylc config.
cylc/cylc-uiserver/blob/master/cylc/uiserver/jupyter_config.py
Yes!!! That did it. Thank you soo much Oliver.
Now I have another problem as a user. I can log in, and I see all my workflows, but I cannot play them. The error is:
Command failed: play - [Errno 2] No such file or directory: ‘cylc’
Are you using a wrapper script for Cylc? Installation — Cylc 8.3.4 documentation
Wrapper worked! Thanx a bunch