Git Plugin not showing up after upgrade to renkulab-py:3.10-0.23.0

Hi everyone,

After the upgrade to the newest Renku and Python 3.10 (because 3.9 does not support the latest pymc), the git jupyter plug-in seems to not work any more.

MR (merged) in question: Upgrade pymc and Install bambi (!6) · Merge requests · Mirko Birbaumer / HSLU Statistical Data Analysis I · GitLab

image

Git itself works:

Could someone of you nice folks at Renku assist me? :wink:

Kind regards,
Pascal

1 Like

Thank you @pascal.baumann for sharing this issue with us. Apparently, extensions needs to be enabled now and the server probably needs to be restarted, we will investigate how to do that automatically. In case you find a solution, please let us know.

Hi Elisabet,

Thank you for your reply! While checking the extensions with jupyter labextension list (something I could have done in the beginning - sorry for my oversight) I got the following output:

JupyterLab v3.6.7
/opt/conda/share/jupyter/labextensions
        jupyterlab_pygments v0.2.2 enabled OK (python, jupyterlab_pygments)
        jupyterlab-system-monitor v0.8.0 enabled OK (python, jupyterlab-system-monitor)
        jupyterlab-topbar-extension v0.6.1 enabled OK (python, jupyterlab-topbar)
        nbdime-jupyterlab v3.0.1 enabled  X
        @jupyter-server/resource-usage v0.7.2 enabled OK (python, jupyter-resource-usage)
        @jupyterlab/git v0.50.0 enabled  X (python, jupyterlab-git)
        @jupyterhub/jupyter-server-proxy v4.1.2 enabled OK


"nbdime-jupyterlab@3.0.1" is not compatible with the current JupyterLab
Conflicting Dependencies:
JupyterLab                  Extension       Package
>=3.6.7 <3.7.0              >=4.0.0 <5.0.0  @jupyterlab/apputils
>=3.6.7 <3.7.0              >=4.0.0 <5.0.0  @jupyterlab/codeeditor
>=5.6.7 <5.7.0              >=6.0.0 <7.0.0  @jupyterlab/coreutils
>=3.6.7 <3.7.0              >=4.0.0 <5.0.0  @jupyterlab/notebook
>=3.6.7 <3.7.0              >=4.0.0 <5.0.0  @jupyterlab/rendermime
>=6.6.7 <6.7.0              >=7.0.0 <8.0.0  @jupyterlab/services
>=3.6.7 <3.7.0              >=4.0.0 <5.0.0  @jupyterlab/settingregistry
>=3.6.7 <3.7.0              >=4.0.0 <5.0.0  @jupyterlab/translation
>=1.9.0 <2.0.0              >=2.0.1 <3.0.0  @lumino/algorithm
>=1.11.0 <2.0.0             >=2.1.2 <3.0.0  @lumino/coreutils
>=1.10.0 <2.0.0             >=2.1.2 <3.0.0  @lumino/disposable
>=1.37.2 <2.0.0             >=2.3.0 <3.0.0  @lumino/widgets



