You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1.[Namespacing static files and REST API urls.](#add-namespacing-to-static-endpoints-and-rest-api-urls)
36
+
1.[Namespacing static files and REST API urls.](#add-namespacing-to-static-endpoints-and-rest-api-urls)
38
37
- Each extension serves static files at the `/static/<extension>` url.
39
38
- New `ExtensionHandlerApp` class
40
39
1.[Configuration System](#configuration-system)
@@ -45,7 +44,7 @@ Decouple the backend server (and its configuration) from the classic notebook fr
45
44
### Separate `jupyter_server` repository
46
45
47
46
The first thing to do is fork `notebook`. A new `jupyter_server` repo will keep the server specific logic and remove:
48
-
1. the notebook frontend code,
47
+
1. the notebook frontend code,
49
48
2. deprecated notebook server APIs, and
50
49
3. tornado handlers to the classic notebook interface. These pieces will stay in the `notebook` repository.
51
50
@@ -74,11 +73,11 @@ Preliminary work resides in [jupyter_server](https://github.com/jupyter/jupyter_
74
73
75
74
The server-notebook split is an opportunity to clearly define Jupyter's core services. The old notebook server was comprised of many services, and it could be extended by separate "server extensions". However, it isn't clear what should be a core service versus a server extension. Some extensions were "grand-fathered" in as core services to make the notebook application more full-featured (e.g. nbconvert, terminals, contents, ...). Now that we are separating the server from the classic notebook, we need to reevaluate what services are core to the Jupyter Server.
76
75
77
-
Jupyter server aims to be a core building block for other applications (like nteract, lab, dashboards, standalone widgets, etc.). To achieve this, we need to define the simplest "unit" that defines a Jupyter Server: `kernels`, `kernelspec`, and `sessions`. Other services become extensions to the core server (using the `load_jupyter_server_extension` mechanism defined below).
76
+
Jupyter server aims to be a core building block for other applications (like nteract, lab, dashboards, standalone widgets, etc.). To achieve this, we need to define the simplest "unit" that defines a Jupyter Server: `kernels`, `kernelspec`, and `sessions`. Other services become extensions to the core server (using the `load_jupyter_server_extension` mechanism defined below).
78
77
79
78
### Extensions as Applications
80
79
81
-
A new `ExtensionApp` class will be available in `jupyter_server.extensions.extensionapp`. It enables developers to make server extensions behave like standalone Jupyter applications. Jupyterlab is an example of this kind of server extension. It can be configured, initialized, and launched from the command line. When Lab is launched, it first initializes and configures a jupyter (notebook) server, then loads the configured jupyterlab extension and redirects the use to the Lab landing page.
80
+
A new `ExtensionApp` class will be available in `jupyter_server.extensions.extensionapp`. It enables developers to make server extensions behave like standalone Jupyter applications. Jupyterlab is an example of this kind of server extension. It can be configured, initialized, and launched from the command line. When Lab is launched, it first initializes and configures a jupyter (notebook) server, then loads the configured jupyterlab extension and redirects the use to the Lab landing page.
82
81
83
82
`ExtensionApp` handles the boilerplate code to make Jupyter applications that configure and launch server extensions directly. It inherits `jupyter_core.JupyterApp` and exposes a command line entry point: `jupyter <extension-name>`. When an extension is launched, it first configures and starts a jupyter_server (`ServerApp`); then, it loads the configured extension and redirects users to the extension's landing page. Extension developers simply inherit the `ExtensionApp` and add the extension's `load_jupyter_server_extension` as a `staticmethod`.
84
83
@@ -93,7 +92,7 @@ class MyExtension(ExtensionApp):
`ExtensionApp`s can be configured by `jupyter_<extension-name>_config.py|json` as well. When the server extension is loaded by a server or launched from the command line, it searches the list of `jupyter --paths` for configured traits in these files.
95
+
`ExtensionApp`s can be configured by `jupyter_<extension-name>_config.py|json` as well. When the server extension is loaded by a server or launched from the command line, it searches the list of `jupyter --paths` for configured traits in these files.
97
96
98
97
Initial experimental work resides in [`jupyter_server_extension`](https://github.com/Zsailer/jupyter_server_extension).
Users can also launch the notebook application using the (usual)`jupyter notebook` command line interface.
107
+
Users can also launch the notebook application using the (usual)`jupyter notebook` command line interface.
109
108
110
109
### New server extensions mechanism.
111
110
112
111
The new extension mechanism in the *jupyter server* will differ from notebook's server extensions.
113
112
114
-
* The `--sys-prefix` installation would become the default. (Users are confused when enabling an extension requires more permissions than the installation of the package). Installation in system-wide directories would be done with the `--system` option.
113
+
* The `--sys-prefix` installation would become the default. (Users are confused when enabling an extension requires more permissions than the installation of the package). Installation in system-wide directories would be done with the `--system` option.
115
114
* Installing an extension will include the addition of a 'manifest' file into a conf.d directory (under one of the Jupyter configuration directories, `user / sys-prefix / system`). The placement of such an extension manifest provided by a Python package can be done with `jupyter server extension install --py packagename [--user / --system / --sys-prefix]`. Packages (conda or wheels) carrying server extensions could place such manifests in the sys-prefix path by default effectively installing them. Development installations would also require the call to the installation command.
116
115
117
116
* Enabling an extension is separate from the installation. Multiple scenarios are possible:
118
117
- enabling an extension at the same level (user / sys-prefix / system) as where it was installed, or at a higher level (user for sys-prefix and system, or sys-prefix for system).
119
118
- forcibly disabling an extension that was enabled at a lower level of precedence.
120
119
- forcibly enabling an extension that was disabled at a lower level of precedence.
121
120
This would be done via two `conf.d` configuration directories managing a list of disabled extensions and list of enabled extensions in the form of empty files having the name of the corresponding extension. If an extension is both disabled and enabled at the same level of precedence, disabling has precedence. Packages (conda or wheels) could place such a enabler file in the sys-prefix path by default. The `jupyter server extension enable` command would be required for development installations.
122
-
121
+
123
122
(Possibly) when an extension is enabled at a given precedence level, it may only look for the version of the extension installed at the same or lower precedence level. For example, if an extension `foobar` is installed and enabled system wide, but a user installs a version with `--user`, this version will only be picked up if the user also enables it with `--user`.
124
123
125
124
### Add namespacing to `static` endpoints and REST API urls.
@@ -136,32 +135,32 @@ Preliminary experimental work resides in the [`jupyter_server_extension`](https:
136
135
137
136
Splitting the server-specific pieces from the classic notebook affects Jupyter's configuration system. This is a non-trivial problem. Changing Jupyter's configuration system affects everyone. We need to consider how to make this transition as painless as possible. At the end of this section, we list some steps that make reduce the friction.
138
137
139
-
Here is a list of things the changes on the configuration system:
138
+
Here is a list of things the changes on the configuration system:
140
139
* Move server-specific configuration from `jupyter_notebook_config.py|json` into `jupyter_server_config.py|json`.
141
140
* Notebook configuration will stay in `jupyter_notebook_config.py|json`.
142
141
* Server extensions configurations move from `jupyter_notebok_config.d` to `jupyter_server_config.d`.
143
142
* The tornado server and webapp configurable applications move to `jupyter_server`. They become `ServerApplication` and `ServerWebApp`
144
143
* The `NotebookApp` becomes a server extension. It would only load notebook specific configuration/traitlets, from `jupyter_notebook_config.py|json`.
145
-
* Server extensions are found using the `jpserver_extensions` trait instead of the `nbserver_extensions` trait in the `ServerApp`.
144
+
* Server extensions are found using the `jpserver_extensions` trait instead of the `nbserver_extensions` trait in the `ServerApp`.
146
145
* Extension configuration files in `jupyter_server_config.d` must be enabled using the `jpserver_extensions` trait. They are enabled by JSON config files in `jupyter_server_config.d`.
147
146
* Extensions can create their own configuration files in `{sys-prefix}/etc/jupyter/` or `~/.jupyter`, i.e. `jupyter_<my-extension>_config.py|json`.
148
147
* General `jupyter_config.py|json` files must update to set server-specific configuration using the `ServerApp` and notebook specific configuration using `NotebookApp`.
149
148
150
149
Some traits will stay in `jupyter_notebook_config.py|json`. Here is a list of those traits (everything else moves to server config files):
151
-
* extra_nbextensions_path
152
-
* enable_mathjax
153
-
* max_body_size
154
-
* max_buffer_size
155
-
* notebook_dir
156
-
* mathjax_url
157
-
* get_secure_cookie_kwargs
158
-
* mathjax_config
150
+
* extra_nbextensions_path
151
+
* enable_mathjax
152
+
* max_body_size
153
+
* max_buffer_size
154
+
* notebook_dir
155
+
* mathjax_url
156
+
* get_secure_cookie_kwargs
157
+
* mathjax_config
159
158
* ignore_minified_js
160
159
161
160
Here are some steps we can take to reduce the friction for transitioning:
162
161
***Copy (not move)**`jupyter_notebook_config.py|json` to `jupyter_server_config.py|json`
163
162
***Copy (not move)**`jupyter_notebook_config.d/` to `jupyter_server_config.d`.
164
-
*`NotebookApp` becomes `ServerApp` in all copied files.
163
+
*`NotebookApp` becomes `ServerApp` in all copied files.
165
164
* Leftover server traits in `jupyter_notebook_config.py|json` get ignored when the notebook extension is initialized. Server traits are only read from `jupyter_server_config.py|json`.
166
165
* Document like crazy!
167
166
@@ -173,17 +172,18 @@ To make migration easier on users, a `migrate` application will be available to
173
172
174
173
### How this effects other projects
175
174
176
-
[**Classic notebook**]()
175
+
**Classic notebook**
177
176
In short, the classic notebook will become a server extension application. The rest of this proposal describes the details behind what will change in the notebook repo.
178
-
[`JupyterServerExtensionApp`]().
179
177
180
-
[**Jupyter Lab**]()
178
+
`JupyterServerExtensionApp`
179
+
180
+
**Jupyter Lab**
181
181
Jupyter lab will also become a server extension application. The new classes described above should simplify the way JupyterLab interfaces with the server.
182
182
183
-
[**Kernel Gateway**]()
184
-
Kernel Gateway can use the new Jupyter Server to server kernels as a service. The new Jupyter server will remove the unwanted services that Kernel Gateway currently removes by using a custom server application. KG will also be able to swap out the kernels and kernelspec manager in the Jupyter Server with its custom classes.
183
+
**Kernel Gateway**
184
+
Kernel Gateway can use the new Jupyter Server to server kernels as a service. The new Jupyter server will remove the unwanted services that Kernel Gateway currently removes by using a custom server application. KG will also be able to swap out the kernels and kernelspec manager in the Jupyter Server with its custom classes.
185
185
186
-
[**Kernel Nanny**]()
186
+
**Kernel Nanny**
187
187
188
188
## Pros and Cons
189
189
@@ -198,7 +198,7 @@ Kernel Gateway can use the new Jupyter Server to server kernels as a service. Th
198
198
199
199
* Break the classic notebook in a backwards incompatible way.
200
200
* Affects many projects. The transition may be painful?
201
-
* Adding a dependency injection system adds new complexity.
201
+
* Adding a dependency injection system adds new complexity.
Copy file name to clipboardExpand all lines: 44-xeus-incorporation/xeus-incorporation.md
+10-2Lines changed: 10 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,18 @@
1
-
# Xeus Incorporation Proposal
1
+
---
2
+
title: Xeus Incorporation
3
+
authors: SylvainCorlay
4
+
issue-number: XX
5
+
pr-number: 44
6
+
date-started: "2019-11-30"
7
+
---
8
+
9
+
# Xeus Incorporation
2
10
3
11
## Problem
4
12
5
13
The [Xeus](https://github.com/QuantStack/xeus/) project is a C++ implementation of the [Jupyter kernel protocol](https://jupyter-client.readthedocs.io/en/stable/messaging.html). Xeus is not a kernel, but a library meant to facilitate the authoring of kernels.
6
14
7
-
Several Jupyter kernels have been created with Xeus:
15
+
Several Jupyter kernels have been created with Xeus:
8
16
9
17
-[xeus-cling](https://github.com/QuantStack/xeus-cling), a kernel for the C++ programming language, based on the Cling C++ interpreter. The [cling](https://github.com/root-project/cling) project comes from CERN and is at the foundation of the [ROOT](https://github.com/root-project/root.git) project.
10
18
-[xeus-python](https://github.com/QuantStack/xeus-python), a kernel for the Python programming language, embedding the Python interpreter.
0 commit comments