Skip to content

Cell output not preserved even when server-side execution is enabled #339

Closed as not planned
@francesco-ballarin

Description

@francesco-ballarin

Description

Hi,
I saw #279, and was eager to use it on my system with motivations similar to the one in jupyterlab/jupyterlab#2833.
However, cell output does not get preserved even when following the instructions in the PR.

I show below how to replicate with a docker container, but I actually have the same issue on my host machine (without docker).

Reproduce

Open a new docker image with docker run -it --rm -p 80:80 debian:testing
and run the following

apt -y update
apt -y upgrade
apt -y dist-upgrade
apt install -y python3-pip

rm /usr/lib/python3.12/EXTERNALLY-MANAGED
rm -rf /usr/local/lib/python3.12/dist-packages

pip install jupyterlab
pip install "jupyverse[jupyterlab, auth]"

# I need the following patch
sed -i 's|self.prefix_dir = Path(sys.prefix)|self.prefix_dir = Path(sys.prefix) / "local"|g' /usr/local/lib/python3.12/dist-packages/jupyverse_api/lab/__init__.py
# because python3 comes from /usr (installed via apt), while jupyter is installed in /usr/local (via pip).

# In my actual system I also need to run
# sed -i 's|for d1 in s.iterdir():|for d1 in s.iterdir():\n                if (d1 / "package.json.orig").exists():\n                    continue|g' /usr/local/lib/python3.12/dist-packages/fps_lab/routes.py
# because I have folders where package.json.orig is in the d1 rather than its subdirectory d2
# (for instance, created by ipyparallel). For simplicity, we do not install those packages here.

jupyverse --host 0.0.0.0 --port 80 --set kernels.require_yjs=true --set jupyterlab.server_side_execution=true

Got to the jupyter URL, create a new notebook with content

from time import sleep
i = 1
while True:
    print(i)
    i+=1
    sleep(1)

and run the cell. Save, close and re-open the tab. The output is not updated after opening the new tab.

It may not be relevant, but I also noted that the html output is not exactly the same as in the video in #279:

  • the video has [ ] next to the second cell while it runs, while I have [*] as in jupyterlab
  • in the video there is an odd extra new line between one number and the next. I don't have that extra space.

Expected behavior

Something similar to the video in #279

Context

  • Operating System and version: Debian testing (both on the host and on the container)
  • Browser and version: Chrome 127.0.6533.119
  • JupyterLab version: see below
# pip list | grep jupy
fps_jupyterlab              0.6.0
jupyter_client              8.6.2
jupyter_core                5.7.2
jupyter-events              0.10.0
jupyter-lsp                 2.2.5
jupyter_server              2.14.2
jupyter_server_terminals    0.5.3
jupyterlab                  4.2.4
jupyterlab_pygments         0.3.0
jupyterlab_server           2.27.3
jupyverse                   0.6.0
jupyverse_api               0.6.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions