Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding updates to modules #2

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
6 changes: 5 additions & 1 deletion _machine-learning-workshop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ id: "machinelearning"
name: "OpenShift Machine Learning Workshop"

content:
url: https://raw.githubusercontent.com/msolberg/machine-learning-workshop-guides/main
url: https://raw.githubusercontent.com/takinosh/machine-learning-workshop-guides/main

vars:
ROUTE_SUBDOMAIN:
Expand All @@ -20,4 +20,8 @@ vars:
modules:
activate:
- workshop-environment
- setup-environment
- data-cleansing
- model-training
- model-running
- model-updates
2 changes: 2 additions & 0 deletions _modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ config:
modules:
workshop-environment:
name: Your Workshop Environment
setup-environment:
name: Setup Environment via CodeReady Workspaces
data-cleansing:
name: Data Cleansing in OpenShift
model-training:
Expand Down
46 changes: 39 additions & 7 deletions data-cleansing.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,25 +45,30 @@ You will see the OpenShift landing page:

We'll start by deploying an Open Data Hub (ODH) instance. +

Create a project for the notebooks.
Switch to project for the notebooks.

```
oc new-project userXX-notebooks
oc project user2-notebooks
oc project userXX-notebooks
```

### Step 2: Deploy ODH

Change your directory to where the installation files are:

```
cd /opt/app-root/workshop/files
cd ocp-machine-learning-workshop
```

Take a look at the ODH deployment file:

```
cat 01_odh.yaml
01_odh.yaml
```

Patch the deployment jupyterhub-db so the deployment may complete.

```
oc patch dc jupyterhub-db -n userXX-notebooks --type='json' -p='[{"op": "add", "path": "/spec/template/spec/serviceAccount", "value": "postgres" },{"op": "add", "path": "/spec/template/spec/serviceAccountName", "value": "postgres" }]'
```

You will see from the *spec* section that it will deploy 3 components:
Expand All @@ -80,12 +85,36 @@ oc apply -f 01_odh.yaml

Watch the topology view to see that the jupyterhub and jupyterhub-db deployments succeed. The circles should turn dark blue!

*TODO Make a nice picture of the successful deployment for people to look at.*
![jupyterhub.png]({% image_path jupyterhub.png %})

## Bucket Storage Access
Your JupyterHub Notebook requires an `access_key` and `secret_key` that is found in your openshift project as a secret. The Notebook uses this information to storage data and content that you will during this lab.

You may access this in the terminal by running the commands below.
* list your secrets you should see a secert called `my-storage-keys`.

```
oc get secrets -n userXX-notebooks
```

* Obtain yur access key from secret.

```
oc get secrets -n userXX-notebooks my-storage-keys -o jsonpath='{.data.accesskeys}' | base64 -d
```

You may access from the UI as seen below.
*To-Do add UI instructions*

## Buckets and Bucket Notifications creation

### Connect to JupyterHub

* Using the CodyReady Terminal
```
oc get route -n userXX-notebooks jupyterhub
```

* Using the UI
Click on the jupyterhub icon and look for the "Routes" section. Click on the route listed there.

Just click on this link, a new tab will open. Click on the button *Sign in with OpenShift*, and use your OpenTLC credentials to connect.+
Expand All @@ -95,7 +124,10 @@ On the first connection, OpenShift will ask to authorize the application to acce

On the *Spawner Options* page select the *s2i-minimal-notebook:3.6* image from the first dropdown (this should be the default image), and click *Spawn* at the bottom.

![spawner.png]({% image_path spawner.png %})

Your Jupyter environment will take 15-20 seconds to launch.

It will display a _File Explore like_ interface. Click on the *xraylab_notebooks.git* folder, then on the *georgia_covidtracking.ipynb* file, which will launch the notebook.

![launcher.png]({% image_path launcher.png %})
Binary file added images/jupyterhub.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 images/launcher.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 images/new_terminal.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 images/spawner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions setup-environment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
## Setup Environment via CodeReady Workspaces

**Login to the OpenShift Console [CodeReady Workspaces]({{ ECLIPSE_CHE_URL}}){:target="_blank"}.**
*Use the following username and password*

* username: `{{OPENSHIFT_USER_NAME}}`
* password: `{{CHE_USER_PASSWORD}}`

**Click on *Git Clone* in your CodeReady Workspace**

```
{{GIT_URL}}
```

**Click on *New terminal***
![new_terminal.png]({% image_path new_terminal.png %})

**Click on *Login to OpenShift***
![new_terminal.png]({% image_path new_terminal.png %})

*Use the following username and password*

* username: `{{OPENSHIFT_USER_NAME}}`
* password: `{{OPENSHIFT_USER_PASSWORD}}`


**List your projects.**

```
oc projects
```

**Switch to notebook.**

```
oc project userXX-notebooks
```