Skip to content

Image Update - March 2026#159

Open
Zeitsperre wants to merge 31 commits intomasterfrom
update-2026-03
Open

Image Update - March 2026#159
Zeitsperre wants to merge 31 commits intomasterfrom
update-2026-03

Conversation

@Zeitsperre
Copy link
Copy Markdown
Collaborator

@Zeitsperre Zeitsperre commented Mar 17, 2026

Overview

This PR prepares the next major update of the Jupyter image of PAVICS (2026-03).

The goal of this update is to update the Ouranos library offerings as well as remove several older workarounds and lift several dependency pins. It also updates the base Python from 3.11 to 3.12.

The most significant changes are that the base image is now mambaorg/micromamba, which is the official micromamba image, and jupyterlab is now v4.x (previously 3.x). For the base image, this saves us the work of needing to install micromamba and also saves us the hassle of needing to set channel priority. It's also much slimmer than the previous base image. For the new jupyterlab, many workarounds and the functionality from older/deprecated plugins are now built in. The image not only builds faster (GitHub CI: 17 mins → 15 mins), but it is also slightly smaller (~150 MB from previous).

Building on #157, several system packages have been replaced with conda-forge equivalents. As it stands, the only package installed via apt is the XKCD font (fonts-humor-sans).

launchcontainer and launchnotebook no longer overwrite UID and GID (fails in zsh) and instead now use USER_ID and GROUP_ID for call substitutions. They also no longer use back-tick commands:

VARIABLE = `some-command -flag`

is now:

VARIABLE = "$(some-command -flag)"

I've removed the x11-utils` as I'm not sure if it is actually required (what are we using it for?).

Changes

  • Replaces base image continuumio/miniconda3 with mambaorg/micromamba.

  • birdy now uses Python 3.12.

  • Replaces all conda calls with micromamba ones.

    • Installs mamba as a requirement for gator only
  • Simplifies the two-stage micromamba create for initializing the birdy environment.

  • Migrates system installation of the following libraries to the environment.yml file:

    • firefox (no longer using firefox-esr)
    • git
    • mercurial
    • patch
    • unzip
  • Updates jupyterlab from v3.x to v4.x (current)

  • Removes the jupyter lab calls for installing/building extensions in Dockerfile.

  • Adds three new jupyterlab extensions:

    • jupyterlab-geojson (geojson file visualizer)

    • jupyterlab-logout (dedicated logout button in top-right) and jupyterlab-theme-toggler (dedicated light/dark theme toggle in top-right):

      • image (7)
  • Jupyter env changes:

    • Change 1
      • Related PR URL
    • Change 2
      • Related PR URL
    • Relevant changes (alphabetical order):
<   - somelib=0.8.1=pyh6c4a22f_1
>   - somelib=0.8.4=pyh1a96a4e_0

(...)

Testing Checklist

Related Issue / Discussion

  • Matching notebook fixes:

    • pavics-sdi: PR URL
    • finch: PR URL
    • PAVICS-landing: PR URL
    • RavenPy: PR URL
    • (...)
  • Deployment to PAVICS: PR URL

  • Jenkins-config changes for new notebooks: PR URL

  • Other issues found while working on this one

    • Issue 1 URL
    • Issue 2 URL
    • (...)
  • Previous release: PR URL

Additional Information

Full diff of the conda env export:
https://github.com/Ouranosinc/PAVICS-e2e-workflow-tests/compare/PREVIOUS-release-py###-######...NEW-release-py###-######

Full new conda env export:
https://github.com/Ouranosinc/PAVICS-e2e-workflow-tests/blob/NEW-release-py###-######/docker/saved_buildout/conda-env-export.yml

DockerHub build log:
https://github.com/Ouranosinc/PAVICS-e2e-workflow-tests/blob/NEW-release-py###-######/docker/saved_buildout/docker-buildlogs.txt

…otlib and pymetalink higher, pin proj<=9.7.1, unpin intake-xarray and jupyter-archive, add vcs tools

Signed-off-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com>
Signed-off-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com>
…mamba

Signed-off-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com>
Signed-off-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com>
@Zeitsperre Zeitsperre self-assigned this Mar 17, 2026
Signed-off-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com>
Signed-off-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com>
Signed-off-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com>
Signed-off-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com>
@Zeitsperre
Copy link
Copy Markdown
Collaborator Author

I'm currently being held up by a weird error in the latest gator: mamba-org/gator#398

Signed-off-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com>
… frameworks, update jupyterlab extensions

Signed-off-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com>
Signed-off-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com>
Signed-off-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com>
@Zeitsperre Zeitsperre marked this pull request as ready for review March 19, 2026 20:54
@Zeitsperre
Copy link
Copy Markdown
Collaborator Author

Note: For the final release, the tag should be py312!

@Zeitsperre
Copy link
Copy Markdown
Collaborator Author

FYI @tlvu

This PR has become a total rewrite; Full details of my approach will follow. I've removed a lot of brittle workarounds and need to speak to you about design and what can/should be broken. Building the image is not only now faster, but also a lot cleaner.

Copy link
Copy Markdown
Collaborator

@tlvu tlvu left a comment

Choose a reason for hiding this comment

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

First pass review, clean up looks good.

