mirror of
https://github.com/jupyter/docker-stacks.git
synced 2025-10-17 23:12:56 +00:00
Fix more errors
This commit is contained in:
@@ -10,7 +10,7 @@ Any OpenShift 3 environment. The templates were tested with OpenShift 3.7. It is
|
||||
|
||||
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. 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.
|
||||
|
||||
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. Although OpenShift Online is suitable for demonstrating these templates work, what you can do in that environment will be limited due to the size of the images.
|
||||
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. Although OpenShift Online is suitable for demonstrating these templates work, what you can do in that environment will be limited due to the size of the images.
|
||||
|
||||
If you want to experiment with using Jupyter Notebooks in an OpenShift environment, you should instead use [Minishift](https://www.openshift.org/minishift/). Minishift provides you the ability to run OpenShift in a virtual machine on your own local computer.
|
||||
|
||||
@@ -23,13 +23,9 @@ To load the templates, login to OpenShift from the command line and run:
|
||||
oc create -f https://raw.githubusercontent.com/jupyter-on-openshift/docker-stacks/master/examples/openshift/templates.json
|
||||
```
|
||||
|
||||
This should create the following templates:
|
||||
This should create the `jupyter-notebook` template
|
||||
|
||||
```
|
||||
jupyter-notebook
|
||||
```
|
||||
|
||||
The template can be used from the command line using the ``oc new-app`` command, or from the OpenShift web console by selecting _Add to Project_. This ``README`` is only going to explain deploying from the command line.
|
||||
The template can be used from the command line using the `oc new-app` command, or from the OpenShift web console by selecting _Add to Project_. This `README` is only going to explain deploying from the command line.
|
||||
|
||||
Deploying a Notebook
|
||||
--------------------
|
||||
@@ -42,7 +38,7 @@ oc new-app --template jupyter-notebook
|
||||
|
||||
The output will be similar to:
|
||||
|
||||
```
|
||||
```lang-none
|
||||
--> Deploying template "jupyter/jupyter-notebook" to project jupyter
|
||||
|
||||
Jupyter Notebook
|
||||
@@ -64,13 +60,13 @@ The output will be similar to:
|
||||
Run 'oc status' to view your app.
|
||||
```
|
||||
|
||||
When no template parameters are provided, the name of the deployed notebook will be ``notebook``. The image used will be:
|
||||
When no template parameters are provided, the name of the deployed notebook will be `notebook`. The image used will be:
|
||||
|
||||
```
|
||||
```lang-none
|
||||
jupyter/minimal-notebook:latest
|
||||
```
|
||||
|
||||
A password you can use when accessing the notebook will be auto generated and is displayed in the output from running ``oc new-app``.
|
||||
A password you can use when accessing the notebook will be auto generated and is displayed in the output from running `oc new-app`.
|
||||
|
||||
To see the hostname for accessing the notebook run:
|
||||
|
||||
@@ -80,14 +76,14 @@ oc get routes
|
||||
|
||||
The output will be similar to:
|
||||
|
||||
```
|
||||
```lang-none
|
||||
NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARD
|
||||
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:
|
||||
|
||||
```
|
||||
```lang-none
|
||||
https://notebook-jupyter.abcd.pro-us-east-1.openshiftapps.com/
|
||||
```
|
||||
|
||||
@@ -96,7 +92,7 @@ When prompted, enter the password for the notebook.
|
||||
Passing Template Parameters
|
||||
---------------------------
|
||||
|
||||
To override the name for the notebook, the image used, and the password, you can pass template parameters using the ``--param`` option.
|
||||
To override the name for the notebook, the image used, and the password, you can pass template parameters using the `--param` option.
|
||||
|
||||
```bash
|
||||
oc new-app --template jupyter-notebook \
|
||||
@@ -116,12 +112,12 @@ You can deploy any of the Jupyter Project docker-stacks images.
|
||||
* jupyter/pyspark-notebook
|
||||
* jupyter/all-spark-notebook
|
||||
|
||||
If you don't care what version of the image is used, add the ``:latest`` tag at the end of the image name, otherwise use the hash corresponding to the image version you want to use.
|
||||
If you don't care what version of the image is used, add the `:latest` tag at the end of the image name, otherwise use the hash corresponding to the image version you want to use.
|
||||
|
||||
Deleting the Notebook Instance
|
||||
------------------------------
|
||||
|
||||
To delete the notebook instance, run ``oc delete`` using a label selector for the application name.
|
||||
To delete the notebook instance, run `oc delete` using a label selector for the application name.
|
||||
|
||||
```bash
|
||||
oc delete all,configmap --selector app=mynotebook
|
||||
@@ -130,7 +126,7 @@ oc delete all,configmap --selector app=mynotebook
|
||||
Enabling Jupyter Lab Interface
|
||||
------------------------------
|
||||
|
||||
To enable the Jupyter Lab interface for a deployed notebook set the ``JUPYTER_ENABLE_LAB`` environment variable.
|
||||
To enable the Jupyter Lab interface for a deployed notebook set the `JUPYTER_ENABLE_LAB` environment variable.
|
||||
|
||||
```bash
|
||||
oc set env dc/mynotebook JUPYTER_ENABLE_LAB=true
|
||||
@@ -165,11 +161,11 @@ If you want to set any custom configuration for the notebook, you can edit the c
|
||||
oc edit configmap/mynotebook-cfg
|
||||
```
|
||||
|
||||
The ``data`` field of the config map contains Python code used as the ``jupyter_notebook_config.py`` file.
|
||||
The `data` field of the config map contains Python code used as the `jupyter_notebook_config.py` file.
|
||||
|
||||
If you are using a persistent volume, you can also create a configuration file at:
|
||||
|
||||
```
|
||||
```lang-none
|
||||
/home/jovyan/.jupyter/jupyter_notebook_config.py
|
||||
```
|
||||
|
||||
@@ -177,7 +173,7 @@ This will be merged at the end of the configuration from the config map.
|
||||
|
||||
Because the configuration is Python code, ensure any indenting is correct. Any errors in the configuration file will cause the notebook to fail when starting.
|
||||
|
||||
If the error is in the config map, edit it again to fix it and trigged a new deployment if necessary by running:
|
||||
If the error is in the config map, edit it again to fix it and trigger a new deployment if necessary by running:
|
||||
|
||||
```bash
|
||||
oc rollout latest dc/mynotebook
|
||||
@@ -216,15 +212,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_notebook_config.py
|
||||
```
|
||||
|
||||
as per guidelines in:
|
||||
|
||||
* <https://jupyter-notebook.readthedocs.io/en/stable/public_server.html>
|
||||
If using a persistent volume, you could instead setup a password in the file `/home/jovyan/.jupyter/jupyter_notebook_config.py` as per guidelines in <https://jupyter-notebook.readthedocs.io/en/stable/public_server.html>.
|
||||
|
||||
Deploying from a Custom Image
|
||||
-----------------------------
|
||||
|
Reference in New Issue
Block a user