-
Notifications
You must be signed in to change notification settings - Fork 18
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
Jupyter server #230
Jupyter server #230
Changes from all commits
e017edc
2dffb0d
449635b
e0631d0
a2bcfe8
7fa2f97
b2fb384
d3bfa88
da35266
fb88a33
e9f3ac9
49b096a
a521675
b73c6c3
5166b0b
eb30dc0
75160b2
e19717a
c1916f7
edf3fa1
1ec12e5
cd5e9c4
aa6a095
3b0b51b
8b0c544
72e05c5
5da6044
4c63763
acc20b1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,21 @@ | ||
[![Anaconda-Server Badge](https://anaconda.org/conda-forge/cylc-uiserver/badges/version.svg)](https://anaconda.org/conda-forge/cylc-uiserver) | ||
[![Anaconda-Server Badge](https://anaconda.org/conda-forge/cylc-uiserver/badges/downloads.svg)](https://anaconda.org/conda-forge/cylc-uiserver) | ||
[![PyPI](https://img.shields.io/pypi/v/cylc-uiserver.svg?color=yellow)](https://pypi.org/project/cylc-uiserver/) | ||
[![forum](https://img.shields.io/discourse/https/cylc.discourse.group/posts.svg)](https://cylc.discourse.group/) | ||
[![Test](https://github.com/cylc/cylc-uiserver/actions/workflows/test.yml/badge.svg?branch=master&event=push)](https://github.com/cylc/cylc-uiserver/actions/workflows/test.yml) | ||
[![codecov](https://codecov.io/gh/cylc/cylc-uiserver/branch/master/graph/badge.svg)](https://codecov.io/gh/cylc/cylc-uiserver) | ||
|
||
|
||
# Cylc UI Server | ||
|
||
This project contains the Cylc UI Server. A JupyterHub-compatible application, | ||
This project contains the Cylc UI Server which provides the Cylc GUI | ||
used to serve the Cylc UI, and to communicate with running Cylc Schedulers. | ||
|
||
[Cylc Website](https://cylc.org/) | | ||
[Contributing](CONTRIBUTING.md) | | ||
[Developing](DEVELOPING.md) | ||
|
||
## Contents | ||
[Developing](#Developing) | | ||
[Forum](https://cylc.discourse.group/) | ||
|
||
- [Installation](#installation) | ||
- [Introduction](#introduction) | ||
- [Copyright](#copyright-and-terms-of-use) | ||
|
||
## Introduction | ||
|
||
|
@@ -25,24 +24,37 @@ interface. | |
|
||
This repository provides the following components of the Cylc system. | ||
|
||
* The UI | ||
* **The UI** | ||
|
||
This is the Cylc web app that provides control and monitoring functionalities | ||
for Cylc workflows. | ||
|
||
* The UI Server | ||
> The UI is developed in a separate repository https://github.com/cylc/cylc-ui | ||
|
||
* **The UI Server** | ||
|
||
This is a web server which serves the Cylc web UI. It connects to running | ||
workflows and workflow databases to provide the information the UI displays. | ||
It is a [Jupyter Server](https://github.com/jupyter-server/jupyter_server). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A Jupyter Server application, or a Jupyter web Application? I'm reading their docs, from what I understood, Jupyter Server is the utility code for creating applications or extensions. Applications being complete web applications that use the Jupyter Server, and Extensions only extend the REST API. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Huh, so looks like everything is an extension, but there's a special There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So there's some similar but different terminology here which makes things confusing. The Cylc UI Server (as of this PR) is a "Jupyter Server extension applicaiton".
Extension applications can:
Jupyter server also offers non-configurable extensions (ones which aren't applications), these are cruder. This page helps show the difference - https://jupyter-server.readthedocs.io/en/latest/developers/extensions.html There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks @oliver-sanders ! |
||
|
||
* The Hub | ||
* **The Hub** | ||
|
||
In multi-user setups this launches UI Servers, provides a proxy for running | ||
server and handles authentication. It is a | ||
[JupyterHub](https://github.com/jupyterhub/jupyterhub) server. | ||
|
||
This launches UI Servers, provides a proxy for running server and handles | ||
authentication. It is a JupyterHub server. | ||
|
||
## Installation | ||
|
||
For production: | ||
[![Anaconda-Server Badge](https://anaconda.org/conda-forge/cylc-uiserver/badges/version.svg)](https://anaconda.org/conda-forge/cylc-uiserver) | ||
[![PyPI](https://img.shields.io/pypi/v/cylc-uiserver.svg?color=yellow)](https://pypi.org/project/cylc-uiserver/) | ||
![Conda-Platforms](https://img.shields.io/conda/pn/conda-forge/cylc-uiserver) | ||
|
||
For more information on the Cylc components and full-stack Cylc installations | ||
see the | ||
[Cylc documentation](https://cylc.github.io/cylc-doc/latest/html/installation.html). | ||
|
||
### For Single-User Setups | ||
|
||
```console | ||
# via conda (preferred) | ||
|
@@ -52,13 +64,56 @@ $ conda install cylc-uiserver | |
$ pip install cylc-uiserver | ||
``` | ||
|
||
## Running | ||
### For Multi-User Setups | ||
|
||
```console | ||
$ cylc hub | ||
# via conda (preferred) | ||
$ conda install cylc-uiserver-hub | ||
|
||
# via pip (consult jupyterhub documentation) | ||
$ pip install cylc-uiserver[hub] | ||
``` | ||
|
||
|
||
## Running | ||
|
||
The Cylc UIServer is a | ||
[Jupyter Server](https://github.com/jupyter-server/jupyter_server) | ||
extension (like [JupyterLab](https://github.com/jupyterlab/jupyterlab)). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, I guess it's an extension then, I thought it was an application ๐ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If splitting hairs it is technically an "extension application"! From the users perspective the difference between an "extension" and an "extension application" is invisible. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Brilliant, thanks @oliver-sanders ! It was more so I knew the correct term in case I needed to report an issue upstream, or talk to someone else about Jupyter Server. But extension application is quite a mouthful, I'll probably just use jupyter server, or jupyter server app, or whichever my ๐ง picks first. Leaving unresolved in case others are interested in this answer too. |
||
|
||
### For Single-User Setups | ||
|
||
Run as a standalone server using a URL token for authentication: | ||
|
||
```bash | ||
# launch the Cylc GUI and open a browser tab | ||
cylc gui | ||
|
||
# alternatively the same app can be opened with the jupyter command | ||
$ jupyter cylc | ||
``` | ||
|
||
The default URL is [http://localhost:8000](http://localhost:8000). | ||
> By default authentication is provided by the URL token, alternatively a | ||
> password can be configured (see Jupyter Server docs). | ||
> | ||
> There is no per-user authorisation so anyone who has the URL token has full | ||
> access to the server. | ||
|
||
### For Multi-User Setups | ||
|
||
Run a central [JupyterHub](https://github.com/jupyterhub/jupyterhub) server | ||
under a user account with the privileges required to spawn `cylc` processes as | ||
other users. | ||
|
||
```bash | ||
# launch the Cylc Hub | ||
# (the default URL is http://localhost:8000) | ||
cylc hub | ||
``` | ||
|
||
> Users then authenticate with the hub which launches and manages their UI | ||
> Server. | ||
|
||
|
||
## Configuring | ||
|
||
|
@@ -70,20 +125,20 @@ The Cylc Hub will load the following files in order: | |
|
||
These are the Cylc defaults which are hardcoded within the repository. | ||
|
||
(`<python-installation>/cylc/uiserver/config_defaults.py`) | ||
(`<python-installation>/cylc/uiserver/jupyter_config.py`) | ||
|
||
2) Site Config | ||
|
||
This file configures the Hub/UIS for all users. The default path can be | ||
changed by the ``CYLC_SITE_CONF_PATH`` environment variable. | ||
|
||
(`/etc/cylc/hub/config.py`) | ||
(`/etc/cylc/hub/jupyter_config.py`) | ||
|
||
3) User Config | ||
|
||
This file | ||
|
||
(`~/.cylc/hub/config.py`) | ||
(`~/.cylc/hub/jupyter_config.py`) | ||
|
||
Alternatively a single config file can be provided on the command line. | ||
|
||
|
@@ -96,30 +151,57 @@ $ cylc hub --config | |
> If specifying a config file on the command line the system config containing | ||
> the hardcoded Cylc default will **not** be loaded. | ||
|
||
> **Note:** | ||
> | ||
> The hub can also be run using the ``jupyterhub`` command, however, you | ||
> must source the configuration files manually on the command line. | ||
|
||
See the Jupyterhub documentation for details on configuration options. | ||
|
||
### UI Server | ||
|
||
The UI Server is (currently) also configured from the same configuration file(s) | ||
as the hub using the | ||
`UIServer` namespace. | ||
The UI Server is also configured from the same configuration file(s) as the hub | ||
using the `UIServer` namespace. | ||
|
||
Currently the UI Server accepts these configurations: | ||
|
||
* `c.UIServer.ui_build_dir` | ||
* `c.UIServer.ui_version` | ||
* `c.UIServer.logging_config` | ||
* `c.UIServer.scan_iterval` | ||
* `c.CylcUIServer.ui_build_dir` | ||
* `c.CylcUIServer.ui_version` | ||
* `c.CylcUIServer.scan_iterval` | ||
|
||
See the `cylc.uiserver.app.UIServer` file for details. | ||
|
||
The Cylc UI Server is a | ||
[Jupyter Server](https://github.com/jupyter-server/jupyter_server) extension. | ||
Jupyter Server can run multiple extensions. To control the extensions that | ||
are run use the `ServerApp.jpserver_extensions` configuration, see the | ||
[Jupyter Server configuration documentation](https://jupyter-server.readthedocs.io/en/latest/other/full-config.html#other-full-config). | ||
|
||
### UI | ||
|
||
The UI can be configured via the "Settings" option in the Dashboard. | ||
|
||
Currently these configurations are stored in the web browser so won't travel | ||
around a network and might not persist. | ||
|
||
See the `cylc.uiserver.main.UIServer` file for details. | ||
|
||
## Developing | ||
|
||
1) Read the [Contributing](CONTRIBUTING.md) page. | ||
[![Contributors](https://img.shields.io/github/contributors/cylc/cylc-uiserver.svg?color=9cf)](https://github.com/cylc/cylc-uiserver/graphs/contributors) | ||
[![Commit activity](https://img.shields.io/github/commit-activity/m/cylc/cylc-uiserver.svg?color=yellowgreen)](https://github.com/cylc/cylc-uiserver/commits/master) | ||
[![Last commit](https://img.shields.io/github/last-commit/cylc/cylc-uiserver.svg?color=ff69b4)](https://github.com/cylc/cylc-uiserver/commits/master) | ||
|
||
Contributions welcome: | ||
|
||
2) Fork and clone this repo. | ||
* Read the [contributing](CONTRIBUTING.md) page. | ||
* Development setup instructions are in the | ||
[developer docs](https://cylc.github.io/cylc-admin/#cylc-8-developer-docs). | ||
* Involved change proposals can be found in the | ||
[admin pages](https://cylc.github.io/cylc-admin/#change-proposals). | ||
* Touch base in the | ||
[developers chat](https://matrix.to/#/#cylc-general:matrix.org). | ||
|
||
3) Install from source into your Python environment: | ||
1) Install from source into your Python environment: | ||
|
||
```console | ||
$ pip install -e .[all] | ||
|
@@ -130,12 +212,14 @@ See the `cylc.uiserver.main.UIServer` file for details. | |
> If you want to run with a development copy of Cylc Flow you must install | ||
> it first else `pip` will download the latest version from PyPi. | ||
|
||
4) For UI development set the following configuration to use your UI build | ||
2) For UI development follow the developer instructions for the | ||
[cylc-ui](https://github.com/cylc/cylc-ui) project, then | ||
set the following configuration so Cylc uses your UI build | ||
(rather than the default bundled UI build): | ||
|
||
```python | ||
# ~/.cylc/hub/config.py | ||
c.UIServer.ui_build_dir = '~/cylc-ui/dist' # path to build | ||
# ~/.cylc/hub/jupyter_config.py | ||
c.CylcUIServer.ui_build_dir = '~/cylc-ui/dist' # path to build | ||
``` | ||
|
||
## Copyright and Terms of Use | ||
|
@@ -148,7 +232,7 @@ either version 3 of the License, or (at your option) any later version. | |
|
||
Cylc is distributed in the hope that it will be useful, but WITHOUT ANY | ||
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A | ||
PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
|
||
You should have received a copy of the GNU General Public License along with | ||
Cylc. If not, see [GNU licenses](http://www.gnu.org/licenses/). | ||
Cylc. If not, see [GNU licenses](http://www.gnu.org/licenses/). |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,18 +12,13 @@ | |
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
"""cylc uis | ||
|
||
Launch a Cylc UI Server. | ||
pytest_plugins = [ | ||
'jupyter_server.pytest_plugin' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This pulls in the |
||
] | ||
|
||
This is an internal command invoked by the Cylc Hub via the configured | ||
Jupyterhub spawner. | ||
""" | ||
|
||
from cylc.uiserver.main import main as uis_main | ||
|
||
INTERNAL = True | ||
|
||
|
||
def main(*_): | ||
uis_main() | ||
def pytest_ignore_collect(path): | ||
# --doctest-modules seems to ignore the value if configured in pyproject | ||
if 'jupyter_config.py' in str(path): | ||
return True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://cylc.org/ currently forwards to https://niwa.co.nz/
I'm guessing this will be fixed by production time but thought I'd flag it now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ping @hjoliver
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, that's changed recently it used to redirect to GH pages, yikes!
Hmmm, I've seen this error before, I think my rebase of the cylc-ui branch might not have been fully successful.