mirror of
https://github.com/jupyter/docker-stacks.git
synced 2025-10-10 11:32:57 +00:00
Mamba in base-notebook
This commit is contained in:
@@ -26,24 +26,24 @@ USER root
|
|||||||
# Conda version
|
# Conda version
|
||||||
ARG conda_version="4.9.2"
|
ARG conda_version="4.9.2"
|
||||||
# Miniforge installer patch version
|
# Miniforge installer patch version
|
||||||
ARG miniforge_patch_number="5"
|
ARG miniforge_patch_number="7"
|
||||||
# Miniforge installer architecture
|
# Miniforge installer architecture
|
||||||
ARG miniforge_arch="x86_64"
|
ARG miniforge_arch="x86_64"
|
||||||
# Python implementation to use
|
# Python implementation to use
|
||||||
# can be either Miniforge3 to use Python or Miniforge-pypy3 to use PyPy
|
# can be either Miniforge3 to use Python or Miniforge-pypy3 to use PyPy
|
||||||
ARG miniforge_python="Miniforge3"
|
ARG miniforge_python="Mambaforge"
|
||||||
|
|
||||||
# Miniforge archive to install
|
# Miniforge archive to install
|
||||||
ARG miniforge_version="${conda_version}-${miniforge_patch_number}"
|
ARG miniforge_version="${conda_version}-${miniforge_patch_number}"
|
||||||
# Miniforge installer
|
# Miniforge installer
|
||||||
ARG miniforge_installer="${miniforge_python}-${miniforge_version}-Linux-${miniforge_arch}.sh"
|
ARG miniforge_installer="${miniforge_python}-${miniforge_version}-Linux-${miniforge_arch}.sh"
|
||||||
# Miniforge checksum
|
# Miniforge checksum
|
||||||
ARG miniforge_checksum="49dddb3998550e40adc904dae55b0a2aeeb0bd9fc4306869cc4a600ec4b8b47c"
|
ARG miniforge_checksum="5a827a62d98ba2217796a9dc7673380257ed7c161017565fba8ce785fb21a599"
|
||||||
|
|
||||||
# Install all OS dependencies for notebook server that starts but lacks all
|
# Install all OS dependencies for notebook server that starts but lacks all
|
||||||
# features (e.g., download as all possible file formats)
|
# features (e.g., download as all possible file formats)
|
||||||
ENV DEBIAN_FRONTEND noninteractive
|
ENV DEBIAN_FRONTEND noninteractive
|
||||||
RUN apt-get update \
|
RUN apt-get -q update \
|
||||||
&& apt-get install -yq --no-install-recommends \
|
&& apt-get install -yq --no-install-recommends \
|
||||||
wget \
|
wget \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
@@ -102,7 +102,7 @@ RUN mkdir "/home/$NB_USER/work" && \
|
|||||||
# Install conda as jovyan and check the sha256 sum provided on the download site
|
# Install conda as jovyan and check the sha256 sum provided on the download site
|
||||||
WORKDIR /tmp
|
WORKDIR /tmp
|
||||||
|
|
||||||
# Prerequisites installation: conda, pip, tini
|
# Prerequisites installation: conda, mamba, pip, tini
|
||||||
RUN wget --quiet "https://github.com/conda-forge/miniforge/releases/download/${miniforge_version}/${miniforge_installer}" && \
|
RUN wget --quiet "https://github.com/conda-forge/miniforge/releases/download/${miniforge_version}/${miniforge_installer}" && \
|
||||||
echo "${miniforge_checksum} *${miniforge_installer}" | sha256sum --check && \
|
echo "${miniforge_checksum} *${miniforge_installer}" | sha256sum --check && \
|
||||||
/bin/bash "${miniforge_installer}" -f -b -p $CONDA_DIR && \
|
/bin/bash "${miniforge_installer}" -f -b -p $CONDA_DIR && \
|
||||||
|
24
base-notebook/test/test_package_managers.py
Normal file
24
base-notebook/test/test_package_managers.py
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
# Copyright (c) Jupyter Development Team.
|
||||||
|
# Distributed under the terms of the Modified BSD License.
|
||||||
|
|
||||||
|
import logging
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize(
|
||||||
|
"package_manager, cmd", [("apt", "--version"), ("conda", "--version"), ("mamba", "--version"), ("npm", "--version")]
|
||||||
|
)
|
||||||
|
def test_package_manager(container, package_manager, cmd):
|
||||||
|
"""Test the notebook start-notebook script"""
|
||||||
|
LOGGER.info(
|
||||||
|
f"Test that the package manager {package_manager} is working properly ..."
|
||||||
|
)
|
||||||
|
c = container.run(
|
||||||
|
tty=True, command=["start.sh", "bash", "-c", f"{package_manager} {cmd}"]
|
||||||
|
)
|
||||||
|
rv = c.wait(timeout=5)
|
||||||
|
logs = c.logs(stdout=True).decode("utf-8")
|
||||||
|
assert rv == 0 or rv["StatusCode"] == 0, f"Package manager {package_manager} not working"
|
||||||
|
LOGGER.debug(logs)
|
@@ -105,12 +105,13 @@ You can bypass the provided scripts and specify an arbitrary start command. If y
|
|||||||
|
|
||||||
The default Python 3.x [Conda environment](http://conda.pydata.org/docs/using/envs.html) resides in `/opt/conda`. The `/opt/conda/bin` directory is part of the default `jovyan` user's `$PATH`. That directory is also whitelisted for use in `sudo` commands by the `start.sh` script.
|
The default Python 3.x [Conda environment](http://conda.pydata.org/docs/using/envs.html) resides in `/opt/conda`. The `/opt/conda/bin` directory is part of the default `jovyan` user's `$PATH`. That directory is also whitelisted for use in `sudo` commands by the `start.sh` script.
|
||||||
|
|
||||||
The `jovyan` user has full read/write access to the `/opt/conda` directory. You can use either `conda` or `pip` to install new packages without any additional permissions.
|
The `jovyan` user has full read/write access to the `/opt/conda` directory. You can use either `conda`, `mamba` or `pip` to install new packages without any additional permissions.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# install a package into the default (python 3.x) environment
|
# install a package into the default (python 3.x) environment
|
||||||
pip install some-package
|
pip install some-package
|
||||||
conda install some-package
|
conda install some-package
|
||||||
|
mamba install some-package
|
||||||
```
|
```
|
||||||
|
|
||||||
### Using alternative channels
|
### Using alternative channels
|
||||||
|
@@ -28,7 +28,9 @@ and versioning strategy.
|
|||||||
[options common across all core stacks](common.md). It is the basis for all other stacks.
|
[options common across all core stacks](common.md). It is the basis for all other stacks.
|
||||||
|
|
||||||
- Minimally-functional Jupyter Notebook server (e.g., no LaTeX support for saving notebooks as PDFs)
|
- Minimally-functional Jupyter Notebook server (e.g., no LaTeX support for saving notebooks as PDFs)
|
||||||
- [Miniforge](https://github.com/conda-forge/miniforge) Python 3.x in `/opt/conda`
|
- [Miniforge](https://github.com/conda-forge/miniforge) Python 3.x in `/opt/conda` with two package managers
|
||||||
|
- [conda](https://github.com/conda/conda): "cross-platform, language-agnostic binary package manager".
|
||||||
|
- [mamba](https://github.com/mamba-org/mamba): "reimplementation of the conda package manager in C++".
|
||||||
- No preinstalled scientific computing packages
|
- No preinstalled scientific computing packages
|
||||||
- Unprivileged user `jovyan` (`uid=1000`, configurable, see options) in group `users` (`gid=100`)
|
- Unprivileged user `jovyan` (`uid=1000`, configurable, see options) in group `users` (`gid=100`)
|
||||||
with ownership over the `/home/jovyan` and `/opt/conda` paths
|
with ownership over the `/home/jovyan` and `/opt/conda` paths
|
||||||
|
Reference in New Issue
Block a user