mirror of
https://github.com/jupyter/docker-stacks.git
synced 2025-10-10 03:23:00 +00:00
Merge branch 'master' into asalikhov/ubuntu_focal
This commit is contained in:
@@ -12,7 +12,7 @@ See the [installation instructions](https://docs.docker.com/engine/installation/
|
||||
|
||||
Build and run a `jupyter/minimal-notebook` container on a VirtualBox VM on local desktop.
|
||||
|
||||
```
|
||||
```bash
|
||||
# create a Docker Machine-controlled VirtualBox VM
|
||||
bin/vbox.sh mymachine
|
||||
|
||||
@@ -28,7 +28,7 @@ notebook/up.sh
|
||||
|
||||
To stop and remove the container:
|
||||
|
||||
```
|
||||
```bash
|
||||
notebook/down.sh
|
||||
```
|
||||
|
||||
@@ -39,14 +39,14 @@ notebook/down.sh
|
||||
|
||||
You can customize the docker-stack notebook image to deploy by modifying the `notebook/Dockerfile`. For example, you can build and deploy a `jupyter/all-spark-notebook` by modifying the Dockerfile like so:
|
||||
|
||||
```
|
||||
```dockerfile
|
||||
FROM jupyter/all-spark-notebook:55d5ca6be183
|
||||
...
|
||||
```
|
||||
|
||||
Once you modify the Dockerfile, don't forget to rebuild the image.
|
||||
|
||||
```
|
||||
```bash
|
||||
# activate the docker machine
|
||||
eval "$(docker-machine env mymachine)"
|
||||
|
||||
@@ -57,14 +57,14 @@ notebook/build.sh
|
||||
|
||||
Yes. Set environment variables to specify unique names and ports when running the `up.sh` command.
|
||||
|
||||
```
|
||||
```bash
|
||||
NAME=my-notebook PORT=9000 notebook/up.sh
|
||||
NAME=your-notebook PORT=9001 notebook/up.sh
|
||||
```
|
||||
|
||||
To stop and remove the containers:
|
||||
|
||||
```
|
||||
```bash
|
||||
NAME=my-notebook notebook/down.sh
|
||||
NAME=your-notebook notebook/down.sh
|
||||
```
|
||||
@@ -78,7 +78,7 @@ The `up.sh` creates a Docker volume named after the notebook container with a `-
|
||||
|
||||
Yes. Set the `WORK_VOLUME` environment variable to the same value for each notebook.
|
||||
|
||||
```
|
||||
```bash
|
||||
NAME=my-notebook PORT=9000 WORK_VOLUME=our-work notebook/up.sh
|
||||
NAME=your-notebook PORT=9001 WORK_VOLUME=our-work notebook/up.sh
|
||||
```
|
||||
@@ -87,7 +87,7 @@ NAME=your-notebook PORT=9001 WORK_VOLUME=our-work notebook/up.sh
|
||||
|
||||
To run the notebook server with a self-signed certificate, pass the `--secure` option to the `up.sh` script. You must also provide a password, which will be used to secure the notebook server. You can specify the password by setting the `PASSWORD` environment variable, or by passing it to the `up.sh` script.
|
||||
|
||||
```
|
||||
```bash
|
||||
PASSWORD=a_secret notebook/up.sh --secure
|
||||
|
||||
# or
|
||||
@@ -103,7 +103,7 @@ This example includes the `bin/letsencrypt.sh` script, which runs the `letsencry
|
||||
|
||||
The following command will create a certificate chain and store it in a Docker volume named `mydomain-secrets`.
|
||||
|
||||
```
|
||||
```bash
|
||||
FQDN=host.mydomain.com EMAIL=myemail@somewhere.com \
|
||||
SECRETS_VOLUME=mydomain-secrets \
|
||||
bin/letsencrypt.sh
|
||||
@@ -111,7 +111,7 @@ FQDN=host.mydomain.com EMAIL=myemail@somewhere.com \
|
||||
|
||||
Now run `up.sh` with the `--letsencrypt` option. You must also provide the name of the secrets volume and a password.
|
||||
|
||||
```
|
||||
```bash
|
||||
PASSWORD=a_secret SECRETS_VOLUME=mydomain-secrets notebook/up.sh --letsencrypt
|
||||
|
||||
# or
|
||||
@@ -120,7 +120,7 @@ notebook/up.sh --letsencrypt --password a_secret --secrets mydomain-secrets
|
||||
|
||||
Be aware that Let's Encrypt has a pretty [low rate limit per domain](https://community.letsencrypt.org/t/public-beta-rate-limits/4772/3) at the moment. You can avoid exhausting your limit by testing against the Let's Encrypt staging servers. To hit their staging servers, set the environment variable `CERT_SERVER=--staging`.
|
||||
|
||||
```
|
||||
```bash
|
||||
FQDN=host.mydomain.com EMAIL=myemail@somewhere.com \
|
||||
CERT_SERVER=--staging \
|
||||
bin/letsencrypt.sh
|
||||
@@ -134,13 +134,13 @@ Yes, you should be able to deploy to any Docker Machine-controlled host. To mak
|
||||
|
||||
To create a Docker machine using a VirtualBox VM on local desktop:
|
||||
|
||||
```
|
||||
```bash
|
||||
bin/vbox.sh mymachine
|
||||
```
|
||||
|
||||
To create a Docker machine using a virtual device on IBM SoftLayer:
|
||||
|
||||
```
|
||||
```bash
|
||||
export SOFTLAYER_USER=my_softlayer_username
|
||||
export SOFTLAYER_API_KEY=my_softlayer_api_key
|
||||
export SOFTLAYER_DOMAIN=my.domain
|
||||
|
@@ -11,7 +11,7 @@ This folder contains a Makefile and a set of supporting files demonstrating how
|
||||
|
||||
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
|
||||
make virtualbox-vm NAME=dev
|
||||
# make the new VM the active docker machine
|
||||
@@ -30,7 +30,7 @@ The last command will log the IP address and port to visit in your browser.
|
||||
|
||||
Yes. Specify a unique name and port on the `make notebook` command.
|
||||
|
||||
```
|
||||
```bash
|
||||
make notebook NAME=my-notebook PORT=9000
|
||||
make notebook NAME=your-notebook PORT=9001
|
||||
```
|
||||
@@ -39,7 +39,7 @@ make notebook NAME=your-notebook PORT=9001
|
||||
|
||||
Yes.
|
||||
|
||||
```
|
||||
```bash
|
||||
make notebook NAME=my-notebook PORT=9000 WORK_VOLUME=our-work
|
||||
make notebook NAME=your-notebook PORT=9001 WORK_VOLUME=our-work
|
||||
```
|
||||
@@ -52,7 +52,7 @@ Instead of `make notebook`, run `make self-signed-notebook PASSWORD=your_desired
|
||||
|
||||
Yes. Please.
|
||||
|
||||
```
|
||||
```bash
|
||||
make letsencrypt FQDN=host.mydomain.com EMAIL=myemail@somewhere.com
|
||||
make letsencrypt-notebook
|
||||
```
|
||||
@@ -61,7 +61,7 @@ The first command creates a Docker volume named after the notebook container wit
|
||||
|
||||
Be aware: Let's Encrypt has a pretty [low rate limit per domain](https://community.letsencrypt.org/t/public-beta-rate-limits/4772/3) at the moment. You can avoid exhausting your limit by testing against the Let's Encrypt staging servers. To hit their staging servers, set the environment variable `CERT_SERVER=--staging`.
|
||||
|
||||
```
|
||||
```bash
|
||||
make letsencrypt FQDN=host.mydomain.com EMAIL=myemail@somewhere.com CERT_SERVER=--staging
|
||||
```
|
||||
|
||||
@@ -69,7 +69,7 @@ Also, keep in mind Let's Encrypt certificates are short lived: 90 days at the mo
|
||||
|
||||
### My pip/conda/apt-get installs disappear every time I restart the container. Can I make them permanent?
|
||||
|
||||
```
|
||||
```bash
|
||||
# add your pip, conda, apt-get, etc. permanent features to the Dockerfile where
|
||||
# indicated by the comments in the Dockerfile
|
||||
vi Dockerfile
|
||||
@@ -79,7 +79,7 @@ make notebook
|
||||
|
||||
### How do I upgrade my Docker container?
|
||||
|
||||
```
|
||||
```bash
|
||||
make image DOCKER_ARGS=--pull
|
||||
make notebook
|
||||
```
|
||||
@@ -90,7 +90,7 @@ The first line pulls the latest version of the Docker image used in the local Do
|
||||
|
||||
Yes. As an example, there's a `softlayer.makefile` included in this repo as an example. You would use it like so:
|
||||
|
||||
```
|
||||
```bash
|
||||
make softlayer-vm NAME=myhost \
|
||||
SOFTLAYER_DOMAIN=your_desired_domain \
|
||||
SOFTLAYER_USER=your_user_id \
|
||||
|
@@ -16,7 +16,7 @@ Loading the Templates
|
||||
|
||||
To load the templates, login to OpenShift from the command line and run:
|
||||
|
||||
```
|
||||
```bash
|
||||
oc create -f https://raw.githubusercontent.com/jupyter-on-openshift/docker-stacks/master/examples/openshift/templates.json
|
||||
```
|
||||
|
||||
@@ -33,7 +33,7 @@ Deploying a Notebook
|
||||
|
||||
To deploy a notebook from the command line using the template, run:
|
||||
|
||||
```
|
||||
```bash
|
||||
oc new-app --template jupyter-notebook
|
||||
```
|
||||
|
||||
@@ -71,7 +71,7 @@ A password you can use when accessing the notebook will be auto generated and is
|
||||
|
||||
To see the hostname for accessing the notebook run:
|
||||
|
||||
```
|
||||
```bash
|
||||
oc get routes
|
||||
```
|
||||
|
||||
@@ -95,7 +95,7 @@ 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.
|
||||
|
||||
```
|
||||
```bash
|
||||
oc new-app --template jupyter-notebook \
|
||||
--param APPLICATION_NAME=mynotebook \
|
||||
--param NOTEBOOK_IMAGE=jupyter/scipy-notebook:latest \
|
||||
@@ -120,7 +120,7 @@ Deleting the Notebook Instance
|
||||
|
||||
To delete the notebook instance, run ``oc delete`` using a label selector for the application name.
|
||||
|
||||
```
|
||||
```bash
|
||||
oc delete all,configmap --selector app=mynotebook
|
||||
```
|
||||
|
||||
@@ -129,7 +129,7 @@ Enabling Jupyter Lab Interface
|
||||
|
||||
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
|
||||
```
|
||||
|
||||
@@ -140,7 +140,7 @@ Adding Persistent Storage
|
||||
|
||||
You can upload notebooks and other files using the web interface of the notebook. Any uploaded files or changes you make to them will be lost when the notebook instance is restarted. If you want to save your work, you need to add persistent storage to the notebook. To add persistent storage run:
|
||||
|
||||
```
|
||||
```bash
|
||||
oc set volume dc/mynotebook --add \
|
||||
--type=pvc --claim-size=1Gi --claim-mode=ReadWriteOnce \
|
||||
--claim-name mynotebook-data --name data \
|
||||
@@ -149,7 +149,7 @@ oc set volume dc/mynotebook --add \
|
||||
|
||||
When you have deleted the notebook instance, if using a persistent volume, you will need to delete it in a separate step.
|
||||
|
||||
```
|
||||
```bash
|
||||
oc delete pvc/mynotebook-data
|
||||
```
|
||||
|
||||
@@ -158,7 +158,7 @@ Customizing the Configuration
|
||||
|
||||
If you want to set any custom configuration for the notebook, you can edit the config map created by the template.
|
||||
|
||||
```
|
||||
```bash
|
||||
oc edit configmap/mynotebook-cfg
|
||||
```
|
||||
|
||||
@@ -176,19 +176,19 @@ Because the configuration is Python code, ensure any indenting is correct. Any e
|
||||
|
||||
If the error is in the config map, edit it again to fix it and trigged a new deployment if necessary by running:
|
||||
|
||||
```
|
||||
```bash
|
||||
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.
|
||||
|
||||
```
|
||||
```bash
|
||||
oc scale dc/mynotebook --replicas 0
|
||||
```
|
||||
|
||||
Then run:
|
||||
|
||||
```
|
||||
```bash
|
||||
oc debug dc/mynotebook
|
||||
```
|
||||
|
||||
@@ -196,7 +196,7 @@ to run the notebook in debug mode. This will provide you with an interactive ter
|
||||
|
||||
Start up the notebook again.
|
||||
|
||||
```
|
||||
```bash
|
||||
oc scale dc/mynotebook --replicas 1
|
||||
```
|
||||
|
||||
@@ -207,7 +207,7 @@ The password for the notebook is supplied as a template parameter, or if not sup
|
||||
|
||||
If you want to change the password, you can do so by editing the environment variable on the deployment configuration.
|
||||
|
||||
```
|
||||
```bash
|
||||
oc set env dc/mynotebook JUPYTER_NOTEBOOK_PASSWORD=mypassword
|
||||
```
|
||||
|
||||
@@ -232,13 +232,13 @@ If the image is in your OpenShift project, because you imported the image into O
|
||||
|
||||
This can be illustrated by first importing an image into the OpenShift project.
|
||||
|
||||
```
|
||||
```bash
|
||||
oc import-image jupyter/datascience-notebook:latest --confirm
|
||||
```
|
||||
|
||||
Then deploy it using the name of the image stream created.
|
||||
|
||||
```
|
||||
```bash
|
||||
oc new-app --template jupyter-notebook \
|
||||
--param APPLICATION_NAME=mynotebook \
|
||||
--param NOTEBOOK_IMAGE=datascience-notebook \
|
||||
|
@@ -22,7 +22,7 @@ Getting Started with S2I
|
||||
|
||||
As an example of how S2I can be used to create a custom image with a bundled set of notebooks, run:
|
||||
|
||||
```
|
||||
```bash
|
||||
s2i build \
|
||||
--scripts-url https://raw.githubusercontent.com/jupyter/docker-stacks/master/examples/source-to-image \
|
||||
--context-dir docs/source/examples/Notebook \
|
||||
@@ -76,7 +76,7 @@ The supplied ``assemble`` script performs a few key steps.
|
||||
|
||||
The first steps copy files into the location they need to be when the image is run, from the directory where they are initially placed by the ``s2i`` command.
|
||||
|
||||
```
|
||||
```bash
|
||||
cp -Rf /tmp/src/. /home/$NB_USER
|
||||
|
||||
rm -rf /tmp/src
|
||||
@@ -84,7 +84,7 @@ rm -rf /tmp/src
|
||||
|
||||
The next steps are:
|
||||
|
||||
```
|
||||
```bash
|
||||
if [ -f /home/$NB_USER/environment.yml ]; then
|
||||
conda env update --name root --file /home/$NB_USER/environment.yml
|
||||
conda clean --all -f -y
|
||||
@@ -101,7 +101,7 @@ This means that so long as a set of notebook files provides one of these files l
|
||||
|
||||
A final step is:
|
||||
|
||||
```
|
||||
```bash
|
||||
fix-permissions $CONDA_DIR
|
||||
fix-permissions /home/$NB_USER
|
||||
```
|
||||
@@ -112,7 +112,7 @@ As long as you preserve the first and last set of steps, you can do whatever you
|
||||
|
||||
The ``run`` script in this directory is very simple and just runs the notebook application.
|
||||
|
||||
```
|
||||
```bash
|
||||
exec start-notebook.sh "$@"
|
||||
```
|
||||
|
||||
@@ -121,13 +121,13 @@ Integration with OpenShift
|
||||
|
||||
The OpenShift platform provides integrated support for S2I type builds. Templates are provided for using the S2I build mechanism with the scripts in this directory. To load the templates run:
|
||||
|
||||
```
|
||||
```bash
|
||||
oc create -f https://raw.githubusercontent.com/jupyter/docker-stacks/master/examples/source-to-image/templates.json
|
||||
```
|
||||
|
||||
This will create the templates:
|
||||
|
||||
```
|
||||
```bash
|
||||
jupyter-notebook-builder
|
||||
jupyter-notebook-quickstart
|
||||
```
|
||||
@@ -136,7 +136,7 @@ The templates can be used from the OpenShift web console or command line. This `
|
||||
|
||||
To use the OpenShift command line to build into an image, and deploy, the set of notebooks used above, run:
|
||||
|
||||
```
|
||||
```bash
|
||||
oc new-app --template jupyter-notebook-quickstart \
|
||||
--param APPLICATION_NAME=notebook-examples \
|
||||
--param GIT_REPOSITORY_URL=https://github.com/jupyter/notebook \
|
||||
|
Reference in New Issue
Block a user