From bcf5118cb72fbd42682d281bd17227bd9c47648a Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Fri, 18 Mar 2022 23:29:14 +0200 Subject: [PATCH 1/2] Fix minor PyCharm issues --- .pre-commit-config.yaml | 2 +- README.md | 8 +++--- all-spark-notebook/README.md | 2 +- base-notebook/README.md | 2 +- base-notebook/start.sh | 2 +- datascience-notebook/README.md | 2 +- docs/contributing/packages.md | 2 +- docs/using/recipes.md | 16 ++++++------ docs/using/troubleshooting.md | 26 ++++++++++--------- examples/docker-compose/README.md | 6 ++--- examples/docker-compose/bin/letsencrypt.sh | 4 +-- examples/docker-compose/bin/sl-dns.sh | 2 +- examples/make-deploy/README.md | 6 ++--- examples/openshift/README.md | 10 +++---- examples/source-to-image/README.md | 4 +-- minimal-notebook/README.md | 2 +- pyspark-notebook/README.md | 2 +- r-notebook/README.md | 2 +- scipy-notebook/README.md | 2 +- tagging/manifests.py | 2 +- tensorflow-notebook/README.md | 2 +- tests/base-notebook/test_container_options.py | 2 +- tests/base-notebook/test_packages.py | 2 +- 23 files changed, 56 insertions(+), 54 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7e7360a13a..13badf5fc9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -45,7 +45,7 @@ repos: # This doesn't work well with `mypy --follow-imports error` # See: https://github.com/pre-commit/mirrors-mypy/issues/34#issuecomment-1062160321 # - # To workaround this we run `mypy` only in manual mode + # To work around this we run `mypy` only in manual mode # So it won't run as part of `git commit` command # But it will still be run as part of `pre-commit` workflow and give expected results stages: [manual] diff --git a/README.md b/README.md index 922a1148ac..46b23daad7 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ maintained stacks. We value all positive contributions to the Docker stacks project, from [bug reports](https://jupyter-docker-stacks.readthedocs.io/en/latest/contributing/issues.html) to [pull requests](https://jupyter-docker-stacks.readthedocs.io/en/latest/contributing/packages.html) -to help answering questions. +to help to answer questions. We'd also like to invite members of the community to help with two maintainer activities: - **Issue triaging**: Reading and providing a first response to issues, labeling issues appropriately, @@ -86,7 +86,7 @@ We will happily grant additional permissions (e.g., ability to merge PRs) to any ## Jupyter Notebook Deprecation Notice -Following [Jupyter Notebook notice](https://github.com/jupyter/notebook#notice), JupyterLab is now the default for all of the Jupyter Docker stack images. +Following [Jupyter Notebook notice](https://github.com/jupyter/notebook#notice), JupyterLab is now the default for all the Jupyter Docker stack images. It is still possible to switch back to Jupyter Notebook (or to launch a different startup command). You can achieve this by passing the environment variable `DOCKER_STACKS_JUPYTER_CMD=notebook` (or any other valid `jupyter` subcommand) at container startup, more information is available in the [documentation](https://jupyter-docker-stacks.readthedocs.io/en/latest/using/common.html#alternative-commands). @@ -119,8 +119,8 @@ All published containers support amd64 (x86_64) and aarch64, except for `datasci ### Caveats for arm64 images -- The manifests we publish in this projects wiki as well as the image tags for - the multi platform images that also support arm, are all based on the amd64 +- The manifests we publish in this project's wiki as well as the image tags for + the multi-platform images that also support arm, are all based on the amd64 version even though details about the installed packages versions could differ between architectures. For the status about this, see [#1401](https://github.com/jupyter/docker-stacks/issues/1401). diff --git a/all-spark-notebook/README.md b/all-spark-notebook/README.md index 4f781bf83c..a614343d8e 100644 --- a/all-spark-notebook/README.md +++ b/all-spark-notebook/README.md @@ -6,7 +6,7 @@ GitHub Actions in the project builds and pushes this image to Docker Hub. -Please visit the project documentation site for help using and contributing to this image and others. +Please visit the project documentation site for help to use and contribute to this image and others. - [Jupyter Docker Stacks on ReadTheDocs](https://jupyter-docker-stacks.readthedocs.io/en/latest/index.html) - [Selecting an Image :: Core Stacks :: jupyter/all-spark-notebook](https://jupyter-docker-stacks.readthedocs.io/en/latest/using/selecting.html#jupyter-all-spark-notebook) diff --git a/base-notebook/README.md b/base-notebook/README.md index fab19c7ccd..618da14d0e 100644 --- a/base-notebook/README.md +++ b/base-notebook/README.md @@ -6,7 +6,7 @@ GitHub Actions in the project builds and pushes this image to Docker Hub. -Please visit the project documentation site for help using and contributing to this image and others. +Please visit the project documentation site for help to use and contribute to this image and others. - [Jupyter Docker Stacks on ReadTheDocs](https://jupyter-docker-stacks.readthedocs.io/en/latest/index.html) - [Selecting an Image :: Core Stacks :: jupyter/base-notebook](https://jupyter-docker-stacks.readthedocs.io/en/latest/using/selecting.html#jupyter-base-notebook) diff --git a/base-notebook/start.sh b/base-notebook/start.sh index 05c10376e2..7c5859ee75 100755 --- a/base-notebook/start.sh +++ b/base-notebook/start.sh @@ -74,7 +74,7 @@ if [ "$(id -u)" == 0 ] ; then # - NB_USER: the desired username and associated home folder # - NB_UID: the desired user id # - NB_GID: a group id we want our user to belong to - # - NB_GROUP: the groupname we want for the group + # - NB_GROUP: a group name we want for the group # - GRANT_SUDO: a boolean ("1" or "yes") to grant the user sudo rights # - CHOWN_HOME: a boolean ("1" or "yes") to chown the user's home folder # - CHOWN_EXTRA: a comma separated list of paths to chown diff --git a/datascience-notebook/README.md b/datascience-notebook/README.md index 38fbfe3234..64ef2007e0 100644 --- a/datascience-notebook/README.md +++ b/datascience-notebook/README.md @@ -6,7 +6,7 @@ GitHub Actions in the project builds and pushes this image to Docker Hub. -Please visit the project documentation site for help using and contributing to this image and others. +Please visit the project documentation site for help to use and contribute to this image and others. - [Jupyter Docker Stacks on ReadTheDocs](https://jupyter-docker-stacks.readthedocs.io/en/latest/index.html) - [Selecting an Image :: Core Stacks :: jupyter/datascience-notebook](https://jupyter-docker-stacks.readthedocs.io/en/latest/using/selecting.html#jupyter-datascience-notebook) diff --git a/docs/contributing/packages.md b/docs/contributing/packages.md index 97d189c817..5a1230efd1 100644 --- a/docs/contributing/packages.md +++ b/docs/contributing/packages.md @@ -1,7 +1,7 @@ # Package Updates As a general rule, we do not pin package versions in our `Dockerfile`s. -The dependencies resolution is a difficult thing to do. +Dependency resolution is a difficult thing to do. This means that packages might have old versions. Images are rebuilt weekly, so usually, packages receive updates quite frequently. diff --git a/docs/using/recipes.md b/docs/using/recipes.md index d35de54d84..5fc1dc8a02 100644 --- a/docs/using/recipes.md +++ b/docs/using/recipes.md @@ -446,14 +446,14 @@ RUN pip install --quiet --no-cache-dir jupyter_dashboards faker && \ USER root # Ensure we overwrite the kernel config so that toree connects to cluster RUN jupyter toree install --sys-prefix --spark_opts="\ - --master yarn - --deploy-mode client - --driver-memory 512m - --executor-memory 512m - --executor-cores 1 - --driver-java-options - -Dhdp.version=2.5.3.0-37 - --conf spark.hadoop.yarn.timeline-service.enabled=false + --master yarn \ + --deploy-mode client \ + --driver-memory 512m \ + --executor-memory 512m \ + --executor-cores 1 \ + --driver-java-options \ + -Dhdp.version=2.5.3.0-37 \ + --conf spark.hadoop.yarn.timeline-service.enabled=false \ " USER ${NB_UID} ``` diff --git a/docs/using/troubleshooting.md b/docs/using/troubleshooting.md index e1df36d5d9..cbd6efcf79 100644 --- a/docs/using/troubleshooting.md +++ b/docs/using/troubleshooting.md @@ -222,18 +222,20 @@ If you have also **created a new user**, you might be experiencing any of the fo - Use `docker inspect ` and look for the [`Mounts` section](https://docs.docker.com/storage/volumes/#start-a-container-with-a-volume) to verify that the volume was created and mounted accordingly: ```json - "Mounts": [ - { - "Type": "volume", - "Name": "my-vol", - "Source": "/var/lib/docker/volumes/stagingarea/_data", - "Destination": "/home/jovyan/stagingarea", - "Driver": "local", - "Mode": "z", - "RW": true, - "Propagation": "" - } - ], + { + "Mounts": [ + { + "Type": "volume", + "Name": "my-vol", + "Source": "/var/lib/docker/volumes/stagingarea/_data", + "Destination": "/home/jovyan/stagingarea", + "Driver": "local", + "Mode": "z", + "RW": true, + "Propagation": "" + } + ] + } ``` ## Problems installing conda packages from specific channels diff --git a/examples/docker-compose/README.md b/examples/docker-compose/README.md index b9b7220847..e5c69a5ab0 100644 --- a/examples/docker-compose/README.md +++ b/examples/docker-compose/README.md @@ -43,7 +43,7 @@ For example, you can build and deploy a `jupyter/all-spark-notebook` by modifyin ```dockerfile FROM jupyter/all-spark-notebook:b418b67c225b -... +# Your RUN commands and so on ``` Once you modify the Dockerfile, don't forget to rebuild the image. @@ -135,8 +135,8 @@ FQDN=host.mydomain.com EMAIL=myemail@somewhere.com \ bin/letsencrypt.sh ``` -Also, be aware that Let's Encrypt certificates are short lived (90 days). -If you need them for a longer period of time, you'll need to manually setup a cron job to run the renewal steps. +Also, be aware that Let's Encrypt certificates are short-lived (90 days). +If you need them for a longer period of time, you'll need to manually set up a cron job to run the renewal steps. (You can reuse the command above.) ### Can I deploy to any Docker Machine host? diff --git a/examples/docker-compose/bin/letsencrypt.sh b/examples/docker-compose/bin/letsencrypt.sh index 4361ac8e2f..4a299eb868 100755 --- a/examples/docker-compose/bin/letsencrypt.sh +++ b/examples/docker-compose/bin/letsencrypt.sh @@ -9,11 +9,11 @@ set -e # Get domain and email from environment [ -z "${FQDN}" ] && \ - echo "ERROR: Must set FQDN environment varable" && \ + echo "ERROR: Must set FQDN environment variable" && \ exit 1 [ -z "${EMAIL}" ] && \ - echo "ERROR: Must set EMAIL environment varable" && \ + echo "ERROR: Must set EMAIL environment variable" && \ exit 1 # letsencrypt certificate server type (default is production). diff --git a/examples/docker-compose/bin/sl-dns.sh b/examples/docker-compose/bin/sl-dns.sh index 5ac9cd1f91..fc3ea4e138 100755 --- a/examples/docker-compose/bin/sl-dns.sh +++ b/examples/docker-compose/bin/sl-dns.sh @@ -15,7 +15,7 @@ MACHINE_NAME="${1}" && [ -z "${MACHINE_NAME}" ] && echo "${USAGE}" && exit ${E_B # Use SOFTLAYER_DOMAIN env var if domain name not set as second arg DOMAIN="${2:-$SOFTLAYER_DOMAIN}" && [ -z "${DOMAIN}" ] && \ - echo "Must specify domain or set SOFTLAYER_DOMAIN environment varable" && \ + echo "Must specify domain or set SOFTLAYER_DOMAIN environment variable" && \ echo "${USAGE}" && exit ${E_BADARGS} IP=$(docker-machine ip "${MACHINE_NAME}") diff --git a/examples/make-deploy/README.md b/examples/make-deploy/README.md index c587d805d7..d4fc70fe18 100644 --- a/examples/make-deploy/README.md +++ b/examples/make-deploy/README.md @@ -11,7 +11,7 @@ This folder contains a Makefile and a set of supporting files demonstrating how ## Quickstart -To show what's possible, here's how to run the `jupyter/minimal-notebook` on a brand new local virtualbox. +To show what's possible, here's how to run the `jupyter/minimal-notebook` on a brand-new local virtualbox. ```bash # create a new VM @@ -72,8 +72,8 @@ To hit their staging servers, set the environment variable `CERT_SERVER=--stagin make letsencrypt FQDN=host.mydomain.com EMAIL=myemail@somewhere.com CERT_SERVER=--staging ``` -Also, keep in mind Let's Encrypt certificates are short lived: 90 days at the moment. -You'll need to manually setup a cron job to run the renewal steps at the moment. +Also, keep in mind Let's Encrypt certificates are short-lived: 90 days at the moment. +You'll need to manually set up a cron job to run the renewal steps at the moment. (You can reuse the first command above.) ### My pip/conda/apt-get installs disappear every time I restart the container. Can I make them permanent? diff --git a/examples/openshift/README.md b/examples/openshift/README.md index b606606aa1..7895abbc32 100644 --- a/examples/openshift/README.md +++ b/examples/openshift/README.md @@ -9,9 +9,9 @@ The templates were tested with OpenShift 3.7. It is believed they should work with at least OpenShift 3.6 or later. Do be aware that the Jupyter Project docker-stacks images are very large. -The OpenShift environment you are using must provide sufficient quota on the per user space for images and the file system for running containers. +The OpenShift environment you are using must provide sufficient quota on the per-user space for images and the file system for running containers. If the quota is too small, the pulling of the images to a node in the OpenShift cluster when deploying them, will fail due to lack of space. -Even if the image is able to be run, if the quota is only just larger than the space required for the image, you will not be able to install many packages into the container before running out of space. +Even if the image is able to run, if the quota is only just larger than the space required for the image, you will not be able to install many packages into the container before running out of space. OpenShift Online, the public hosted version of OpenShift from Red Hat has a quota of only 3GB for the image and container file system. As a result, only the `minimal-notebook` can be started and there is little space remaining to install additional packages. @@ -87,7 +87,7 @@ NAME HOST/PORT PATH SER notebook notebook-jupyter.abcd.pro-us-east-1.openshiftapps.com notebook 8888-tcp edge/Redirect None ``` -A secure route will be used to expose the notebook outside of the OpenShift cluster, so in this case the URL would be: +A secure route will be used to expose the notebook outside the OpenShift cluster, so in this case the URL would be: ```lang-none https://notebook-jupyter.abcd.pro-us-east-1.openshiftapps.com/ @@ -174,7 +174,7 @@ If the error is in the config map, edit it again to fix it and trigger a new dep oc rollout latest dc/mynotebook ``` -If you make an error in the configuration file stored in the persistent volume, you will need to scale down the notebook so it isn't running. +If you make an error in the configuration file stored in the persistent volume, you will need to scale down the notebook, so it isn't running. ```bash oc scale dc/mynotebook --replicas 0 @@ -209,7 +209,7 @@ oc set env dc/mynotebook JUPYTER_NOTEBOOK_PASSWORD=mypassword This will trigger a new deployment so ensure you have downloaded any work if not using a persistent volume. -If using a persistent volume, you could instead setup a password in the file `/home/jovyan/.jupyter/jupyter_server_config.py` as per guidelines in . +If using a persistent volume, you could instead set up a password in the file `/home/jovyan/.jupyter/jupyter_server_config.py` as per guidelines in . ## Deploying from a Custom Image diff --git a/examples/source-to-image/README.md b/examples/source-to-image/README.md index 0f60bcd9c3..f8a88bb89c 100644 --- a/examples/source-to-image/README.md +++ b/examples/source-to-image/README.md @@ -1,7 +1,7 @@ # Custom Jupyter Notebook images This example provides scripts for building custom Jupyter Notebook images containing notebooks, data files, and with Python packages required by the notebooks already installed. -The scripts provided work with the Source-to-Image tool and you can create the images from the command line on your own computer. +The scripts provided work with the Source-to-Image tool, and you can create the images from the command line on your own computer. Templates are also provided to enable running builds in OpenShift, as well as deploying the resulting image to OpenShift to make it available. The build scripts, when used with the Source-to-Image tool, provide similar capabilities to `repo2docker`. @@ -96,7 +96,7 @@ fi This determines whether a `environment.yml` or `requirements.txt` file exists with the files and if so, runs the appropriate package management tool to install any Python packages listed in those files. This means that so long as a set of notebook files provides one of these files listing what Python packages they need, -those packages will be automatically installed into the image so they are available when the image is run. +those packages will be automatically installed into the image, so they are available when the image is run. A final step is: diff --git a/minimal-notebook/README.md b/minimal-notebook/README.md index 23eee58ae1..40697fa1cd 100644 --- a/minimal-notebook/README.md +++ b/minimal-notebook/README.md @@ -6,7 +6,7 @@ GitHub Actions in the project builds and pushes this image to Docker Hub. -Please visit the project documentation site for help using and contributing to this image and others. +Please visit the project documentation site for help to use and contribute to this image and others. - [Jupyter Docker Stacks on ReadTheDocs](https://jupyter-docker-stacks.readthedocs.io/en/latest/index.html) - [Selecting an Image :: Core Stacks :: jupyter/minimal-notebook](https://jupyter-docker-stacks.readthedocs.io/en/latest/using/selecting.html#jupyter-minimal-notebook) diff --git a/pyspark-notebook/README.md b/pyspark-notebook/README.md index 21b8ece0d5..1be0434393 100644 --- a/pyspark-notebook/README.md +++ b/pyspark-notebook/README.md @@ -6,7 +6,7 @@ GitHub Actions in the project builds and pushes this image to Docker Hub. -Please visit the project documentation site for help using and contributing to this image and others. +Please visit the project documentation site for help to use and contribute to this image and others. - [Jupyter Docker Stacks on ReadTheDocs](https://jupyter-docker-stacks.readthedocs.io/en/latest/index.html) - [Selecting an Image :: Core Stacks :: jupyter/pyspark-notebook](https://jupyter-docker-stacks.readthedocs.io/en/latest/using/selecting.html#jupyter-pyspark-notebook) diff --git a/r-notebook/README.md b/r-notebook/README.md index 8956897c96..045ed12339 100644 --- a/r-notebook/README.md +++ b/r-notebook/README.md @@ -6,7 +6,7 @@ GitHub Actions in the project builds and pushes this image to Docker Hub. -Please visit the project documentation site for help using and contributing to this image and others. +Please visit the project documentation site for help to use and contribute to this image and others. - [Jupyter Docker Stacks on ReadTheDocs](https://jupyter-docker-stacks.readthedocs.io/en/latest/index.html) - [Selecting an Image :: Core Stacks :: jupyter/r-notebook](https://jupyter-docker-stacks.readthedocs.io/en/latest/using/selecting.html#jupyter-r-notebook) diff --git a/scipy-notebook/README.md b/scipy-notebook/README.md index e2bd7a809d..e34693d1e6 100644 --- a/scipy-notebook/README.md +++ b/scipy-notebook/README.md @@ -6,7 +6,7 @@ GitHub Actions in the project builds and pushes this image to Docker Hub. -Please visit the project documentation site for help using and contributing to this image and others. +Please visit the project documentation site for help to use and contribute to this image and others. - [Jupyter Docker Stacks on ReadTheDocs](https://jupyter-docker-stacks.readthedocs.io/en/latest/index.html) - [Selecting an Image :: Core Stacks :: jupyter/scipy-notebook](https://jupyter-docker-stacks.readthedocs.io/en/latest/using/selecting.html#jupyter-scipy-notebook) diff --git a/tagging/manifests.py b/tagging/manifests.py index e7a51924f6..0e7ce3b528 100644 --- a/tagging/manifests.py +++ b/tagging/manifests.py @@ -18,7 +18,7 @@ def quoted_output(container: Container, cmd: str) -> str: class ManifestHeader: - """ManifestHeader doesn't fall under common interface and we run it separately""" + """ManifestHeader doesn't fall under common interface, and we run it separately""" @staticmethod def create_header(short_image_name: str, owner: str, build_timestamp: str) -> str: diff --git a/tensorflow-notebook/README.md b/tensorflow-notebook/README.md index be27f0989b..5f896fd6e8 100644 --- a/tensorflow-notebook/README.md +++ b/tensorflow-notebook/README.md @@ -6,7 +6,7 @@ GitHub Actions in the project builds and pushes this image to Docker Hub. -Please visit the project documentation site for help using and contributing to this image and others. +Please visit the project documentation site for help to use and contribute to this image and others. - [Jupyter Docker Stacks on ReadTheDocs](https://jupyter-docker-stacks.readthedocs.io/en/latest/index.html) - [Selecting an Image :: Core Stacks :: jupyter/tensorflow-notebook](https://jupyter-docker-stacks.readthedocs.io/en/latest/using/selecting.html#jupyter-tensorflow-notebook) diff --git a/tests/base-notebook/test_container_options.py b/tests/base-notebook/test_container_options.py index 03405694ab..32c4658fed 100644 --- a/tests/base-notebook/test_container_options.py +++ b/tests/base-notebook/test_container_options.py @@ -81,7 +81,7 @@ def test_gid_change(container: TrackedContainer) -> None: def test_nb_user_change(container: TrackedContainer) -> None: - """Container should change the user name (`NB_USER`) of the default user.""" + """Container should change the username (`NB_USER`) of the default user.""" nb_user = "nayvoj" running_container = container.run_detached( tty=True, diff --git a/tests/base-notebook/test_packages.py b/tests/base-notebook/test_packages.py index ea1e9bb4b8..dea67b80cc 100644 --- a/tests/base-notebook/test_packages.py +++ b/tests/base-notebook/test_packages.py @@ -133,7 +133,7 @@ def check_import_python_package( def check_import_r_package(package_helper: CondaPackageHelper, package: str) -> None: - """Try to import a R package from the command line""" + """Try to import an R package from the command line""" _check_import_package(package_helper, ["R", "--slave", "-e", f"library({package})"]) From fab0846319541c1ee7159f8acdaa34fd2ab5ddc2 Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Sun, 20 Mar 2022 14:52:24 +0200 Subject: [PATCH 2/2] Update README.md Co-authored-by: Erik Sundell --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 46b23daad7..89f229ea81 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ maintained stacks. We value all positive contributions to the Docker stacks project, from [bug reports](https://jupyter-docker-stacks.readthedocs.io/en/latest/contributing/issues.html) to [pull requests](https://jupyter-docker-stacks.readthedocs.io/en/latest/contributing/packages.html) -to help to answer questions. +to help with answering questions. We'd also like to invite members of the community to help with two maintainer activities: - **Issue triaging**: Reading and providing a first response to issues, labeling issues appropriately,