Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration with current JupyterHub #296

Closed
jbaksta opened this issue Jan 4, 2022 · 4 comments
Closed

Integration with current JupyterHub #296

jbaksta opened this issue Jan 4, 2022 · 4 comments

Comments

@jbaksta
Copy link

jbaksta commented Jan 4, 2022

This is more of a generic question I've not found a clear answer for through the documentation or by browsing the issues so far.

My team runs a successful and very integrated JupyterHub installation on our supercomputers and clusters where the submission portal is the same for any resources. Rather than running a secondary hub for a second web application that, I'm curious is there is any advice/information on simply running cylc-uiserver under a current JupyterHub implementation.

We have a customized spawner that I'd like not to reinvent, but rather put an option in our spawner to start Cylc instead of JupyterLab. As there is a simple jupyter-cylc launched as part of things, I'm hoping this is more straight forward than what I'm thinking. My ultimate goal is to have cylc as part of our drop down form and that will automatically start cylc-uiserver at the URL hub.tld/cylc.

Additionally, since many of our Cylc users are also JupyterHub users, I'd want to create a JupyterLab menu item that could be integrated to navigate to the cylc-ui as many of our users simply like accessing the Terminal application as well to create additional workflows.

I've been spinning development instances, but haven't been successful yet on direct integration. I'd really prefer not to run a second hub because I'm being pushed to have a SSO feels like approach.

Just looking for a starting point or to understand whether this is a desired use case from the Cylc developers.

@jedwards4b
Copy link

@jbaksta I asked a similar question in the forum sometime ago ... https://cylc.discourse.group/t/jupyterhub-running-the-cylc-ui-alongside-other-applications/327

@dpmatthews
Copy link
Contributor

The uiserver is now a jupyter server extension (#230). This means JupyterLab and the uiserver can run under a single jupyter server instance so that you can easily switch between JupyterLab and the Cylc UI. We haven't had time to experiment much with this yet and I don't think there is any documentation. However, if you install JupyterLab in the same Conda environment as Cylc and then run the Cylc UI you should find JupyterLab is accessible via /lab.
Hope this helps. If you have any further questions about this I suggest you use https://cylc.discourse.group/.

@dpmatthews
Copy link
Contributor

I've opened #298 to cover further investigation and documentation

@oliver-sanders
Copy link
Member

Hello, apologies, we haven't got around to documenting the UI Server properly yet.

Running Jupyter Lab alongside the Cylc UI Server

As @dpmatthews says the Cylc UI Server is now a Jupyter Server extension which puts it at parity with Jupyter Lab. Jupyter Server can run multiple extensions simultaneously so you can run Jupyter Lab and the Cylc UI Server in the same server instance.

By default Jupyter Server launches all installed server extensions. You can control which extensions are launched using jpserver_extensions which can be set on the CLI or in jupyter configuration files.

Switching between extensions

Jupyter Server extensions are served behind their own URL, Jupyter Lab is /lab, Cylc UI Server is /cylc. The default URL that opens when the application is launched depends on the command you used to spawn it.

You can switch between extensions by changing the URL, I'm not sure whether there is a more elegant solution. Within the Cylc UI Server we can easily add links to other extensions, however, we can't so easily add links within the other extensions to Cylc.

Configuring Jupyter Hub

Cylc provides its own command (cylc hub) for launching Jupyter Hub, this command is a thin wrapper which applies some configurations to launch a more "Cylc flavoured" Jupyter Hub.

The Cylc configurations can be found in this file:

The cylc hub command is completely optional and intended only for setups where Cylc is the only Jupyter Server extension being launched.

If you want to use Jupyter Hub standalone you will need to add the c.Spawner.environment configuration from the above file to your Jupyter Hub config and may need to configure jpserver_extensions to ensure the Cylc extension is loaded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants