base-notebook: stop installing nodejs from conda-forge (#2172)

* base-notebook: stop installing nodejs from conda-forge

nodejs was a conda dependency of jupyterhub, but by installing
jupyterhub-base we no longer need it and could opt to remove it.

By doing this, building base-notebook led to a reported size reduction
from 974MB to 828MB, which is a 146MB / 15% size reduction.

* Update CHANGELOG.md

* Update CHANGELOG.md

* Install jupyterhub-singleuser instead of jupyterhub-base

Note that jupyterhub-base is really whats the foundational need for this
image, where jupyterhub-singleuser the conda-forge package is building on
jupyterhub-base by also adding a depdendency on jupyterlab - but the
jupyterhub-singleuser command is provided by jupyterhub-base conda-forge
package.

* Update CHANGELOG.md

Co-authored-by: Ayaz Salikhov <mathbunnyru@users.noreply.github.com>

---------

Co-authored-by: Ayaz Salikhov <mathbunnyru@users.noreply.github.com>
This commit is contained in:
Erik Sundell
2024-11-08 16:15:07 +01:00
committed by GitHub
parent 2c7e64abbb
commit caf725210c
6 changed files with 12 additions and 23 deletions

View File

@@ -3,6 +3,14 @@
This changelog only contains breaking and/or significant changes manually introduced to this repository (using Pull Requests). This changelog only contains breaking and/or significant changes manually introduced to this repository (using Pull Requests).
All image manifests can be found in [the wiki](https://github.com/jupyter/docker-stacks/wiki). All image manifests can be found in [the wiki](https://github.com/jupyter/docker-stacks/wiki).
## 2024-11-08
Affected: all images except `docker-stacks-foundation`.
- **Breaking:** `base-notebook`: stop installing `nodejs` from `conda-forge` ([#2172](https://github.com/jupyter/docker-stacks/pull/2172)).
Reason: It isn't a direct dependency on anything in the images any more, and increased the image size with ~150MB.
## 2024-11-06 ## 2024-11-06
Affected: all images except `docker-stacks-foundation`. Affected: all images except `docker-stacks-foundation`.

View File

@@ -1,6 +1,6 @@
FROM quay.io/jupyter/base-notebook FROM quay.io/jupyter/base-notebook
RUN mamba install --yes 'jupyterhub-base==4.0.1' && \ RUN mamba install --yes 'jupyterhub-singleuser==4.0.1' && \
mamba clean --all -f -y && \ mamba clean --all -f -y && \
fix-permissions "${CONDA_DIR}" && \ fix-permissions "${CONDA_DIR}" && \
fix-permissions "/home/${NB_USER}" fix-permissions "/home/${NB_USER}"

View File

@@ -54,9 +54,7 @@ It contains:
- Everything in `jupyter/docker-stacks-foundation` - Everything in `jupyter/docker-stacks-foundation`
- Minimally functional Server (e.g., no LaTeX support for saving notebooks as PDFs) - Minimally functional Server (e.g., no LaTeX support for saving notebooks as PDFs)
- `notebook`, `jupyterhub-base`, and `jupyterlab` packages - `notebook`, `jupyterhub-singleuser`, and `jupyterlab` packages
Note: we're also installing `nodejs` as it has historically been installed indirectly as a dependency of `jupyterhub` package, which was used before.
See more at: <https://github.com/jupyter/docker-stacks/pull/2171>
- A `start-notebook.py` script as the default command - A `start-notebook.py` script as the default command
- A `start-singleuser.py` script useful for launching containers in JupyterHub - A `start-singleuser.py` script useful for launching containers in JupyterHub
- Options for a self-signed HTTPS certificate - Options for a self-signed HTTPS certificate

View File

@@ -39,15 +39,9 @@ USER ${NB_UID}
# files across image layers when the permissions change # files across image layers when the permissions change
WORKDIR /tmp WORKDIR /tmp
RUN mamba install --yes \ RUN mamba install --yes \
'jupyterhub-base' \ 'jupyterhub-singleuser' \
'jupyterlab' \ 'jupyterlab' \
'nbclassic' \ 'nbclassic' \
# nodejs has historically been installed indirectly as a dependency.
# When it was no longer getting installed indirectly,
# we started installing it explicitly to avoid introducing a breaking change
# for users building on top of these images.
# See: https://github.com/jupyter/docker-stacks/pull/2171
'nodejs' \
# Sometimes, when the new version of `jupyterlab` is released, latest `notebook` might not support it for some time # Sometimes, when the new version of `jupyterlab` is released, latest `notebook` might not support it for some time
# Old versions of `notebook` (<v7) didn't have a restriction on the `jupyterlab` version, and old `notebook` is getting installed # Old versions of `notebook` (<v7) didn't have a restriction on the `jupyterlab` version, and old `notebook` is getting installed
# That's why we have to pin the minimum notebook version # That's why we have to pin the minimum notebook version
@@ -55,7 +49,6 @@ RUN mamba install --yes \
'notebook>=7.2.2' && \ 'notebook>=7.2.2' && \
jupyter server --generate-config && \ jupyter server --generate-config && \
mamba clean --all -f -y && \ mamba clean --all -f -y && \
npm cache clean --force && \
jupyter lab clean && \ jupyter lab clean && \
rm -rf "/home/${NB_USER}/.cache/yarn" && \ rm -rf "/home/${NB_USER}/.cache/yarn" && \
fix-permissions "${CONDA_DIR}" && \ fix-permissions "${CONDA_DIR}" && \

View File

@@ -1,9 +0,0 @@
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
from tests.conftest import TrackedContainer
from tests.run_command import run_command
def test_npm_package_manager(container: TrackedContainer) -> None:
"""Test that npm is installed and runs."""
run_command(container, "npm --version")

View File

@@ -74,10 +74,9 @@ EXCLUDED_PACKAGES = [
"grpcio-status", "grpcio-status",
"grpcio", "grpcio",
"hdf5", "hdf5",
"jupyterhub-base", "jupyterhub-singleuser",
"jupyterlab-git", "jupyterlab-git",
"mamba[version='<2.0.0']", "mamba[version='<2.0.0']",
"nodejs",
"notebook[version='>", "notebook[version='>",
"openssl", "openssl",
"pandas[version='>", "pandas[version='>",