Fix minor PyCharm issues

This commit is contained in:
Ayaz Salikhov
2022-03-18 23:29:14 +02:00
parent aa14e4498c
commit bcf5118cb7
23 changed files with 56 additions and 54 deletions

View File

@@ -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]

View File

@@ -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).

View File

@@ -6,7 +6,7 @@
GitHub Actions in the <https://github.com/jupyter/docker-stacks> 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)

View File

@@ -6,7 +6,7 @@
GitHub Actions in the <https://github.com/jupyter/docker-stacks> 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)

View File

@@ -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

View File

@@ -6,7 +6,7 @@
GitHub Actions in the <https://github.com/jupyter/docker-stacks> 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)

View File

@@ -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.

View File

@@ -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}
```

View File

@@ -222,18 +222,20 @@ If you have also **created a new user**, you might be experiencing any of the fo
- Use `docker inspect <container_id>` 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

View File

@@ -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?

View File

@@ -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).

View File

@@ -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}")

View File

@@ -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?

View File

@@ -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 <https://jupyter-server.readthedocs.io/en/latest/operators/public-server.html>.
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 <https://jupyter-server.readthedocs.io/en/latest/operators/public-server.html>.
## Deploying from a Custom Image

View File

@@ -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:

View File

@@ -6,7 +6,7 @@
GitHub Actions in the <https://github.com/jupyter/docker-stacks> 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)

View File

@@ -6,7 +6,7 @@
GitHub Actions in the <https://github.com/jupyter/docker-stacks> 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)

View File

@@ -6,7 +6,7 @@
GitHub Actions in the <https://github.com/jupyter/docker-stacks> 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)

View File

@@ -6,7 +6,7 @@
GitHub Actions in the <https://github.com/jupyter/docker-stacks> 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)

View File

@@ -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:

View File

@@ -6,7 +6,7 @@
GitHub Actions in the <https://github.com/jupyter/docker-stacks> 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)

View File

@@ -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,

View File

@@ -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})"])