Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

update day-1 handson instruction #103

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 49 additions & 11 deletions HandsOn/day1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,61 @@ the Kubeflow pipeline using the permission we have within the Kubeflow Jupyter N

## Instructions

1. Go to the Kubeflow dashboard. It should be `<minikube/public_ip>:31380`. Then create a username call `anonymous`.
1. Go to the Kubeflow dashboard. It should be `<cluster_id>:30380` or `localhost:8080` if you use port-forward.
Log in with the username and password you specified when deploying Kubeflow.

2. Click on the `Jupyter Servers` tab on the left-hand panel.
![](images/demo1.png)
2. Set up a `PodDefault` in the user's namespace to allow Notebook Server to access Pipeline APIs. Use the following
PodDefault as the template:
```
apiVersion: kubeflow.org/v1alpha1
kind: PodDefault
metadata:
name: access-kf-pipeline
namespace: example
spec:
desc: Allow access to KFP
selector:
matchLabels:
access-kf-pipeline: "true"
volumeMounts:
- mountPath: /var/run/secrets/kubeflow/pipelines
name: volume-kf-pipeline-token
readOnly: true
volumes:
- name: volume-kf-pipeline-token
projected:
sources:
- serviceAccountToken:
path: token
expirationSeconds: 7200
audience: pipelines.kubeflow.org
env:
- name: KF_PIPELINES_SA_TOKEN_PATH
value: /var/run/secrets/kubeflow/pipelines/token
```
Change the `namespace` to your user's namespace, save the file as `poddefault.yaml`, and use the following command to
create the PodDefault:
```
kubecel apply -f poddefault.yaml
```
2. Click on the `Notebooks` tab on the left-hand panel.
![](images/demo1.png)

3. Click on the `New Server` button.
![](images/demo2.png)

4. Give any name to your Jupyter Server, and keep the rest with the default settings. At the end of the form, click on the `Launch` button.
![](images/demo3.png)
![](images/demo4.png)
4. Give any name to your Notebook Server, and keep the rest with the default settings.
![](images/demo3.png)
In `Configurations` section, select `Allow access to KFP`
![](images/demo3-1.png)
At the end of the form, click on the `Launch` button.
![](images/demo4.png)

5. Once the Jupyter Server is ready, click on the `Connect` button to access the Jupyter Server.
![](images/demo5.png)
5. Once the Notebook Server is ready, click on the `Connect` button to access the Notebook Server.
![](images/demo5.png)

6. Within the Jupyter Server, click upload and select the `lightweight_component.ipynb` example in this directory. Then click on the notebook and
6. Within the Notebook Server, click upload and select the `lightweight_component.ipynb` example in this directory. Then click on the notebook and
start running code using the Jupyter Notebook running on Kubeflow. The rest of the instructions are within the Jupyter Notebook.
![](images/demo6.png)
![](images/demo7.png)
![](images/demo6.png)
![](images/demo7.png)

Binary file modified HandsOn/day1/images/demo1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified HandsOn/day1/images/demo2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added HandsOn/day1/images/demo3-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified HandsOn/day1/images/demo3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified HandsOn/day1/images/demo4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified HandsOn/day1/images/demo5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified HandsOn/day1/images/demo7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added HandsOn/day1/images/deom6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions HandsOn/day1/lightweight_component.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@
"source": [
"# Install the dependency packages\n",
"!pip install --upgrade pip\n",
"!pip install numpy tensorflow kfp-tekton"
"!pip install numpy tensorflow kfp-tekton==1.1.1"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**Important**: If you are running this notebook using the Kubeflow Jupyter Server, you need to restart the Python **Kernel** because the packages above overwrited some default packages inside the Kubeflow Jupyter image."
"**Important**: If you are running this notebook using the Kubeflow Notebook Server, you need to restart the Python **Kernel** because the packages above overwrited some default packages inside the Kubeflow Jupyter image."
]
},
{
Expand Down Expand Up @@ -191,7 +191,7 @@
"source": [
"import kfp.dsl as dsl\n",
"@dsl.pipeline(\n",
" name='Calculation pipeline',\n",
" name='calculation-pipeline',\n",
" description='A toy pipeline that performs arithmetic calculations.'\n",
")\n",
"# Currently kfp-tekton doesn't support pass parameter to the pipelinerun yet, so we hard code the number here\n",
Expand Down