Merge branch 'jupyter:master' into fix-volumes-deleted-when-entering-container

This commit is contained in:
Jon Velando
2021-08-20 10:37:41 -04:00
committed by GitHub
16 changed files with 475 additions and 419 deletions

View File

@@ -1,6 +1,9 @@
name: Build, test, and publish Docker Images name: Build, test, and publish Docker Images
on: on:
schedule:
# Weekly, at 03:00 on Monday UTC time
- cron: "0 3 * * 1"
pull_request: pull_request:
paths-ignore: paths-ignore:
- ".github/ISSUE_TEMPLATE/**" - ".github/ISSUE_TEMPLATE/**"
@@ -78,19 +81,19 @@ jobs:
run: make -C main hook-all run: make -C main hook-all
- name: Push Wiki to GitHub - name: Push Wiki to GitHub
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.event_name == 'schedule'
uses: stefanzweifel/git-auto-commit-action@5dd17c3b53a58c1cb5eaab903826abe94765ccd6 # dependabot updates to latest release uses: stefanzweifel/git-auto-commit-action@5dd17c3b53a58c1cb5eaab903826abe94765ccd6 # dependabot updates to latest release
with: with:
commit_message: "[ci skip] Automated publish for ${{github.sha}}" commit_message: "[ci skip] Automated publish for ${{github.sha}}"
repository: wiki/ repository: wiki/
- name: Login to Docker Hub - name: Login to Docker Hub
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.event_name == 'schedule'
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 # dependabot updates to latest release uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 # dependabot updates to latest release
with: with:
username: ${{secrets.DOCKERHUB_USERNAME}} username: ${{secrets.DOCKERHUB_USERNAME}}
password: ${{secrets.DOCKERHUB_TOKEN}} password: ${{secrets.DOCKERHUB_TOKEN}}
- name: Push Images to DockerHub - name: Push Images to DockerHub
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.event_name == 'schedule'
run: make -C main push-all-multi run: make -C main push-all-multi

View File

@@ -24,7 +24,7 @@ repos:
# Lint: YAML # Lint: YAML
- repo: https://github.com/adrienverge/yamllint.git - repo: https://github.com/adrienverge/yamllint.git
rev: v1.26.1 rev: v1.26.2
hooks: hooks:
- id: yamllint - id: yamllint
args: ["-d {extends: relaxed, rules: {line-length: disable}}", "-s"] args: ["-d {extends: relaxed, rules: {line-length: disable}}", "-s"]

View File

@@ -100,7 +100,7 @@ build-all: $(foreach I, $(ALL_IMAGES), build/$(I)) ## build all stacks
build-multi/%: DARGS?= build-multi/%: DARGS?=
build-multi/%: ## build the latest image for a stack on both amd64 and arm64 build-multi/%: ## build the latest image for a stack on both amd64 and arm64
@echo "::group::Build $(OWNER)/$(notdir $@) (system's architecture)" @echo "::group::Build $(OWNER)/$(notdir $@) (system's architecture)"
docker buildx build $(DARGS) --rm --force-rm -t $(OWNER)/$(notdir $@):latest ./$(notdir $@) --build-arg OWNER=$(OWNER) docker buildx build $(DARGS) --rm --force-rm -t $(OWNER)/$(notdir $@):latest ./$(notdir $@) --build-arg OWNER=$(OWNER) --load
@echo -n "Built image size: " @echo -n "Built image size: "
@docker images $(OWNER)/$(notdir $@):latest --format "{{.Size}}" @docker images $(OWNER)/$(notdir $@):latest --format "{{.Size}}"
@echo "::endgroup::" @echo "::endgroup::"

View File

@@ -32,7 +32,7 @@ docker run -p 8888:8888 jupyter/scipy-notebook:33add21fab64
``` ```
**Example 2:** This command performs the same operations as **Example 1**, but it exposes the server on host port 10000 instead of port 8888. **Example 2:** This command performs the same operations as **Example 1**, but it exposes the server on host port 10000 instead of port 8888.
Visiting `http://<hostname>:10000/?token=<token>` in a browser loads JupyterLab, Visiting `http://<hostname>:10000/?token=<token>` in a browser loads Jupyter Notebook server,
where `hostname` is the name of the computer running docker and `token` is the secret token printed in the console. where `hostname` is the name of the computer running docker and `token` is the secret token printed in the console.
```bash ```bash

