Prerequisites:
- Red Hat Developer Sandbox
- GitHub account
Step-by-step guide:
1. Explore the OpenShift AI dashboard
In this section, you will discover how to start an OpenShift AI instance from the OpenShift Sandbox cluster, enabling exploration of the myriad possibilities offered by artificial intelligence and machine learning. The following steps will guide you through the process of getting started with OpenShift AI.
- First, log in to your OpenShift Sandbox cluster.
- From the OpenShift dashboard, click the cube icon on the top right.
You will see the Red Hat OpenShift AI option in the dropdown menu as shown in the following Figure 1. Click on it.
Click on "Log in with OpenShift" and sign in with your username and password for your OpenShift cluster.
You will land on the OpenShift AI dashboard as shown below. The Explore tab will offer you more options for applications of Red Hat OpenShift AI instances.
On the dashboard, we can see "Enabled" applications such as Jupyter, which come built-in and supported by Red Hat, similar to the following Figure 3 below.
Under the "Applications" section, locate the "Enabled" option to find active instances of AI application development. By default, Jupyter is already activated, and we will utilize it within this learning exercise.
The Resources link offers tutorials and documentation on how to use OpenShift AI, including partner software. Quick starts are embedded in the application itself and offer an in-line tutorial experience.
2. Navigate to the Data Science project
In the Sandbox environment, a Data Science project is pre-created for your convenience. Please navigate to and open this project to set up a Workbench.
- Click on "Data Science Projects".
- You should see the pre-created Data Science project with your username.
- Click on it to open the project.
3. Create the Workbench for Jupyter notebook server
The Data Science Project serves as a registry for the Jupyter notebook we will create. You will be directed to the component page of the Data Science project. On this page, we need to define the configurations of Jupyter Notebook server images, such as Simple Data Science, TensorFlow, PyTorch, and others. Additionally, we can specify the server size, similar to Figure 6.
- Select the Workbenches component option and click on the "Create Workbench" option.
- Give it a name.
- Select the Notebook image from the image selection dropdown as Standard Data Science.
- Select the Container size to small under "Deployment size".
- Scroll down and in the storage cluster, give it a storage name.
- Define the required storage size in Gi. Set the storage size to 10 Gi.
Note: The OpenShift Developer Sandbox has a storage restriction, limiting it to 15GB. Therefore, default values cannot be used in this context.
- Click on Create workbench.
After successful implementation, the status of the workbench turns to "Running," similar to as shown in the above image.
- Click on the "Open" button, beside the status.
- Authorize access with the OpenShift cluster by clicking on the "Allow selected permissions", as shown in Figure 9.
After granting permissions with OpenShift, you will be directed to the Jupyter Notebook page, resembling Figure 10 below.
4. How to get the existing data science project in Jupyter notebook
The Jupyter notebook provides functionality to fetch or clone existing GitHub repositories, similar to any other standard IDE. Therefore, in this lesson, we will clone an existing simple ML/AI code into the notebook using the following instructions.
- From the top, click on the "Git Clone" icon, similar to as shown in the following Figure 11.
- In the pop-up window, define the following GitHub URL:
https://github.com/redhat-developer-demos/openshift-ai.git - Click on the Clone button as shown in Figure 12.
After fetching the GitHub repository, the project will appear in the directory section on the left side of the notebook.
- Checkout the “/openshift-ai/first-app/” directory.
- Open the “openshift-ai-test.ipynb” file.
You will get the view of a Jupyter notebook.
5. Learn how to execute code in a Jupyter notebook
In the last lesson, we imported and opened the notebook. To execute, click on the "Execute" icon, as shown in Figure 13 below.
After clicking, you'll observe the transition to the next block of the notebook. Essentially, we've segmented the single program into multiple blocks. This approach facilitates easier development and debugging of the program.
Summary
We guided you through accessing OpenShift AI from the OpenShift sandbox cluster and demonstrated the process of fetching a GitHub repository within the JupyterLab environment. Additionally, we explored using the Jupyter IDE and executing sample machine learning programs.
Our aim is to ensure the success of your data science projects, not just as experiments, but as part of the next generation of intelligent applications.