smartabyar-smartvillage / smartabyar-smartvillage-sandbox-course

GNU General Public License v3.0
1 stars 3 forks source link
course

Visualizing open source IOT data in the cloud

Brought to you by the Smarta Byar Smart Village Community FIWARE iHub

Written by Christopher Tate

Red Hat OpenShift Developer Sandbox

How to start an OpenShift Developer Sandbox

Start a free Red Hat OpenShift Developer Sandbox here.

Click on the

button in the top right corner.

Register for a free Red Hat account

If you do not already have a free Red Hat account, click .

Log in if you already have a free Red Hat account:

Start your OpenShift Developer Sandbox

After you are logged into your Red Hat account, return to the page to start a free Red Hat OpenShift Developer Sandbox here.

Click

Then click

Before you can access your new sandbox, you will need to request an activation code by phone. Click on the link.

Be sure to enter your country code, and phone number correctly, then check your phone for the activation code.

Enter your activation code in the box .

After a few moments, you should be able to start your Red Hat OpenShift Developer Sandbox. Click the button to start your sandbox for free.

If you see a message , then click

You can get started in the Red Hat OpenShift platform by clicking on the button.

Log in by clicking on the

button to log into the new sandbox with your Red Hat account.

Explore your new sandbox with a tour, or get started now.

Using the OpenShift Developer Sandbox

Download the oc command

mkdir -p ~/bin
tar xvf ~/Downloads/oc.tar -C ~/bin/

Log into the OpenShift CLI in your terminal

Try the built-in OpenShift Command Line Terminal

If you would rather use the built-in OpenShift Command Line Terminal, you can click the

button at the top.

Start your terminal with the

button.

Grant default service account edit role in namespace

To grant the default service account edit role privileges, you will use either your own terminal where you have logged in to OpenShift, or use the built-in OpenShift Terminal. We will grant edit privileges on the default service account, as well as edit privileges on roles and rolebindings in the namespace so that the default service account can deploy resources in your namespace.

oc create rolebinding python-edit --clusterrole=edit \
  --serviceaccount=$(oc project -q):python

oc create role python-edit-rolebindings \
  --verb=get,list,watch,create,update,patch,delete \
  --resource=roles,rolebindings

oc create rolebinding python-edit-rolebindings --role=python-edit-rolebindings \
  --serviceaccount=$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace):python

OpenShift AI

Set up an OpenShift AI Workbench

Accessing OpenShift AI

In your OpenShift Sandbox, click on the apps button

at the top,

then click

to log into OpenShift AI.

Click the button to .

Log into OpenShift AI by clicking on the

button.

Once you are in OpenShift AI, click on the menu button , then click .

Then click on the name of your data science project , for my Red Hat user it’s computate-dev.

Create a new OpenShift AI Workbench

To create a new workbench, click .

To stay consistent with the rest of the course, enter the workbench name “python” .

For Image selection, choose “Minimal Python” .

You can leave the rest of the fields as the default. At the very bottom, click .

After a minute or two, you should see the workbench change from

to .

Access your OpenShift AI Workbench

In OpenShift AI, click on the

link to open your new OpenShift AI Workbench.

Log into OpenShift AI by clicking on the

button.

You will need to authorize yourself access to your workbench. Click .

Using an OpenShift AI Python Workbench

Using a Workbench Terminal to load course resources

You will want to open a Terminal inside your OpenShift AI Workbench to load the course resources. There are many ways to open a terminal, but here is one that always works.

At the top, click

.

Clone the smartabyar-smartvillage-sandbox-course course

With git, clone the course materials to the default home directory (/opt/app-root/src) of your workbench.

git clone https://github.com/smartabyar-smartvillage/smartabyar-smartvillage-sandbox-course.git ~/smartabyar-smartvillage-sandbox-course

It will ask you to enter your username and password. This is where you enter your GitHub username, and the token value you copied from GitHub earlier. The git credential.helper store should remember your password.

Open the course Jupyter Notebook

A Jupyter Notebook is an interactive, online notebook, and the rest of the course be found in the Jupter Notebook. Here is how to find the course Jupyter Notebook.

Next...

If you have successfully ran all of the commands above, congratulations, you are ready to move on to the next notebook in the course.