View File

@@ -24,17 +24,17 @@ USER ${NB_UID}
# R packages including IRKernel which gets installed globally. # R packages including IRKernel which gets installed globally.
RUN mamba install --quiet --yes \ RUN mamba install --quiet --yes \
'r-base=4.1.0' \ 'r-base' \
'r-ggplot2=3.3*' \ 'r-ggplot2' \
'r-irkernel=1.2*' \ 'r-irkernel' \
'r-rcurl=1.98*' \ 'r-rcurl' \
'r-sparklyr=1.7*' && \ 'r-sparklyr' && \
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}"
# Spylon-kernel # Spylon-kernel
RUN mamba install --quiet --yes 'spylon-kernel=0.4*' && \ RUN mamba install --quiet --yes 'spylon-kernel' && \
mamba clean --all -f -y && \ mamba clean --all -f -y && \
python -m spylon_kernel install --sys-prefix && \ python -m spylon_kernel install --sys-prefix && \
rm -rf "/home/${NB_USER}/.local" && \ rm -rf "/home/${NB_USER}/.local" && \

View File

@@ -3,7 +3,7 @@
# Ubuntu 20.04 (focal) # Ubuntu 20.04 (focal)
# https://hub.docker.com/_/ubuntu/?tab=tags&name=focal # https://hub.docker.com/_/ubuntu/?tab=tags&name=focal
ARG ROOT_CONTAINER=ubuntu:focal-20210609 ARG ROOT_CONTAINER=ubuntu:focal
FROM $ROOT_CONTAINER FROM $ROOT_CONTAINER
@@ -130,9 +130,9 @@ RUN set -x && \
# Do all this in a single RUN command to avoid duplicating all of the # Do all this in a single RUN command to avoid duplicating all of the
# files across image layers when the permissions change # files across image layers when the permissions change
RUN conda install --quiet --yes \ RUN conda install --quiet --yes \
'notebook=6.4.0' \ 'notebook' \
'jupyterhub=1.4.1' \ 'jupyterhub' \
'jupyterlab=3.0.16' && \ 'jupyterlab' && \
conda clean --all -f -y && \ conda clean --all -f -y && \
npm cache clean --force && \ npm cache clean --force && \
jupyter notebook --generate-config && \ jupyter notebook --generate-config && \

View File

@@ -55,26 +55,26 @@ USER ${NB_UID}
# R packages including IRKernel which gets installed globally. # R packages including IRKernel which gets installed globally.
RUN conda install --quiet --yes \ RUN conda install --quiet --yes \
'r-base=4.1.0' \ 'r-base' \
'r-caret=6.0*' \ 'r-caret' \
'r-crayon=1.4*' \ 'r-crayon' \
'r-devtools=2.4*' \ 'r-devtools' \
'r-forecast=8.15*' \ 'r-forecast' \
'r-hexbin=1.28*' \ 'r-hexbin' \
'r-htmltools=0.5*' \ 'r-htmltools' \
'r-htmlwidgets=1.5*' \ 'r-htmlwidgets' \
'r-irkernel=1.2*' \ 'r-irkernel' \
'r-nycflights13=1.0*' \ 'r-nycflights13' \
'r-randomforest=4.6*' \ 'r-randomforest' \
'r-rcurl=1.98*' \ 'r-rcurl' \
'r-rmarkdown=2.9*' \ 'r-rmarkdown' \
'r-rodbc=1.3*' \ 'r-rodbc' \
'r-rsqlite=2.2*' \ 'r-rsqlite' \
'r-shiny=1.6*' \ 'r-shiny' \
'r-tidymodels=0.1*' \ 'r-tidymodels' \
'r-tidyverse=1.3*' \ 'r-tidyverse' \
'rpy2=3.4*' \ 'rpy2' \
'unixodbc=2.3.*' && \ 'unixodbc' && \
conda clean --all -f -y && \ conda clean --all -f -y && \
fix-permissions "${CONDA_DIR}" && \ fix-permissions "${CONDA_DIR}" && \
fix-permissions "/home/${NB_USER}" fix-permissions "/home/${NB_USER}"

File diff suppressed because it is too large Load Diff

View File

