Skip to content

Commit

Permalink
Replace RetroLab with Notebook (#396)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbrochart authored Apr 9, 2024
1 parent 085705a commit 0c07b8d
Show file tree
Hide file tree
Showing 27 changed files with 126 additions and 116 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
pip install -e jupyverse_api
pip install -e plugins/frontend
pip install -e plugins/jupyterlab
pip install -e plugins/retrolab
pip install -e plugins/notebook
pip install -e plugins/contents
pip install -e plugins/kernels
pip install -e plugins/terminals
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ jobs:
hatch run dev.jupyterlab-noauth:typecheck
hatch run dev.jupyterlab-auth:typecheck
hatch run dev.jupyterlab-auth_fief:typecheck
hatch run dev.retrolab-noauth:typecheck
hatch run dev.retrolab-auth:typecheck
hatch run dev.retrolab-auth_fief:typecheck
hatch run dev.notebook-noauth:typecheck
hatch run dev.notebook-auth:typecheck
hatch run dev.notebook-auth_fief:typecheck
test:
name: Tests
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cd plugins/auth ; rm -rf dist && python setup.py sdist bdist_wheel ; cp di
cd plugins/contents ; rm -rf dist && python setup.py sdist bdist_wheel ; cp dist/* ../../dist/ ; cd ../..
cd plugins/lab ; rm -rf dist && python setup.py sdist bdist_wheel ; cp dist/* ../../dist/ ; cd ../..
cd plugins/jupyterlab ; rm -rf dist && python setup.py sdist bdist_wheel ; cp dist/* ../../dist/ ; cd ../..
cd plugins/retrolab ; rm -rf dist && python setup.py sdist bdist_wheel ; cp dist/* ../../dist/ ; cd ../..
cd plugins/notebook ; rm -rf dist && python setup.py sdist bdist_wheel ; cp dist/* ../../dist/ ; cd ../..
cd plugins/kernels ; rm -rf dist && python setup.py sdist bdist_wheel ; cp dist/* ../../dist/ ; cd ../..
cd plugins/nbconvert ; rm -rf dist && python setup.py sdist bdist_wheel ; cp dist/* ../../dist/ ; cd ../..
cd plugins/terminals ; rm -rf dist && python setup.py sdist bdist_wheel ; cp dist/* ../../dist/ ; cd ../..
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
A set of [Asphalt](https://asphalt.readthedocs.io) components implementing a Jupyter server.

Try it online:
- JupyterLab frontend: [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/jupyter-server/jupyverse/HEAD?urlpath=jupyverse-jlab)
- RetroLab frontend: [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/jupyter-server/jupyverse/HEAD?urlpath=jupyverse-rlab)
- JupyterLab frontend: [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/jupyter-server/jupyverse/HEAD?urlpath=jupyverse-jupyterlab)
- Jupyter Notebook frontend: [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/jupyter-server/jupyverse/HEAD?urlpath=jupyverse-notebook)

Documentation is available [here](https://davidbrochart.github.io/jupyverse).

Expand Down
24 changes: 12 additions & 12 deletions binder/jupyter_notebook_config.py
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
jupyverse_jlab_command = " ".join(
jupyverse_jupyterlab_command = " ".join(
[
"jupyverse",
"--set auth.mode=noauth",
"--set frontend.collaborative=true",
"--set frontend.base_url={base_url}jupyverse-jlab/",
"--disable retrolab",
"--set frontend.base_url={base_url}jupyverse-jupyterlab/",
"--disable notebook",
"--port={port}",
]
+ [">jupyverse_jlab.log 2>&1"]
+ [">jupyverse_jupyterlab.log 2>&1"]
)


jupyverse_rlab_command = " ".join(
jupyverse_notebook_command = " ".join(
[
"jupyverse",
"--set auth.mode=noauth",
"--set frontend.collaborative=true",
"--set frontend.base_url={base_url}jupyverse-rlab/",
"--set frontend.base_url={base_url}jupyverse-notebook/",
"--disable jupyterlab",
"--port={port}",
]
+ [">jupyverse_rlab.log 2>&1"]
+ [">jupyverse_notebook.log 2>&1"]
)


c.ServerProxy.servers = {
"jupyverse-jlab": {
"command": ["/bin/bash", "-c", jupyverse_jlab_command],
"jupyverse-jupyterlab": {
"command": ["/bin/bash", "-c", jupyverse_jupyterlab_command],
"timeout": 60,
"absolute_url": False,
},
"jupyverse-rlab": {
"command": ["/bin/bash", "-c", jupyverse_rlab_command],
"jupyverse-notebook": {
"command": ["/bin/bash", "-c", jupyverse_notebook_command],
"timeout": 60,
"absolute_url": False,
},
}

c.NotebookApp.default_url = "/jupyverse-jlab"
c.NotebookApp.default_url = "/jupyverse-jupyterlab"

import logging

Expand Down
2 changes: 1 addition & 1 deletion binder/postBuild
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

python -m pip install -e plugins/lab
python -m pip install -e plugins/jupyterlab
python -m pip install -e plugins/retrolab
python -m pip install -e plugins/notebook
python -m pip install -e plugins/contents
python -m pip install -e plugins/kernels
python -m pip install -e plugins/terminals
Expand Down
4 changes: 2 additions & 2 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ component:
resource_usage:
type: resource_usage
track_cpu_percent: true
#retrolab:
# type: retrolab
#notebook:
# type: notebook
terminals:
type: terminals
yjs:
Expand Down
18 changes: 9 additions & 9 deletions docs/install.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Jupyverse can be installed to run either [JupyterLab](https://jupyterlab.readthedocs.io) or [RetroLab](https://github.com/jupyterlab/retrolab).
Jupyverse can be installed to run either [JupyterLab](https://jupyterlab.readthedocs.io) or [Jupyter Notebook](https://jupyter-notebook.readthedocs.io).

## With `pip`

For the JupyterLab frontend:
```bash
pip install "jupyverse[jupyterlab,auth]"
```
Or for the RetroLab frontend:
Or for the Jupyter Notebook frontend:
```bash
pip install "jupyverse[retrolab,auth]"
pip install "jupyverse[notebook,auth]"
```

## With `micromamba`
Expand All @@ -27,9 +27,9 @@ For the JupyterLab frontend:
```bash
micromamba install -c conda-forge jupyverse fps-jupyterlab fps-auth
```
Or for the RetroLab frontend:
Or for the Jupyter Notebook frontend:
```bash
micromamba install -c conda-forge jupyverse fps-retrolab fps-auth
micromamba install -c conda-forge jupyverse fps-notebook fps-auth
```

## Development install
Expand Down Expand Up @@ -69,9 +69,9 @@ Entering `hatch env show` will show the available environments:
│ dev │ virtual │ dev.jupyterlab-noauth │ test │ lint │
│ │ │ dev.jupyterlab-auth │ │ test │
│ │ │ dev.jupyterlab-auth_fief │ │ typecheck │
│ │ │ dev.retrolab-noauth │ │ │
│ │ │ dev.retrolab-auth │ │ │
│ │ │ dev.retrolab-auth_fief │ │ │
│ │ │ dev.notebook-noauth │ │ │
│ │ │ dev.notebook-auth │ │ │
│ │ │ dev.notebook-auth_fief │ │ │
└──────┴─────────┴──────────────────────────┴──────────┴───────────┘
```
!!! note
Expand All @@ -80,7 +80,7 @@ Entering `hatch env show` will show the available environments:
from your local repository. So you want to use the `dev` environment.

Currently, the `dev` environment matrix consists of all combinations of frontends
(`jupyterlab`, `retrolab`) and authentication methods (`noauth`, `auth`, `auth_fief`),
(`jupyterlab`, `notebook`) and authentication methods (`noauth`, `auth`, `auth_fief`),
which leads to six environments.

A number of scripts are available in the `dev` environments. They can be
Expand Down
2 changes: 1 addition & 1 deletion docs/plugins/lab.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
`fps-lab` implements everything that is common to JupyterLab and RetroLab.
`fps-lab` implements everything that is common to JupyterLab and Jupyter Notebook.
1 change: 1 addition & 0 deletions docs/plugins/notebook.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
`fps-notebook` implements the Notebook API.
1 change: 0 additions & 1 deletion docs/plugins/retrolab.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/usage/single_user.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This is the default mode when launching Jupyverse, just enter in a terminal:
jupyverse --open-browser
# same as: jupyverse --set auth.mode=token --open-browser
```
This should open a new window in a browser, and load JupyterLab or RetroLab, depending on the front-end you chose to install (see [Install](../../install)).
This should open a new window in a browser, and load JupyterLab or Jupyter Notebook, depending on the front-end you chose to install (see [Install](../../install)).

If you look at the terminal, you should see among other things:
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,40 +10,40 @@
from ..lab import Lab


class RetroLab(Router, ABC):
class Notebook(Router, ABC):
def __init__(self, app: App, auth: Auth, lab: Lab):
super().__init__(app=app)

router = APIRouter()

@router.get("/retro/tree", response_class=HTMLResponse)
@router.get("/tree", response_class=HTMLResponse)
async def get_tree(
user: User = Depends(auth.current_user()),
):
return await self.get_tree(user)

@router.get("/retro/notebooks/{path:path}", response_class=HTMLResponse)
@router.get("/notebooks/{path:path}", response_class=HTMLResponse)
async def get_notebook(
path,
user: User = Depends(auth.current_user()),
):
return await self.get_notebook(path, user)

@router.get("/retro/edit/{path:path}", response_class=HTMLResponse)
@router.get("/edit/{path:path}", response_class=HTMLResponse)
async def edit_file(
path,
user: User = Depends(auth.current_user()),
):
return await self.edit_file(path, user)

@router.get("/retro/consoles/{path:path}", response_class=HTMLResponse)
@router.get("/consoles/{path:path}", response_class=HTMLResponse)
async def get_console(
path,
user: User = Depends(auth.current_user()),
):
return await self.get_console(path, user)

@router.get("/retro/terminals/{name}", response_class=HTMLResponse)
@router.get("/terminals/{name}", response_class=HTMLResponse)
async def get_terminal(
name: str,
user: User = Depends(auth.current_user()),
Expand Down
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ nav:
- 'frontend': plugins/frontend.md
- 'lab': plugins/lab.md
- 'jupyterlab': plugins/jupyterlab.md
- 'retrolab': plugins/retrolab.md
- 'notebook': plugins/notebook.md
- 'nbconvert': plugins/nbconvert.md
- 'login': plugins/login.md
- 'kernels': plugins/kernels.md
Expand Down
4 changes: 2 additions & 2 deletions plugins/jupyterlab/fps_jupyterlab/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def __init__(
lab.redirect_after_root = "lab"

extensions_dir = lab.prefix_dir / "share" / "jupyter" / "labextensions"
self.federated_extensions, self.disabled_extension = lab.get_federated_extensions(
self.federated_extensions, self.disabled_extensions = lab.get_federated_extensions(
extensions_dir
)
jupyterlab_dir = Path(jupyterlab_module.__file__).parents[1]
Expand Down Expand Up @@ -126,7 +126,7 @@ def get_index(self, workspace, collaborative, server_side_execution, dev_mode, b
"collaborative": collaborative,
"serverSideExecution": server_side_execution,
"devMode": dev_mode,
"disabledExtensions": self.disabled_extension,
"disabledExtensions": self.disabled_extensions,
"exposeAppInBrowser": False,
"extraLabextensionsPath": [],
"federated_extensions": self.federated_extensions,
Expand Down
2 changes: 1 addition & 1 deletion plugins/lab/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# fps-lab

An FPS plugin for the JupyterLab/RetroLab API.
An FPS plugin for the JupyterLab/Notebook API.
2 changes: 1 addition & 1 deletion plugins/lab/fps_lab/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ async def get_setting(
):
with open(self.jlab_dir / "static" / "package.json") as f:
package = json.load(f)
if name0 in ["@jupyterlab", "@retrolab"]:
if name0 in ["@jupyterlab", "@notebook"]:
schemas_parent = self.jlab_dir
else:
schemas_parent = self.extensions_dir / name0 / name1
Expand Down
2 changes: 1 addition & 1 deletion plugins/lab/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "fps_lab"
description = "An FPS plugin for the JupyterLab/RetroLab API"
description = "An FPS plugin for the JupyterLab/Notebook API"
keywords = ["jupyter", "server", "fastapi", "plugins"]
requires-python = ">=3.8"
dependencies = [
Expand Down
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions plugins/notebook/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# fps-notebook

An FPS plugin for the Notebook API.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
from jupyverse_api.auth import Auth
from jupyverse_api.frontend import FrontendConfig
from jupyverse_api.lab import Lab
from jupyverse_api.retrolab import RetroLab
from jupyverse_api.notebook import Notebook

from .routes import _RetroLab
from .routes import _Notebook


class RetroLabComponent(Component):
class NotebookComponent(Component):
async def start(
self,
ctx: Context,
Expand All @@ -19,5 +19,5 @@ async def start(
frontend_config = await ctx.request_resource(FrontendConfig)
lab = await ctx.request_resource(Lab) # type: ignore

retrolab = _RetroLab(app, auth, frontend_config, lab)
ctx.add_resource(retrolab, types=RetroLab)
notebook = _Notebook(app, auth, frontend_config, lab)
ctx.add_resource(notebook, types=Notebook)
Loading

0 comments on commit 0c07b8d

Please sign in to comment.