1

I am running docker build task in Azure pipelines on a pipeline agent that runs on an on-prem host. I am trying to "RUN jupyter labextension install @jupyter-widgets/jupyterlab-manager".

In the base image: node=14.14.0 jupyter=1.0.0 jupyter-packaging = 0.7.12 jupyter-resource-usage= 0.5.1 jupyter_client = 6.1.7 jupyter_console = 6.2.0 jupyter_core = 4.7.0 jupyter_server = 1.6.1 jupyter_telemetry = 0.1.0 jupyterhub = 1.3.0 jupyterhub-base = 1.3.0 jupyterlab = 3.0.12 jupyterlab-git = 0.30.0b2 jupyterlab-templates = 0.2.5 jupyterlab_code_formatter=1.4.5 jupyterlab_pygments = 0.1.2 jupyterlab_server = 2.3.0

Dockerfile looks like this:

USER root
COPY files/.npmrc $HOME/.npmrc
RUN jupyter labextension install --no-build @jupyter-widgets/jupyterlab-manager .....

.npmrc looks like so:

always-auth=true
strict-ssl=false
registry=https://pkgs.dev.azure.com/org-name/proj-name/_packaging/proj-name/npm/registry/
https-proxy=the-proxy-url
proxy=the-proxy-url

The pipeline does the following tasks:

  1. Runs npmAuthenticate task on .npmrc to edit the .npmrc file with the auth-token. This succeeds..
  2. Next runs docker build. The Dockerfile instructs to copy this modified .npmrc to $HOME and tries to install lab extensions

Found this thread : https://github.com/jupyter-widgets/ipywidgets/issues/1982#issuecomment-468716770 We use jupyterlab v3. So node>=12 is required. So I changed the Dockerfile to:

USER root
COPY files/.npmrc $HOME/.npmrc
RUN conda remove nodejs && conda install -c conda-forge nodejs=12 && conda list | grep nodejs &&\
jupyter labextension install --no-build @jupyter-widgets/jupyterlab-manager .....

Tried this also: https://stackoverflow.com/a/52484330/3575135 . Didnt help

The normal "npm install @angular/cli" works. But the lab extensions are giving me a hard time. Nothing seems to be working at this point..

This is the error:

ValueError: "@jupyter-widgets/jupyterlab-manager" is not a valid npm package

Please help!

Seeker
  • 297
  • 5
  • 19
  • error suggests that package is not in this registry -> `https://pkgs.dev.azure.com/org-name/proj-name/_packaging/proj-name/npm/registry/` did you put the package there? I assume its your private registry. – The Fool May 19 '21 at 08:16
  • This package is in the public npmjs registry. The registry has npmjs set as upstream source – Seeker May 19 '21 at 08:20
  • did you try already to commet this registry out to try to fetch directly from offical npm ? Can you follow the steps you want to do in docker locally? Specifically is this a valid comment you can execute anywhere successful? `jupyter labextension install --no-build @jupyter-widgets/jupyterlab-manager` – The Fool May 19 '21 at 08:23
  • 1
    I looked at this (https://github.com/postmanlabs/npm-cli-login/issues/47#issuecomment-580102203) and copied the npmrc to /.npmrc instead of $HOME/.npmrc. It seems to have worked. The build will take another 2-4 hours to complete. Will test the image and close the issue if everything works out! :) thanks! – Seeker May 19 '21 at 08:29
  • Of course, you put user root at the top of your docker file. What's strange is that you have the file now at `/.npmrc` and not `/root/.npmrc` because technically that is roots home folder. Ah wait, but then $HOME should have also worked. Hmm. – The Fool May 19 '21 at 08:34

2 Answers2

3

You should NOT be installing Node.js nor @jupyter-widgets/jupyterlab-manager for JupyterLab 3.0+. The extension system has been improved and the new "federated extensions" system no longer requires Node.js (and majority of extensions have migrated away from Node.js requirement). The readme of @jupyter-widgets/jupyterlab-manager clearly states that for JupyterLab 3.0+ you should use:

pip install jupyterlab_widgets

The same goes for most extensions - they will have a name of the PyPI package in their readme if they migrated. For more in-depth explanation please read this answer.

As a good advice please only use jupyter labextension install for extensions that have not migrated to pip/conda-installable federated extensions.

krassowski
  • 13,598
  • 4
  • 60
  • 92
0

Copied the npmrc to /.npmrc instead of $HOME/.npmrc. This worked

Seeker
  • 297
  • 5
  • 19