Comment thread docker/Dockerfile
Comment thread docker/Dockerfile
Comment thread docker/Dockerfile
Comment thread docker/Dockerfile
Comment thread docker/Dockerfile
Comment thread docker/Dockerfile Outdated
Comment thread docker/Dockerfile
Comment thread docker/environment-base.yml Outdated
Comment thread docker/environment.yml
Comment thread launchcontainer
…ck, activate birdy environment

Signed-off-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com>
Comment thread docker/Dockerfile Outdated
Signed-off-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com>
Signed-off-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com>
…ult repo for users who use conda (already set for mamba and micromamba)

Signed-off-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com>
Signed-off-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com>
Signed-off-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com>
Signed-off-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com>
@tlvu
Copy link
Copy Markdown
Collaborator

tlvu commented Mar 24, 2026

Do not force push, this breaks all tags that point to older commit hash.

Comment thread docker/Dockerfile
ENV DEBIAN_FRONTEND=noninteractive

# Install conda and mamba in base for mamba_gator
RUN micromamba install --yes --name base "conda>=4.7.12" "mamba>=2.0" && \
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We have to install conda and mamba? Isn't micromamba a replacement for both of them?

I only have micromamba installed on my machine and I can do everything, just have to remember to type micromamba instead of conda or mamba.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

If mamba and conda aren't present, I find that mamba-gator doesn't recognize the base kernel properly. I can try removing it though.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Removing mamba and conda from base. Package resolution is really slow (~3 mins vs 20 seconds):
image
The birdy environment is also no longer listed.

...
[I 2026-03-25 13:37:56.188 ServerApp.mamba_gator] No available packages list in cache.
[I 2026-03-25 13:37:56.342 LabApp] Build is up to date
[I 2026-03-25 13:38:35.283 ServerApp.mamba_gator] No available packages list in cache.
...

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Adding conda and mamba back in:
image

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Oh weird ! So then it was more or less useless to use micromamba as base image ! We could have used the mamba base image instead !

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

For future reference, we can drop conda according to the docs of mamba_gator. This should be done once we come back to redoing the base image.

Comment thread docker/Dockerfile
ARG MAMBA_DOCKERFILE_ACTIVATE=1

# Set birdy as the default kernel
RUN echo "c.MultiKernelManager.default_kernel_name = 'birdy'" >> /etc/jupyter/jupyter_server_config.py
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This do not work, remove or comment out to not give false idea.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Are you sure? I am seeing a difference when it comes to the kernel order.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Removing this line:
image
Default kernel when opening a notebook is ipykernel.

Adding it back in:
image
Default kernel is now birdy.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Oh, I though, via our discussions, that this kernel setting is to activate the kernel by default. So this is only to change the display ordering of the kernel?

Can you update the comment to clarify it is for default kernel in the selection list display ordering, not for automated activation?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This sets the default ipython kernel in Jupyterlab environment, not the same as activating the birdy environment; These are two different things! I think the comment is clear enough.

Comment thread docker/environment.yml
- mercurial
# openssh
# https://anaconda.org/channels/conda-forge/packages/openssh/overview
- openssh
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

openssh ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I installed it for git+ssh support, but I realize now that when people use jupyterlab-git, they aren't necessarily pushing changes back to GitHub.

Do you think users might want to do that though? Would require them pushing ssh credentials into their writeable workspace.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Oh I though (never tried) user could already push using the jupyterlab-git plugin !

You are adding openssh to support git push on the cli? Or because git push using jupyterlab-git plugin do not work?

I think supporting the git cli is a good idea.

@Zeitsperre
Copy link
Copy Markdown
Collaborator Author

Do not force push, this breaks all tags that point to older commit hash.

I don't force push to remove any commits when a tag is involved. Commits with a wip/test and no tag afterward are safe (in my mind) to be destroyed. This is why we do things in branches.

…nment activation

Signed-off-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com>
@tlvu
Copy link
Copy Markdown
Collaborator

tlvu commented Mar 25, 2026

Do not force push, this breaks all tags that point to older commit hash.

I don't force push to remove any commits when a tag is involved. Commits with a wip/test and no tag afterward are safe (in my mind) to be destroyed. This is why we do things in branches.

The compare link on github did not show what commits are affected, just the change between the force push.

I was simply reminding you the danger of force push. Agreed that force push that only affect commits after the last tag is safe.

However, in the heat of action, it is easy to forget when is the last tag so best to not use force push at all on a big PR with multiple existing tags. In a small PR, without existing tags, it is OK because the risk of error is much smaller.

…he conda installed in opt/conda

Signed-off-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com>
@Zeitsperre
Copy link
Copy Markdown
Collaborator Author

Zeitsperre commented Mar 26, 2026

Update 2026-03-25: This new base image exposes a few major issues with the spawn commands of our Jupyterhub instance. Once #161 is merged and deployed as the new stable, we should come right back to this.

Problems to resolve:

  • The continuumio/minconda3 needs to be replaced with something that uses explicitly conda-forge (mambaorg/micromamba probably).
  • The spawn commands for our Jupyterhub instance need to be tracked down and examined to figure out why the docker run arguments aren't working as expected.
  • We can probably stand to remove a few dependencies for tools/utilities that aren't required.

It might be worthwhile to reach out to the https://github.com/bird-house/birdhouse-deploy maintainers to see if we can find a solution to some of these problems.

Base automatically changed from add-build-tools to master April 15, 2026 17:14
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.

2 participants