Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker: update to JupyterLab v3 and fix broken jupyterlab-system-monitor plugin #85

Merged
merged 14 commits into from
Jul 29, 2021

Conversation

tlvu
Copy link
Contributor

@tlvu tlvu commented Jul 28, 2021

Overview

JupyterLab v3 was available since January 2021 but we had to pin to v2 since many of the plugins we use were broken at the time for v3.

Fast forward 7 months later, only the Google Drive plugin still do not support JupyterLab v3 so we decided to drop it since it was only used by one single user (ls -larth /data/jupyterhub_user_data/*/.home/.jupyter/lab/user-settings/@jupyterlab/google-drive /dev/null shows who uses it). We have not enabled the system-wide Google Drive config due to security concern so each user had to configure it themselves separately.

Staying on JupyterLab v2 caused us the reverse problem, some plugins stopped working with v2, example the jupyterlab-system-monitor one. That one is becoming more crucial as we have more and more users and we would like users to be aware of their resource consumptions on the system.

This PR fixes #83, the jupyterlab-system-monitor problem.

Changes

  • Update to JupyterLab v3
  • Update install steps for all plugins to be compatible with JupyterLab v3
  • Drop Google Drive plugin since not compatible with v3
  • Fix jupyterlab-system-monitor plugin, was broken with v2
  • Unpin pandas as xarray issue Release v0.19? pydata/xarray#5588 fixed
  • Picked up latest RavenPy 0.7.0
  • Relevant packages changes:
<   - jupyterlab=2.2.9=pyhd8ed1ab_0
>   - jupyterlab=3.1.0=pyhd8ed1ab_0

<   - jupyterlab_server=1.2.0=py_0
>   - jupyterlab_server=2.6.1=pyhd8ed1ab_0

<   - jupyter-archive=2.2.0=pyhd8ed1ab_0
>   - jupyter-archive=3.0.1=pyhd8ed1ab_0

<   - jupyter_bokeh=2.0.4=pyhd8ed1ab_0
>   - jupyter_bokeh=3.0.2=pyhd8ed1ab_0

<   - jupyterlab-git=0.24.0=pyhd8ed1ab_0
>   - jupyterlab-git=0.31.0=pyhd8ed1ab_0

<   - nbdime=2.1.0=py_0
>   - nbdime=3.1.0=pyhd8ed1ab_0

# Pip to Conda package
<     - nbresuse==0.4.0  
>   - nbresuse=0.4.0=pyhd8ed1ab_0

>   - nbclassic=0.3.1=pyhd8ed1ab_1

>   - jupyterlab-system-monitor=0.8.0=pyhd8ed1ab_1
>   - jupyter-resource-usage=0.5.1=pyhd8ed1ab_0
>   - jupyterlab-topbar=0.6.1=pyhd8ed1ab_2 
>     - jupyterlab-logout=0.5.0

<   - jupyter_conda=5.1.1=hd8ed1ab_0

<   - ravenpy=0.6.0=pyh1bb2064_2
>   - ravenpy=0.7.0=pyh1bb2064_0 

<   - pandas=1.2.5=py37h219a48f_0
>   - pandas=1.3.1=py37h219a48f_0

<   - xarray=0.18.2=pyhd8ed1ab_0
>   - xarray=0.19.0=pyhd8ed1ab_1

<   - dask=2021.7.0=pyhd8ed1ab_0
>   - dask=2021.7.1=pyhd8ed1ab_0

<   - regionmask=0.6.2=pyhd8ed1ab_0
>   - regionmask=0.7.0=pyhd8ed1ab_0

Additional Information

Screenshot showing differences between v2 vs v3 and the working jupyterlab-system-monitor plugin.

Screenshot from 2021-07-28 14-10-33

Bokeh and pyviz testing by running ClimateDataAnalysis-5Visualization.ipynb on the old and new Jupyter env and manually comparing the graphics generated. They look similar.

Jenkins build all passed https://daccs-jenkins.crim.ca/job/PAVICS-e2e-workflow-tests/job/update-to-jupyterlab-v3/7/console (CRIM Jenkins)
Notebooks fixes required for the above passing Jenkins build:

Jenkins build for Raven nb, all passed: http://jenkins.ouranos.ca/job/PAVICS-e2e-workflow-tests/job/update-to-jupyterlab-v3/5/console

Matching PR to deploy this new Jupyter env to PAVICS: bird-house/birdhouse-deploy#185

Full diff of conda env export:
210723-210728-conda-env-export.diff.txt

Full new conda env export:
210728-conda-env-export.yml.txt

tlvu added 14 commits July 24, 2021 10:33
…m-monitor

jupyterlab-system-monitor has not been working with jupyterlab v2
…t jupyterlab v3

```
Step 11/20 : RUN jupyter labextension install @jupyter-widgets/jupyterlab-manager     && jupyter serverextension enable voila --sys-prefix     && jupyter labextension install @jupyter-widgets/jupyterlab-manager jupyter-leaflet     && jupyter labextension install @jupyterlab/debugger     && jupyter labextension install @jupyterlab/google-drive     && jupyter labextension install jupyterlab-topbar-text                                     jupyterlab_conda
 ---> Running in 96e4392006b2
Building jupyterlab assets (production, minimized)
Enabling: voila
- Writing config: /opt/conda/envs/birdy/etc/jupyter
    - Validating...
      voila 0.2.10 OK
Building jupyterlab assets (production, minimized)
Building jupyterlab assets (production, minimized)
\  An error occured.
ValueError: The extension "@jupyterlab/google-drive" does not yet support the current version of JupyterLab.

Conflicting Dependencies:
JupyterLab                  Extension       Package
>=3.0.11 <3.1.0             >=2.0.0 <3.0.0  @jupyterlab/application
>=3.0.9 <3.1.0              >=2.0.0 <3.0.0  @jupyterlab/apputils
>=5.0.6 <5.1.0              >=4.0.0 <5.0.0  @jupyterlab/coreutils
>=3.0.11 <3.1.0             >=2.0.0 <3.0.0  @jupyterlab/docmanager
>=3.0.11 <3.1.0             >=2.0.0 <3.0.0  @jupyterlab/filebrowser
>=3.0.9 <3.1.0              >=2.0.0 <3.0.0  @jupyterlab/mainmenu
>=6.0.9 <6.1.0              >=5.0.0 <6.0.0  @jupyterlab/services
>=3.0.6 <3.1.0              >=2.0.0 <3.0.0  @jupyterlab/settingregistry
See the log file for details:  /tmp/jupyterlab-debug-shgkoz6v.log
The command '/bin/sh -c jupyter labextension install @jupyter-widgets/jupyterlab-manager     && jupyter serverextension enable voila --sys-prefix     && jupyter labextension install @jupyter-widgets/jupyterlab-manager jupyter-leaflet     && jupyter labextension install @jupyterlab/debugger     && jupyter labextension install @jupyterlab/google-drive     && jupyter labextension install jupyterlab-topbar-text                                     jupyterlab_conda' returned a non-zero code: 1
```
tlvu added a commit to Ouranosinc/pavics-sdi that referenced this pull request Jul 28, 2021
New Jupyter env in Ouranosinc/PAVICS-e2e-workflow-tests#85.

This is still weird as we are already ignoring by default all html
changes in
https://github.com/Ouranosinc/PAVICS-e2e-workflow-tests/blob/3172f621afe991c69caa0fa10c7d40f2f09fdd02/conftest.py#L5

Error fixed:
```
  _______ pavics-sdi-master/docs/source/notebooks/subsetting.ipynb::Cell 4 _______
  Notebook cell execution failed
  Cell 4: Cell outputs differ

  Input:
  res = resp.get()
  print("URL: ", res.output)
  res = resp.get(asobj=True)
  res.output

  Traceback:
   mismatch 'text/plain'

   assert reference_output == test_output failed:

    '<xarray.Data...        2.6.0' == '<xarray.Data...        2.6.0'
    Skipping 1136 identical trailing characters in diff, use -v to show
      <xarray.Dataset>
    - Dimensions:             (time: 12, bnds: 2, lat: 38, lon: 37)
    + Dimensions:             (bnds: 2, lat: 38, lon: 37, time: 12)
      Coordin
```
tlvu added a commit to bird-house/finch that referenced this pull request Jul 28, 2021
New Jupyter env in
Ouranosinc/PAVICS-e2e-workflow-tests#85

This is a bit weird since we already ignore all html output changes in
https://github.com/Ouranosinc/PAVICS-e2e-workflow-tests/blob/3172f621afe991c69caa0fa10c7d40f2f09fdd02/conftest.py#L5

Error fixed:
```
  _________ finch-master/docs/source/notebooks/finch-usage.ipynb::Cell 5 _________
  Notebook cell execution failed
  Cell 5: Cell outputs differ

  Input:
  out = resp.get(asobj=True)
  out.output_netcdf

  Traceback:
   mismatch 'text/plain'

   assert reference_output == test_output failed:

    '<xarray.Data...         CCCS' == '<xarray.Data...         CCCS'
    Skipping 1109 identical trailing characters in diff, use -v to show
      <xarray.Dataset>
    - Dimensions:     (time: 20, lat: 6, lon: 7)
    + Dimensions:     (lat: 6, lon: 7, time: 20)
      Coordin
```
tlvu added a commit to Ouranosinc/PAVICS-landing that referenced this pull request Jul 28, 2021
New Jupyter env in Ouranosinc/PAVICS-e2e-workflow-tests#85.

Funny that I have to add NBVAL_IGNORE_OUTPUT to a cell that has empty output!

Error fixed:
```
  _ PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-5Visualization.ipynb::Cell 3 _
  Notebook cell execution failed
  Cell 3: Cell outputs differ

  Input:
  # Start with 30 year means from mapping step
  # Calculate weighted average for each region as in last step
  with xr.set_options(keep_attrs=True):
      reg30y_sims = (d30yAvg * weight_masks).sum(dim=['lat','lon'])
      reg30y_ens = xens.ensemble_percentiles(reg30y_sims)
      # make the 'horizon' field the index of our table. rename the 'geom' field to 'region'
      df = reg30y_ens.swap_dims(dict(year='horizon')).rename({'geom':'region'}).to_dataframe()
  df.hvplot.table(title='Summary table',fit_columns=False, sortable=True, selectable=True, width=2000)

  Traceback:
   mismatch 'text/plain'

   assert reference_output == test_output failed:

    ':Table   [ho...ve_delta_p90]' == ':Table   [rc...ve_delta_p90]'
    Skipping 227 identical trailing characters in diff, use -v to show
    - :Table   [rcp,horizon,season,region,tx_mea
    + :Table   [horizon,rcp,region,season,tx_mea
```
Copy link
Collaborator

@Zeitsperre Zeitsperre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New version looks!

tlvu added a commit to bird-house/birdhouse-deploy that referenced this pull request Jul 28, 2021
…enPy-0.7.0

See PR Ouranosinc/PAVICS-e2e-workflow-tests#85 for more info.

Relevant changes:
```diff
<   - jupyterlab=2.2.9=pyhd8ed1ab_0
>   - jupyterlab=3.1.0=pyhd8ed1ab_0

<   - jupyterlab_server=1.2.0=py_0
>   - jupyterlab_server=2.6.1=pyhd8ed1ab_0

<   - jupyter-archive=2.2.0=pyhd8ed1ab_0
>   - jupyter-archive=3.0.1=pyhd8ed1ab_0

<   - jupyter_bokeh=2.0.4=pyhd8ed1ab_0
>   - jupyter_bokeh=3.0.2=pyhd8ed1ab_0

<   - jupyterlab-git=0.24.0=pyhd8ed1ab_0
>   - jupyterlab-git=0.31.0=pyhd8ed1ab_0

<   - nbdime=2.1.0=py_0
>   - nbdime=3.1.0=pyhd8ed1ab_0

<     - nbresuse==0.4.0
>   - nbresuse=0.4.0=pyhd8ed1ab_0

>   - nbclassic=0.3.1=pyhd8ed1ab_1

>   - jupyterlab-system-monitor=0.8.0=pyhd8ed1ab_1
>   - jupyter-resource-usage=0.5.1=pyhd8ed1ab_0
>   - jupyterlab-topbar=0.6.1=pyhd8ed1ab_2
>     - jupyterlab-logout=0.5.0

<   - jupyter_conda=5.1.1=hd8ed1ab_0

<   - ravenpy=0.6.0=pyh1bb2064_2
>   - ravenpy=0.7.0=pyh1bb2064_0

<   - pandas=1.2.5=py37h219a48f_0
>   - pandas=1.3.1=py37h219a48f_0

<   - xarray=0.18.2=pyhd8ed1ab_0
>   - xarray=0.19.0=pyhd8ed1ab_1

<   - dask=2021.7.0=pyhd8ed1ab_0
>   - dask=2021.7.1=pyhd8ed1ab_0

<   - regionmask=0.6.2=pyhd8ed1ab_0
>   - regionmask=0.7.0=pyhd8ed1ab_0
```
@tlvu
Copy link
Contributor Author

tlvu commented Jul 28, 2021

All Jenkins passed, this PR is ready for review.

Copy link
Contributor

@ChaamC ChaamC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tlvu tlvu merged commit b411898 into master Jul 29, 2021
@tlvu tlvu deleted the update-to-jupyterlab-v3 branch July 29, 2021 17:54
tlvu added a commit to Ouranosinc/pavics-sdi that referenced this pull request Jul 29, 2021
subsetting.ipynb: update output for new Jupyter env

New Jupyter env in Ouranosinc/PAVICS-e2e-workflow-tests#85.

This is still weird as we are already ignoring by default all html
changes in
https://github.com/Ouranosinc/PAVICS-e2e-workflow-tests/blob/3172f621afe991c69caa0fa10c7d40f2f09fdd02/conftest.py#L5

Error fixed:
```
  _______ pavics-sdi-master/docs/source/notebooks/subsetting.ipynb::Cell 4 _______
  Notebook cell execution failed
  Cell 4: Cell outputs differ

  Input:
  res = resp.get()
  print("URL: ", res.output)
  res = resp.get(asobj=True)
  res.output

  Traceback:
   mismatch 'text/plain'

   assert reference_output == test_output failed:

    '<xarray.Data...        2.6.0' == '<xarray.Data...        2.6.0'
    Skipping 1136 identical trailing characters in diff, use -v to show
      <xarray.Dataset>
    - Dimensions:             (time: 12, bnds: 2, lat: 38, lon: 37)
    + Dimensions:             (bnds: 2, lat: 38, lon: 37, time: 12)
      Coordin
```
tlvu added a commit to bird-house/finch that referenced this pull request Jul 29, 2021
finch-usage.ipynb: update output for new jupyter env

New Jupyter env in
Ouranosinc/PAVICS-e2e-workflow-tests#85

This is a bit weird since we already ignore all html output changes in
https://github.com/Ouranosinc/PAVICS-e2e-workflow-tests/blob/3172f621afe991c69caa0fa10c7d40f2f09fdd02/conftest.py#L5

Error fixed:
```
  _________ finch-master/docs/source/notebooks/finch-usage.ipynb::Cell 5 _________
  Notebook cell execution failed
  Cell 5: Cell outputs differ

  Input:
  out = resp.get(asobj=True)
  out.output_netcdf

  Traceback:
   mismatch 'text/plain'

   assert reference_output == test_output failed:

    '<xarray.Data...         CCCS' == '<xarray.Data...         CCCS'
    Skipping 1109 identical trailing characters in diff, use -v to show
      <xarray.Dataset>
    - Dimensions:     (time: 20, lat: 6, lon: 7)
    + Dimensions:     (lat: 6, lon: 7, time: 20)
      Coordin
```
tlvu added a commit to bird-house/birdhouse-deploy that referenced this pull request Jul 29, 2021
…b-v3

jupyter: update for JupyterLab v3, fix memory monitor display and RavenPy-0.7.0

See PR Ouranosinc/PAVICS-e2e-workflow-tests#85 for more info.

Relevant changes:
```diff
<   - jupyterlab=2.2.9=pyhd8ed1ab_0
>   - jupyterlab=3.1.0=pyhd8ed1ab_0

<   - jupyterlab_server=1.2.0=py_0
>   - jupyterlab_server=2.6.1=pyhd8ed1ab_0

<   - jupyter-archive=2.2.0=pyhd8ed1ab_0
>   - jupyter-archive=3.0.1=pyhd8ed1ab_0

<   - jupyter_bokeh=2.0.4=pyhd8ed1ab_0
>   - jupyter_bokeh=3.0.2=pyhd8ed1ab_0

<   - jupyterlab-git=0.24.0=pyhd8ed1ab_0
>   - jupyterlab-git=0.31.0=pyhd8ed1ab_0

<   - nbdime=2.1.0=py_0
>   - nbdime=3.1.0=pyhd8ed1ab_0

<     - nbresuse==0.4.0
>   - nbresuse=0.4.0=pyhd8ed1ab_0

>   - nbclassic=0.3.1=pyhd8ed1ab_1

>   - jupyterlab-system-monitor=0.8.0=pyhd8ed1ab_1
>   - jupyter-resource-usage=0.5.1=pyhd8ed1ab_0
>   - jupyterlab-topbar=0.6.1=pyhd8ed1ab_2
>     - jupyterlab-logout=0.5.0

<   - jupyter_conda=5.1.1=hd8ed1ab_0

<   - ravenpy=0.6.0=pyh1bb2064_2
>   - ravenpy=0.7.0=pyh1bb2064_0

<   - pandas=1.2.5=py37h219a48f_0
>   - pandas=1.3.1=py37h219a48f_0

<   - xarray=0.18.2=pyhd8ed1ab_0
>   - xarray=0.19.0=pyhd8ed1ab_1

<   - dask=2021.7.0=pyhd8ed1ab_0
>   - dask=2021.7.1=pyhd8ed1ab_0

<   - regionmask=0.6.2=pyhd8ed1ab_0
>   - regionmask=0.7.0=pyhd8ed1ab_0
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

jupyterlab-system-monitor do not work in Jupyter env
4 participants