@@ -193,23 +193,21 @@ diagram](../images/inherit.svg)](http://interactive.blockdiag.com/?compression=d
### Builds ### Builds
Pull requests to the `jupyter/docker-stacks` repository trigger builds of all images on GitHub Actions. Every Monday and whenever a pull requests is merged, images are rebuilt and pushed to the public container registry.
These images are for testing purposes only and are not saved for further use.
When pull requests merge to master, all images rebuild on Docker Hub and become available to `docker pull` from Docker Hub.
### Versioning ### Versioning via image tags
The `latest` tag in each Docker Hub repository tracks the master branch `HEAD` reference on GitHub. Whenever a docker image is pushed to the container registry, it is tagged with:
`latest` is a moving target, by definition, and will have backward-incompatible changes regularly.
Every image on Docker Hub also receives a 12-character tag which corresponds with the git commit SHA that triggered the image build. - a `latest` tag
You can inspect the state of the `jupyter/docker-stacks` repository for that commit to review the definition of the image - a 12-character git commit SHA like `b9f6ce795cfc`
(e.g., images with tag `33add21fab64` were built from <https://github.com/jupyter/docker-stacks/tree/33add21fab64>. - a date formatted like `2021-08-29`
- a set of software version tags like `python-3.9.6` and `lab-3.0.16`
You must refer to git-SHA image tags when stability and reproducibility are important in your work. For stability and reproducibility, you should either reference a date formatted
(e.g. `FROM jupyter/scipy-notebook:33add21fab64`, `docker run -it --rm jupyter/scipy-notebook:33add21fab64`). tag from a date before the current date (in UTC time) or a git commit SHA older
You should only use `latest` when a one-off container instance is acceptable than the latest git commit SHA in the default branch of the
(e.g., you want to briefly try a new library in a notebook). jupyter/docker-stacks GitHub repository.
## Community Stacks ## Community Stacks

View File

@@ -57,7 +57,7 @@ USER ${NB_UID}
# Install pyarrow # Install pyarrow
RUN mamba install --quiet --yes \ RUN mamba install --quiet --yes \
'pyarrow=4.0.*' && \ 'pyarrow' && \
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

@@ -1,5 +1,5 @@
[pytest] [pytest]
addopts = -ra addopts = -ra --color=yes
log_cli = 1 log_cli = 1
log_cli_level = INFO log_cli_level = INFO
log_cli_format = %(asctime)s [%(levelname)8s] %(message)s (%(filename)s:%(lineno)s) log_cli_format = %(asctime)s [%(levelname)8s] %(message)s (%(filename)s:%(lineno)s)

View File

@@ -26,31 +26,31 @@ USER ${NB_UID}
# R packages including IRKernel which gets installed globally. # R packages including IRKernel which gets installed globally.
RUN conda install --quiet --yes \ RUN conda install --quiet --yes \
'r-base=4.1.0' \ 'r-base' \
'r-caret=6.*' \ 'r-caret' \
'r-crayon=1.4*' \ 'r-crayon' \
'r-devtools=2.4*' \ 'r-devtools' \
'r-forecast=8.15*' \ 'r-forecast' \
'r-hexbin=1.28*' \ 'r-hexbin' \
'r-htmltools=0.5*' \ 'r-htmltools' \
'r-htmlwidgets=1.5*' \ 'r-htmlwidgets' \
'r-irkernel=1.2*' \ 'r-irkernel' \
'r-nycflights13=1.0*' \ 'r-nycflights13' \
'r-randomforest=4.6*' \ 'r-randomforest' \
'r-rcurl=1.98*' \ 'r-rcurl' \
'r-rmarkdown=2.9*' \ 'r-rmarkdown' \
'r-rodbc=1.3*' \ 'r-rodbc' \
'r-rsqlite=2.2*' \ 'r-rsqlite' \
'r-shiny=1.6*' \ 'r-shiny' \
'r-tidymodels=0.1*' \ 'r-tidymodels' \
'r-tidyverse=1.3*' \ 'r-tidyverse' \
'unixodbc=2.3.*' && \ 'unixodbc' && \
conda clean --all -f -y && \ conda clean --all -f -y && \
fix-permissions "${CONDA_DIR}" && \ fix-permissions "${CONDA_DIR}" && \
fix-permissions "/home/${NB_USER}" fix-permissions "/home/${NB_USER}"
# Install e1071 R package (dependency of the caret R package) # Install e1071 R package (dependency of the caret R package)
RUN conda install --quiet --yes r-e1071 && \ RUN conda install --quiet --yes 'r-e1071' && \
conda clean --all -f -y && \ conda clean --all -f -y && \
fix-permissions "${CONDA_DIR}" && \ fix-permissions "${CONDA_DIR}" && \
fix-permissions "/home/${NB_USER}" fix-permissions "/home/${NB_USER}"

View File

@@ -17,34 +17,34 @@ USER ${NB_UID}
# Install Python 3 packages # Install Python 3 packages
RUN conda install --quiet --yes \ RUN conda install --quiet --yes \
'altair=4.1.*' \ 'altair' \
'beautifulsoup4=4.9.*' \ 'beautifulsoup4' \
'bokeh=2.3.*' \ 'bokeh' \
'bottleneck=1.3.*' \ 'bottleneck' \
'cloudpickle=1.6.*' \ 'cloudpickle' \
'conda-forge::blas=*=openblas' \ 'conda-forge::blas=*=openblas' \
'cython=0.29.*' \ 'cython' \
'dask=2021.6.*' \ 'dask' \
'dill=0.3.*' \ 'dill' \
'h5py=3.3.*' \ 'h5py' \
'ipympl=0.7.*'\ 'ipympl'\
'ipywidgets=7.6.*' \ 'ipywidgets' \
'matplotlib-base=3.4.*' \ 'matplotlib-base' \
'numba=0.53.*' \ 'numba' \
'numexpr=2.7.*' \ 'numexpr' \
'pandas=1.3.*' \ 'pandas' \
'patsy=0.5.*' \ 'patsy' \
'protobuf=3.17.*' \ 'protobuf' \
'pytables=3.6.*' \ 'pytables' \
'scikit-image=0.18.*' \ 'scikit-image' \
'scikit-learn=0.24.*' \ 'scikit-learn' \
'scipy=1.7.*' \ 'scipy' \
'seaborn=0.11.*' \ 'seaborn' \
'sqlalchemy=1.4.*' \ 'sqlalchemy' \
'statsmodels=0.12.*' \ 'statsmodels' \
'sympy=1.8.*' \ 'sympy' \
'widgetsnbextension=3.5.*'\ 'widgetsnbextension'\
'xlrd=2.0.*' && \ 'xlrd' && \
conda clean --all -f -y && \ conda clean --all -f -y && \
fix-permissions "${CONDA_DIR}" && \ fix-permissions "${CONDA_DIR}" && \
fix-permissions "/home/${NB_USER}" fix-permissions "/home/${NB_USER}"

View File

@@ -5,6 +5,7 @@ from typing import Optional, List
from .taggers import ( from .taggers import (
TaggerInterface, TaggerInterface,
SHATagger, SHATagger,
DateTagger,
UbuntuVersionTagger, UbuntuVersionTagger,
PythonVersionTagger, PythonVersionTagger,
JupyterNotebookVersionTagger, JupyterNotebookVersionTagger,
@@ -39,6 +40,7 @@ ALL_IMAGES = {
parent_image=None, parent_image=None,
taggers=[ taggers=[
SHATagger, SHATagger,
DateTagger,
UbuntuVersionTagger, UbuntuVersionTagger,
PythonVersionTagger, PythonVersionTagger,
JupyterNotebookVersionTagger, JupyterNotebookVersionTagger,

View File

@@ -1,5 +1,6 @@
# Copyright (c) Jupyter Development Team. # Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License. # Distributed under the terms of the Modified BSD License.
from datetime import datetime
import logging import logging
from .git_helper import GitHelper from .git_helper import GitHelper
from .docker_runner import DockerRunner from .docker_runner import DockerRunner
@@ -50,6 +51,12 @@ class SHATagger(TaggerInterface):
return GitHelper.commit_hash_tag() return GitHelper.commit_hash_tag()
class DateTagger(TaggerInterface):
@staticmethod
def tag_value(container) -> str:
return datetime.utcnow().strftime("%Y-%m-%d")
class UbuntuVersionTagger(TaggerInterface): class UbuntuVersionTagger(TaggerInterface):
@staticmethod @staticmethod
def tag_value(container) -> str: def tag_value(container) -> str:

View File

@@ -8,7 +8,7 @@ LABEL maintainer="Jupyter Project <jupyter@googlegroups.com>"
# Install Tensorflow # Install Tensorflow
RUN mamba install --quiet --yes \ RUN mamba install --quiet --yes \
'tensorflow=2.4.1' && \ 'tensorflow' && \
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}"