Minor improvements

This commit is contained in:
Ayaz Salikhov
2023-11-21 13:17:33 +01:00
parent d53e39763d
commit 0a75e3d3a6
14 changed files with 24 additions and 24 deletions

View File

@@ -150,7 +150,7 @@ repos:
hooks: hooks:
- id: blacken-docs - id: blacken-docs
# --skip-errors is added to allow us to have python syntax highlighting even if # --skip-errors is added to allow us to have python syntax highlighting even if
# the python code blocks includes jupyter specific additions such as % or ! # the python code blocks include jupyter-specific additions such as % or !
# See https://github.com/adamchainz/blacken-docs/issues/127 for an upstream # See https://github.com/adamchainz/blacken-docs/issues/127 for an upstream
# feature request about this. # feature request about this.
args: [--target-version=py39, --skip-errors] args: [--target-version=py39, --skip-errors]

View File

@@ -5,6 +5,6 @@ for information about how to contribute
[features](https://jupyter-docker-stacks.readthedocs.io/en/latest/contributing/features.html), [features](https://jupyter-docker-stacks.readthedocs.io/en/latest/contributing/features.html),
[recipes](https://jupyter-docker-stacks.readthedocs.io/en/latest/contributing/recipes.html), [recipes](https://jupyter-docker-stacks.readthedocs.io/en/latest/contributing/recipes.html),
[tests](https://jupyter-docker-stacks.readthedocs.io/en/latest/contributing/tests.html), [tests](https://jupyter-docker-stacks.readthedocs.io/en/latest/contributing/tests.html),
[community-maintained stacks](https://jupyter-docker-stacks.readthedocs.io/en/latest/contributing/stacks.html). and [community-maintained stacks](https://jupyter-docker-stacks.readthedocs.io/en/latest/contributing/stacks.html).
<!-- markdownlint-disable-file MD041 --> <!-- markdownlint-disable-file MD041 -->

View File

@@ -48,7 +48,7 @@ It contains:
[Dockerfile commit history](https://github.com/jupyter/docker-stacks/commits/main/images/base-notebook/Dockerfile) | [Dockerfile commit history](https://github.com/jupyter/docker-stacks/commits/main/images/base-notebook/Dockerfile) |
[Quay.io image tags](https://quay.io/repository/jupyter/base-notebook?tab=tags) [Quay.io image tags](https://quay.io/repository/jupyter/base-notebook?tab=tags)
`jupyter/base-notebook` adds base Jupyter Applications like JupyterLab, Jupyter Notebook, JupyterHub and NBClassic `jupyter/base-notebook` adds base Jupyter Applications like JupyterLab, Jupyter Notebook, JupyterHub, and NBClassic
and serves as the basis for all other stacks besides `jupyter/docker-stacks-foundation`. and serves as the basis for all other stacks besides `jupyter/docker-stacks-foundation`.
It contains: It contains:
@@ -83,7 +83,7 @@ It contains:
[git](https://git-scm.com/), [git](https://git-scm.com/),
[nano](https://www.nano-editor.org/) (actually `nano-tiny`), [nano](https://www.nano-editor.org/) (actually `nano-tiny`),
[tzdata](https://www.iana.org/time-zones), [tzdata](https://www.iana.org/time-zones),
[unzip](https://code.launchpad.net/ubuntu/+source/unzip) [unzip](https://code.launchpad.net/ubuntu/+source/unzip),
and [vi](https://www.vim.org) (actually `vim-tiny`), and [vi](https://www.vim.org) (actually `vim-tiny`),
- [TeX Live](https://www.tug.org/texlive/) for notebook document conversion - [TeX Live](https://www.tug.org/texlive/) for notebook document conversion
@@ -193,7 +193,7 @@ It contains:
[Dockerfile commit history](https://github.com/jupyter/docker-stacks/commits/main/images/datascience-notebook/Dockerfile) | [Dockerfile commit history](https://github.com/jupyter/docker-stacks/commits/main/images/datascience-notebook/Dockerfile) |
[Quay.io image tags](https://quay.io/repository/jupyter/datascience-notebook?tab=tags) [Quay.io image tags](https://quay.io/repository/jupyter/datascience-notebook?tab=tags)
`jupyter/datascience-notebook` includes libraries for data analysis from the Python, and R, and Julia communities. `jupyter/datascience-notebook` includes libraries for data analysis from the Python, R, and Julia communities.
- Everything in the `jupyter/scipy-notebook`, `jupyter/r-notebook`, and `jupyter/julia-notebook` images and their ancestor - Everything in the `jupyter/scipy-notebook`, `jupyter/r-notebook`, and `jupyter/julia-notebook` images and their ancestor
images images
@@ -244,7 +244,7 @@ Every Monday and whenever a pull request is merged, images are rebuilt and pushe
Whenever a docker image is pushed to the container registry, it is tagged with: Whenever a docker image is pushed to the container registry, it is tagged with:
- a `latest` tag - the `latest` tag
- a 12-character git commit SHA like `1ffe43816ba9` - a 12-character git commit SHA like `1ffe43816ba9`
- a date formatted like `2023-01-30` - a date formatted like `2023-01-30`
- OS version like `ubuntu-22.04` - OS version like `ubuntu-22.04`

View File

@@ -76,7 +76,7 @@ RUN echo "auth requisite pam_deny.so" >> /etc/pam.d/su && \
USER ${NB_UID} USER ${NB_UID}
# Pin Python version here, or set it to "default" # Pin the Python version here, or set it to "default"
ARG PYTHON_VERSION=3.11 ARG PYTHON_VERSION=3.11
# Setup work directory for backward-compatibility # Setup work directory for backward-compatibility

View File

@@ -4,9 +4,9 @@
set -e set -e
# The _log function is used for everything this script wants to log. It will # The _log function is used for everything this script wants to log.
# always log errors and warnings, but can be silenced for other messages # It will always log errors and warnings but can be silenced for other messages
# by setting JUPYTER_DOCKER_STACKS_QUIET environment variable. # by setting the JUPYTER_DOCKER_STACKS_QUIET environment variable.
_log () { _log () {
if [[ "$*" == "ERROR:"* ]] || [[ "$*" == "WARNING:"* ]] || [[ "${JUPYTER_DOCKER_STACKS_QUIET}" == "" ]]; then if [[ "$*" == "ERROR:"* ]] || [[ "$*" == "WARNING:"* ]] || [[ "${JUPYTER_DOCKER_STACKS_QUIET}" == "" ]]; then
echo "$@" echo "$@"
@@ -62,7 +62,7 @@ if [ "$(id -u)" == 0 ]; then
_log "- home dir: /home/jovyan -> /home/${NB_USER}" _log "- home dir: /home/jovyan -> /home/${NB_USER}"
fi fi
elif ! id -u "${NB_USER}" &> /dev/null; then elif ! id -u "${NB_USER}" &> /dev/null; then
_log "ERROR: Neither the jovyan user or '${NB_USER}' exists. This could be the result of stopping and starting, the container with a different NB_USER environment variable." _log "ERROR: Neither the jovyan user nor '${NB_USER}' exists. This could be the result of stopping and starting, the container with a different NB_USER environment variable."
exit 1 exit 1
fi fi
# Ensure the desired user (NB_USER) gets its desired user id (NB_UID) and is # Ensure the desired user (NB_USER) gets its desired user id (NB_UID) and is

View File

@@ -15,8 +15,8 @@ For example, we dump all the `conda` packages, including their versions.
- All the images are located in a hierarchical tree. - All the images are located in a hierarchical tree.
More info on [image relationships](../docs/using/selecting.md#image-relationships). More info on [image relationships](../docs/using/selecting.md#image-relationships).
- We have `tagger` and `manifest` classes, which can be run inside docker containers to obtain tags and build manifest pieces. - We have `tagger` and `manifest` classes, which can be run inside docker containers to obtain tags and build manifest pieces.
- These classes are inherited from the parent image to all the children images. - These classes are inherited from the parent image to all the child images.
- Because manifests and tags might change from parent to children, `taggers` and `manifests` are reevaluated on each image. - Because manifests and tags might change from parent to child, `taggers` and `manifests` are reevaluated on each image.
So, the values are not inherited. So, the values are not inherited.
- To tag an image and create a manifest, run `make hook/base-notebook` (or another image of your choice). - To tag an image and create a manifest, run `make hook/base-notebook` (or another image of your choice).

View File

@@ -42,7 +42,7 @@ if __name__ == "__main__":
arg_parser.add_argument( arg_parser.add_argument(
"--short-image-name", "--short-image-name",
required=True, required=True,
help="Short image name to apply tags for", help="Short image name",
) )
arg_parser.add_argument( arg_parser.add_argument(
"--tags-dir", "--tags-dir",

View File

@@ -59,7 +59,7 @@ if __name__ == "__main__":
arg_parser.add_argument( arg_parser.add_argument(
"--short-image-name", "--short-image-name",
required=True, required=True,
help="Short image name to apply tags for", help="Short image name",
) )
arg_parser.add_argument( arg_parser.add_argument(
"--tags-dir", "--tags-dir",

View File

@@ -111,7 +111,7 @@ if __name__ == "__main__":
arg_parser.add_argument( arg_parser.add_argument(
"--short-image-name", "--short-image-name",
required=True, required=True,
help="Short image name to create manifests for", help="Short image name",
) )
arg_parser.add_argument( arg_parser.add_argument(
"--hist-lines-dir", "--hist-lines-dir",

View File

@@ -50,7 +50,7 @@ if __name__ == "__main__":
arg_parser.add_argument( arg_parser.add_argument(
"--short-image-name", "--short-image-name",
required=True, required=True,
help="Short image name to write tags for", help="Short image name",
) )
arg_parser.add_argument( arg_parser.add_argument(
"--tags-dir", "--tags-dir",

View File

@@ -10,11 +10,11 @@ LOGGER = logging.getLogger(__name__)
def check_r_mimetypes(container: TrackedContainer) -> None: def check_r_mimetypes(container: TrackedContainer) -> None:
"""Check if Rscript command can be executed""" """Check if Rscript command can be executed"""
LOGGER.info("Test that R command can be executed ...") LOGGER.info("Test that R command can be executed ...")
Rcommand = 'if (length(getOption("jupyter.plot_mimetypes")) != 5) {stop("missing jupyter.plot_mimetypes")}' R_MIMETYPES_CHECK_CMD = 'if (length(getOption("jupyter.plot_mimetypes")) != 5) {stop("missing jupyter.plot_mimetypes")}'
logs = container.run_and_wait( logs = container.run_and_wait(
timeout=10, timeout=10,
tty=True, tty=True,
command=["Rscript", "-e", Rcommand], command=["Rscript", "-e", R_MIMETYPES_CHECK_CMD],
) )
LOGGER.debug(f"{logs=}") LOGGER.debug(f"{logs=}")
assert len(logs) == 0, f"Command {Rcommand=} failed" assert len(logs) == 0, f"Command {R_MIMETYPES_CHECK_CMD=} failed"

View File

@@ -78,8 +78,8 @@ class TrackedContainer:
self.kwargs: Any = kwargs self.kwargs: Any = kwargs
def run_detached(self, **kwargs: Any) -> Container: def run_detached(self, **kwargs: Any) -> Container:
"""Runs a docker container using the preconfigured image name """Runs a docker container using the pre-configured image name
and a mix of the preconfigured container options and those passed and a mix of the pre-configured container options and those passed
to this method. to this method.
Keeps track of the docker.Container instance spawned to kill it Keeps track of the docker.Container instance spawned to kill it

View File

@@ -4,7 +4,7 @@
""" """
test_packages test_packages
~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~
This test module tests if R and Python packages installed can be imported. This test module tests if the R and Python packages installed can be imported.
It's a basic test aiming to prove that the package is working properly. It's a basic test aiming to prove that the package is working properly.
The goal is to detect import errors that can be caused by incompatibilities between packages, for example: The goal is to detect import errors that can be caused by incompatibilities between packages, for example:

View File

@@ -39,7 +39,7 @@ if __name__ == "__main__":
arg_parser.add_argument( arg_parser.add_argument(
"--short-image-name", "--short-image-name",
required=True, required=True,
help="Short image name to run test on", help="Short image name",
) )
arg_parser.add_argument( arg_parser.add_argument(
"--registry", "--registry",