"@jupyterlab/git@0.50.0" is not compatible with the current JupyterLab
Conflicting Dependencies:
JupyterLab                  Extension        Package
>=3.6.7 <3.7.0              >=4.0.6 <5.0.0   @jupyterlab/application
>=3.6.7 <3.7.0              >=4.1.6 <5.0.0   @jupyterlab/apputils
>=3.6.7 <3.7.0              >=4.0.6 <5.0.0   @jupyterlab/codeeditor
>=3.6.7 <3.7.0              >=4.0.6 <5.0.0   @jupyterlab/codemirror
>=3.6.7 <3.7.0              >=4.0.6 <5.0.0   @jupyterlab/console
>=5.6.7 <5.7.0              >=6.0.6 <7.0.0   @jupyterlab/coreutils
>=3.6.7 <3.7.0              >=4.0.6 <5.0.0   @jupyterlab/filebrowser
>=3.6.7 <3.7.0              >=4.0.6 <5.0.0   @jupyterlab/mainmenu
>=3.6.7 <3.7.0              >=4.0.6 <5.0.0   @jupyterlab/rendermime
>=6.6.7 <6.7.0              >=7.0.6 <8.0.0   @jupyterlab/services
>=3.6.7 <3.7.0              >=4.0.6 <5.0.0   @jupyterlab/settingregistry
>=3.6.7 <3.7.0              >=4.0.6 <5.0.0   @jupyterlab/terminal
>=3.6.7 <3.7.0              >=4.0.6 <5.0.0   @jupyterlab/translation
>=3.6.7 <3.7.0              >=4.0.6 <5.0.0   @jupyterlab/ui-components
>=1.19.0 <2.0.0             >=2.0.1 <3.0.0   @lumino/commands
>=1.11.0 <2.0.0             >=2.0.0 <3.0.0   @lumino/coreutils
>=1.10.0 <2.0.0             >=2.0.0 <3.0.0   @lumino/disposable
>=1.10.0 <2.0.0             >=2.0.0 <3.0.0   @lumino/messaging
>=1.10.0 <2.0.0             >=2.0.0 <3.0.0   @lumino/signaling
>=1.37.2 <2.0.0             >=2.0.1 <3.0.0   @lumino/widgets
>=17.0.1 <18.0.0            >=18.2.0 <19.0.0 react
>=17.0.1 <18.0.0            >=18.2.0 <19.0.0 react-dom

Given that the latest version of @jupyterlab/git@ is 0.50.1 and of jupyterlab is 4.2.4, I believe an update of the jupyterlab in the renku base container is the way to go.

Please tell me if you need some debugging from my side - as I do not want to try to hack something together (like updating jupyterlab in the container) or downgrading the extension, I think it would help the community more if the base container is fixed - please tell me, I am quite happy to help =)

Addendum: Further investigation of renkulab-py:3.10-0.23.0 led me to find that it’s based on jupyter/base-notebook:3.10 which was last built/pushed in march last year:


I believe that is the core of the outdated jupyter lab. On how to best proceed we probably need the input of @rrrrrok as I saw that he manages the GitHub docker images.

1 Like

Hi @pascal.baumann thanks for looking into this!

I’ve tried to build an updated image with jupyterlab>=4.0 - could you please test renku/renkulab-py:3.10-e5370c4?

Hi @rrrrrok ,

Thanks for the quick iteration! Pipeline went through: image_build (#725151) · Jobs · Mirko Birbaumer / HSLU Statistical Data Analysis I · GitLab

And the extension is back! =)

Great, thanks for checking @pascal.baumann! I’ll see if we can get that change merged and released.

1 Like

Hi @rrrrrok , I tried to upgrade to renkulab-py:3.10-0.24.0, but got errors with setuptools, so I made a minimum working example Pascal Baumann / TestPyMCRenku · GitLab and it has the same issues, do you have an idea?

Hi @pascal.baumann.

I am not sure how this same package works in the old images but not in the new ones. What does work is installing this package with mamba (i.e. conda). To do this just remove the entry from requirements.txt and add a line to environment.yml.

So your environment.yml should look like this:

name: "base"
# WARNING : As Renku makes use of mamba for more efficient package builds, please use the popular "conda-forge" channel
# For more details : https://mamba.readthedocs.io/en/latest/user_guide/troubleshooting.html#mixing-the-defaults-and-conda-forge-channels
# Using the defaults channel from Anaconda can easily result in getting your
# laptop, CI pipeline, etc. blacklisted by Anaconda which makes building packages
# impossible. To get permission to use Anaconda again you need to either pay or prove that
# you meet the requirements for a free license. Using the conda-forge channel avoids 
# these restrictions completely.
channels:
  - conda-forge
dependencies:
  - pymc==5.16.2. # <<<------ This is the only new line
# - add packages here
# - one per line
prefix: "/opt/conda"

In general it is better to install packages via the environment.yml file since that uses mamba which is much better when it comes to resolving dependencies. And scientific packages like pymc or numpy or similar usually have complicated dependencies. Anything from requirements.txt is installed only via pip which is not as robust. I know from my own experience installing numpy from pip is usually a pain or it does not work. I have not done this in a while and maybe things are better now. But when I used numpy more a few years back I would always install it with conda or mamba.

