Docker-stacks: Slow startup using datascience-notebook:lab-2.1.1 - perhaps npm sha512?

Created on 19 May 2020  路  8Comments  路  Source: jupyter/docker-stacks

I've been trying to isolate a problem with slow startup on a container based on datascience-notebook:lab-2.1.1 which is new as of ~15 days ago.

There's a distinct "pause" when the looking in using a z2jh that normally has no such delay. I notice when using the base datascience-notebook:lab-2.1.1 that ~/.npm was created and had:

jovyan@jupyter-grunwald:~$ ls -l .npm/_cacache/content-v2/
total 4
drwxr-sr-x 9 jovyan users 4096 May 19 21:12 sha512

This file / directory gets created each time restart the container (tested this by deleting it). I'm not certain why this is being downloaded / built but it seems to be what leads to the pause.

Anyone know how to have that baked into the base image?

Thanks!

help wanted Needs Debugging Upstream

All 8 comments

Hello

Nice catch. The npm cache directory is described here. I first thought that this behavior had something to do with JupyterLab Disabling Rebuild Checks, but after a quick test, it does not seem to have an effect.

It sounds obvious but is worth remembering

  • It is linked to Lab extensions since I do not reproduce this behavior on image without extensions (base-notebook).
  • On other images this directory is created when lab application is launched. It's not created with the "classic" notebook interface.

Maybe someone better skilled than me on JupyterLab and npm could help.

Best.

This problem does not occur with the "lab-2.0.1" release on docker hub. So, the change was introduced sometime between May 2 and May 5 when the lab-2.1.1 release came out.

The only non-package-version or documentation change I saw in https://github.com/jupyter/docker-stacks/commit/c32ba3a7f8263f2943be6726d1f6203695df5db1 was the change to jupyterlab-2.1.1 and adding a "-y" arg to "jupyter build -y"

I upgraded jupyterlab to 2.1.2 and it has the same issue.

I rebuilt my derived container user jupyter/datascience-notebook:lab-2.0.1 -- that had no problems with either pause and did not download npm modules. In that container, I was using a couple of lab extensions:

        jupyter labextension install --no-build @jupyterlab/latex
        jupyter labextension install --no-build jupyterlab-drawio
        jupyter labextension install --no-build @jupyterlab/server-proxy

I did not try basing it off the base-notebook.

I then added RUN conda install --quiet --yes jupyterlab=2.1.2 to the Dockerfile to upgrade jupyterlab and the problem came back. Same thing with jupyterlab-2.1.1

So you have demonstrated that the problem occurs only with jupyterlab >= 2.1.1. Maybe it's worth creating an issue in the Jupyterlab project. I took a quick look, but I didn't find anything close to this issue.

It does look like some changes were made to handling of extensions to support enabling/disabling in 2.1.0 according to the release notes.

https://jupyterlab.readthedocs.io/en/stable/getting_started/changelog.html#v2-1-0

I agree with @romainx that reporting this in the jupyterlab issue tracker makes sense at this point.

This appears to be fixed with jupyterlab-2.1.3 -- likely from https://github.com/jupyterlab/jupyterlab/pull/8463

I would mark this "closed" here but I think it should remain open until base-notebook upgrades to 2.1.3

@dirkcgrunwald thank you for your work on this issue.

Your PR has been merged and the version 2.1.3 of jupyterlab is now available in base-notebook. Could you please confirm if it's OK for you and close this issue?

Many thanks.
Best.

Yes, this fixes it.

Was this page helpful?
0 / 5 - 0 ratings