You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactored and significantly updated the Jupyter notebooks docs (#633)
* WIP Initial commit of refactored notebooks section.
* Minor additions.
* Finished draft of notebooks quickstart.
* Renamed some files and clarified the notebooks setup doc.
* Updated the guide to custom notebook images.
* A couple more screenshots plus text refinements.
* Fixed references to JupyterHub throughout the docs.
* Updated in response to review comments.
* One more link fix.
* Clarified auth in custom notebooks doc.
Copy file name to clipboardExpand all lines: content/_index.html
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,7 @@ <h4 class="section-head">What is Kubeflow?</h4>
34
34
</div>
35
35
<divclass="text">
36
36
<h4>Notebooks</h4>
37
-
<p>A JupyterHub to create and manage interactive Jupyter notebooks. Project Jupyter is a non-profit, open-source project to support interactive data science and scientific computing across all programming languages.</p>
37
+
<p>Services to create and manage interactive Jupyter notebooks. Project Jupyter is a non-profit, open-source project to support interactive data science and scientific computing across all programming languages.</p>
Copy file name to clipboardExpand all lines: content/docs/about/kubeflow.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,7 +53,7 @@ Kubeflow started as an open sourcing of the way Google ran [TensorFlow](https://
53
53
54
54
## Notebooks
55
55
56
-
Included in Kubeflow is [JupyterHub](https://jupyterhub.readthedocs.io/en/stable/) to create and manage multi-user interactive Jupyter notebooks. Project Jupyter is a non-profit, open-source project to support interactive data science and scientific computing across all programming languages.
56
+
Kubeflow includes services for spawning and managing [Jupyter notebooks](https://jupyter-notebook.readthedocs.io/en/latest/). Project Jupyter is a non-profit, open-source project to support interactive data science and scientific computing across all programming languages.
1. To connect to Jupyter follow the [instructions](/docs/other-guides/accessing-uis)
10
-
to access the Kubeflow UI. From there you will be able to navigate to JupyterHub
11
-

12
-
1. Sign in
13
-
* On GCP you sign in using your Google Account
14
-
* If you are already logged into your Google Account you may not
15
-
be prompted to login again
16
-
* On all other platforms you can sign in using any username/password
17
-
1. Click the "Start My Server" button, and you will be greeted by a dialog screen.
18
-
1. Select a CPU or GPU image from the Image dropdown menu depending on whether you are doing CPU or GPU training, or whether or not you have GPUs in your cluster. We currently offer a cpu and gpu image for each tensorflow minor version(eg: 1.4.1,1.5.1,1.6.0). Or you can type in the name of any TF image you want to run.
19
-
1. Allocate memory, CPU, GPU, or other resources according to your need (1 CPU and 2Gi of Memory are good starting points)
20
-
* To allocate GPUs, make sure that you have GPUs available in your cluster
21
-
* Run the following command to check if there are any nvidia gpus available:
22
-
`kubectl get nodes "-o=custom-columns=NAME:.metadata.name,GPU:.status.allocatable.nvidia\.com/gpu"`
23
-
* If you have GPUs available, you can schedule your server on a GPU node by specifying the following json in `Extra Resource Limits` section: `{"nvidia.com/gpu": "1"}`
24
-
1. Click Spawn
25
-
26
-
* The images are 10's of GBs in size and can take a long time to download
1. You should now be greeted with a Jupyter Notebook interface.
45
-
46
-
The image supplied above can be used for training Tensorflow models with Jupyter. The images include all the requisite plugins, including [Tensorboard](https://www.tensorflow.org/get_started/summaries_and_tensorboard) that you can use for rich visualizations and insights into your models.
47
-
48
-
To test the install, we can run a basic hello world (adapted from [mnist_softmax.py](https://github.com/tensorflow/tensorflow/blob/r1.4/tensorflow/examples/tutorials/mnist/mnist_softmax.py) )
49
-
50
-
```
51
-
from tensorflow.examples.tutorials.mnist import input_data
Paste the example into a new Python 3 Jupyter notebook and execute the code. This should result in a 0.9014 accuracy result against the test data.
81
-
82
-
Please note that when running on most cloud providers, the public IP address will be exposed to the internet and is an
83
-
unsecured endpoint by default. For a production deployment with SSL and authentication, refer to the [documentation](https://github.com/kubeflow/kubeflow/tree/{{< params "githubbranch" >}}/components/jupyterhub).
84
-
85
-
86
-
## Submitting k8s resources from Jupyter Notebook
87
-
88
-
The Jupyter Notebook pods are assigned the `jupyter-notebook` service account. This service account is bound to `jupyter-notebook` role which has namespace-scoped permissions to the following k8s resources:
89
-
90
-
* pods
91
-
* deployments
92
-
* services
93
-
* jobs
94
-
* tfjobs
95
-
* pytorchjobs
96
-
97
-
This means that you can directly create these k8s resources directly from your jupyter notebook. kubectl is already installed in the notebook, so you can create k8s resources running the following command in a jupyter notebook cell
98
-
99
-
```
100
-
!kubectl create -f myspec.yaml
101
-
```
102
-
## Creating a custom Jupyter image
103
-
You can create your own Jupyter image and use it in your Kubeflow cluster.
104
-
Your custom image needs to meet the requirements created by Kubeflow Notebook Controller. Kubeflow Notebook Controller manages the life-cycle of notebooks.
105
-
Kubeflow Web UI expects the Jupyer to be launched upon running the docker image with only `docker run`. For that you need to set the default command of your image to launch Jupyter. The Jupyter launch command needs to be set as follows:
106
-
107
-
* Set the working directory: `--notebook-dir=/home/jovyan`. This is because the folder `/home/jovyan` is backed by Kubernetes Persistent Volume (PV)
108
-
* Allow Jupyter to listen on all IPs: `--ip=0.0.0.0`
109
-
* Allow the user to run the notebook as root: `--allow-root`
110
-
* Set port: `--port=8888`
111
-
* Disable authentication. Kubeflow takes care of authentication. Use the following to allow passwordless access to Jupyter: `--NotebookApp.token='' --NotebookApp.password=''`
112
-
* Allow any origin to access your Jupyter: `--NotebookApp.allow_origin='*'`
113
-
* Set base_url: Kubeflow Notebook Controller manages the base URL for the notebook server using the environment variable called `NB_PREFIX`. Your should define the variable in your image and set the value of `base_url` as follows: `--NotebookApp.base_url=NB_PREFIX`
114
-
115
-
As an example your Dockerfile should contain the following:
## Building docker images from Jupyter Notebook on GCP
125
-
126
-
If using Jupyter Notebooks on GKE, you can submit docker image builds to Cloud Build which builds your docker images and pushes them to Google Container Registry.
0 commit comments