I cloned your project and could reproduce your error locally. With the proposed change the image builds. But please run it and make sure everything is ok. And let me know if there are any other issues - but I dont think there will be.

And please make sure that you remove the pymc package from your requirements.txt file. If you have it in both places (i.e. requirements.txt and environment.yml) then things will also probably break.

I generally avoid conda because it sideloads a lot of dependencies that can make the environment unusable, and the dependency resolver sometimes stalls the pipeline or just completely breaks, while with pip I have a lot more control and insight why something is breaking.

Generally I do not understand why the pipeline builds in renkulab-py:3.10-0.23.0 but breaks in renkulab-py:3.10-0.24.0. If the official answer is, don’t use pip requirements but only conda, I will be unhappy but ok. But this means a lot of legacy projects will have to get migrated.

I am pretty sure I can figure out why pip does not work. I just need some time. It is suspicious why the old image worked fine with pip but the new one does not. So I will get back to you.

1 Like

@pascal.baumann something is a bit off with the setuptools installation in our images. And thanks to a colleague of mine (@leafty) who did some troubleshooting we noticed that this can be fixed by installing backports.tarfile in the current environment. We will rollout a proper fix for this.

But in the meantime you can get unstuck by installing this package in your Dockerfile. Like this:

########################################################
#        Renku install section - do not edit           #

FROM renku/renkulab-py:3.10-0.24.0 as builder

# RENKU_VERSION determines the version of the renku CLI
# that will be used in this image. To find the latest version,
# visit https://pypi.org/project/renku/#history.
ARG RENKU_VERSION=2.9.2

# Install renku from pypi or from github if a dev version
RUN if [ -n "$RENKU_VERSION" ] ; then \
        source .renku/venv/bin/activate ; \
        currentversion=$(renku --version) ; \
        if [ "$RENKU_VERSION" != "$currentversion" ] ; then \
            pip uninstall renku -y ; \
            gitversion=$(echo "$RENKU_VERSION" | sed -n "s/^[[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+\(rc[[:digit:]]\+\)*\(\.dev[[:digit:]]\+\)*\(+g\([a-f0-9]\+\)\)*\(+dirty\)*$/\4/p") ; \
            if [ -n "$gitversion" ] ; then \
                pip install --no-cache-dir --force "git+https://github.com/SwissDataScienceCenter/renku-python.git@$gitversion" ;\
            else \
                pip install --no-cache-dir --force renku==${RENKU_VERSION} ;\
            fi \
        fi \
    fi
#             End Renku install section                #
########################################################

FROM renku/renkulab-py:3.10-0.24.0

# Uncomment and adapt if code is to be included in the image
# COPY src /code/src

# Uncomment and adapt if your R or python packages require extra linux (ubuntu) software
# e.g. the following installs apt-utils and vim; each pkg on its own line, all lines
# except for the last end with backslash '\' to continue the RUN line
#
# USER root
# RUN apt-get update && \
#    apt-get install -y --no-install-recommends \
#    apt-utils \
#    vim
# USER ${NB_USER}

# install the python dependencies
COPY requirements.txt environment.yml /tmp/
RUN mamba env update -q -f /tmp/environment.yml && \
    /opt/conda/bin/pip install --no-cache-dir backports.tarfile && \    # <<<<<<<<<<<< new line
    /opt/conda/bin/pip install -r /tmp/requirements.txt --no-cache-dir && \
    mamba clean -y --all && \
    mamba env export -n "root" && \
    rm -rf ${HOME}/.renku/venv

COPY --from=builder ${HOME}/.renku/venv ${HOME}/.renku/venv

That is the only new line you have to add to your Dockerfile. I posted the whole thing above so that it is clear where it should be added.

With this change installing pymc with pip works.

1 Like

Very cool, thanks for the update, I will try the fix in a branch and wait for the proper release then. Feel free to use me as a beta-tester ^^

Your hotfix worked perfectly!

@tolevski I will wait for the release of renkulab-py:3.10-0.25.0 probably to merge the change, but thanks for your work so far!